Limit

Documentation dedicated to limit orders on our platform.

Moon.cx limit order offers you greater control over your trades by allowing you to set a price limit and avoid potential losses from market volatility. Once the order is placed, it becomes accessible to "takers" who are interested in trading at your specified price. Your trades will not be affected by slippage errors, ensuring a smooth trading experience. Your trades are protected from being front-run by bots.


For Takers

There are 3 types of limit orders available:

  1. A limit order to exchange TON for JETTON

  2. A limit order to exchange JETTON for TON

  3. A limit order to exchange JETTON for JETTON

You can track incoming orders through the designated FACTORY address. After receiving order data, a decision can be made regarding order fulfillment. Order fulfillment can be achieved through our platform or by utilizing external protocols, DEXes, and other compatible methods.

We suggest using our SDK

There is a 0.2% protocol fee for both makers and takers.

Get methods

(cell, cell, cell) get_order_info()

cell #1
order_balance :: Coins
order_index :: uint64
order_status :: uint8
order_kind :: uint8
order_rate :: uint256
order_fee :: uint16
order_creator :: Address
jetton_amount :: Coins // 0 if kind == 1.

cell #2
jetton_maker_order_address :: Address
jetton_maker_master_address :: Address

cell #3
jetton_taker_order_address :: Address
jetton_taker_master_address :: Address

(int, int) get_amount_out(int amount_in)

int amount_out, int refund_amount

(int) get_status()

1 - order active, 0 - order inactive.

(int) get_kind()

1 - TON to JETTON, 2 - JETTON to TON, 3 - JETTON to JETTON.

(int) get_rate()

order_rate = (taker_amount * 10^36) / maker_amount

maker_amount = (taker_amount * 10^36) / order_rate

taker_amount = (maker_amount * order_rate) / 10^36 

max_taker_amount = (order_balance * order_rate) / 10^36

(int) get_amount()

kind == 2|3, returns jetton amount. kind == 1, returns ton amount.

(slice) get_maker_master()
(slice) get_taker_master()

Last updated