Learn how to use LIMIT & DCA orders
xVerify
. This is a special json-formatted string that
confirms ownership of the associated wallet.
The easiest way to obtain it is to authorize with your wallet at our website and to
steal it from within browser’s network profiling page (it will be in sent-headers section).
The manual way to generate it is to authenticate swap.coffee
domain using Ton Connect. More details about it
available in their documentation.
max_suborders
- maximum amount of sub-orders this order may be split into. Must be within bounds [1; 255]
.max_invocations
- maximum amount of sub-orders execution tries. Must be within bounds [max_suborders; 255]
.
What we mean by try here is as follows:
slippage
- this term means the same as in normal routing construction, but for LIMIT orders (when the system
must guarantee that the order will be filled at no less than the user’s requested price) it also affects how much the
price must exceed the user’s requested price before the order will be attempted to be filled.
For example, 0.001
(0.1%) value set for LIMIT order, in which user wants to exchange 1 TON for at least 10 USDT,
means that order will be executed when price reaches at least 10 * (1 + 0.001) = 10 * 1.001 = 10.01
USDT for 1 TON.
Must be within bounds (0; 1]
.settings
is the only field that is truly unique for each order type. Below it is analyzed in detail.getStrategyOrder
that looks for specific order identifier,
and getStrategyOrders
that supports filtering and allows to get data for multiple orders at once.
Both of those methods return structure known as StrategyOrder
, which looks as follows:
Field name | Field type | Meaning |
---|---|---|
id | int32 | Order’s identifier. Unique for every order. |
type | enum (string) | Order’s type. |
wallet | string | Address of strategies wallet associated with the order. Wallets of orders of the same user are always identical. |
status | enum (string) | Current status of the order:
|
creation_timestamp | int64 | Order’s creation timestamp in unix time seconds. |
initial_input_amount | string | Absolute amount of the input asset (token_from ) when this order was created. |
current_input_amount | string | Absolute amount of the input asset (token_from ) as for now. May be zero if the whole input asset amount was consumed. This field does not always decrease: it may decrease when our service sends exchange transaction, but increase back if that transaction fails. |
current_output_amount | string | Absolute amount of the output asset (token_to ) as for now. Starts at zero. Never decreases. |
settings | structure | Order’s settings that are unique for each strategy. May include some additional (technical) fields, that were not present at the time order was created. |
max_suborders | int8 | Maximum amount of order’s suborders. Order was created with that value. |
suborders_executed | int8 | Amount of order’s suborders that were successfully executed as for now. |
max_invocations | int8 | Maximum amount of order’s invocations (tries). Order was created with that value. |
invocations_executed | int8 | Amount of order’s invocations (_tries) that were executed (not necessarily successfully). |
slippage | float | Slippage with which order was created. |
max_path_length | int3 | Maximum length of routes for which transactions may be executed within this order, in tokens. So, for example, 2 means that only routes such as A -> B may be executed, and so on. This field is being set internally and therefore could not be modified in any way. |
active_transactions | int8 | Amount of order’s transactions that were sent to the blockchain and which execution status still was not handled by our service. |
close_timestamp | int64 | Optional field that is present for orders in terminal status only. Signifies order’s closing timestamp in unix time seconds. |
current_input_amount
and current_output_amount
include fees to be withdrawn by our service (if any).
Currently, there is no API functionality that allows to distinct funds to be sent to the user and service fees.
active
status, user is able to cancel it by calling appropriate method: