Violet

Meso Market

On this page

Use core.meso_market to inspect the open Meso Market and submit buy or sell orders.

Market state required

Rates and listing counts are available only while the Meso Market is open. Read functions return nil when it is unavailable, and actions return false.

Actions validate their arguments and the current interface state. A true result means the action was submitted, not that it has completed.

rate is measured in Maple Points per 100,000,000 Mesos. count is the number of 100,000,000-Meso units. Accepted rates are 100 through 50,000 and accepted counts are 1 through 50. Non-whole values and values outside these ranges raise a Lua error.

Functions

core.meso_market.is_open() -> boolean

Returns whether the Meso Market is currently open and available.


core.meso_market.get_average_rate() -> number | nil

Returns the displayed recent average exchange rate in Maple Points per 100,000,000 Mesos.


core.meso_market.get_remaining_listings() -> number | nil

Returns the remaining buy/sell registration count reported by the open market. This is not the number of orders available for matching.


core.meso_market.get_sell_rate() -> number | nil

Returns the current immediate sell rate, or 0 when no quote is available.


core.meso_market.get_buy_rate() -> number | nil

Returns the current immediate buy rate, or 0 when no quote is available.


core.meso_market.buy(rate: number, count: number) -> boolean

Submits a request for count * 100,000,000 Mesos at a total of rate * count Maple Points.


core.meso_market.sell(rate: number, count: number) -> boolean

Submits an offer of count * 100,000,000 Mesos for a total of rate * count Maple Points. Server eligibility rules and fees still apply.

lua
if core.meso_market.is_open() then
    local rate = core.meso_market.get_buy_rate()
    if rate then
        local submitted = core.meso_market.buy(rate, 1)
    end
end