Skip to main content

Trade_account

Stores user's virtual funds, enabling operations without jetton transfer.

Interfaces

swap

This message is external.

Send swap_from_account operation to pool address.

PathMnemonicTypeDescription
opuint320xefbbd1b8
query_iduint64query id
valid_untiluint32
seqnouint32current sequence number of trade account. Same logic as wallet contract - increases with every successfull external message.
pool_addressaddresspool address to which trade account contract belongs to.
seedcellseed of deployed trade account.
swap_bodyto_addressaddressreciever address.
swap_bodyaccount?boolis reciever same trade account contract.
swap_bodyamountcoinsamount of nanoton trade account will be sending with the message to the pool.
swap_bodymodeuint16mode of message trade account will be sedning to the pool.
swap_bodyasset_amountcoinsamount of asset is being send for swap to the pool.
swap_bodyis_xboolfirst or second asset will be sent to the pool.
swap_bodypartial_executionintflag of further parsing (see below)
partial_execution=0normal_slippagecoinsmin token out.
partial_execution=1slippageuint256last sqrt price of swap.
swap_bodyexact_outcoinsexact out of tokens to recieve from swap.
signatureuint512signature of message body above. Same scheme as externals to wallet.

withdraw

This message is external.

Send withdraw operation to pool contract.

PathMnemonicTypeDescription
opuint320xa3dbaae5
query_iduint64query id
valid_untiluint32
seqnouint32current sequence number of trade account. Same logic as wallet contract - increases with every successfull external message.
pool_addressaddresspool address to which trade account contract belongs to.
seedcellseed of deployed trade account.
swap_bodyamountcoinsamount of nanoton trade account will be sending with the message to the pool.
swap_bodymodeuint16mode of message trade account will be sedning to the pool.
swap_bodyto_addressaddressreciever address.
swap_bodyasset_x_amountcoinsamount of first asset is being withdrawn.
swap_bodyasset_y_amountcoinsamount of second asset is being withdrawn.
signatureuint512signature of message body above. Same scheme as externals to wallet

swap

Internal interface for sending swap_from_account operation to pool.

PathMnemonicTypeDescription
opuint320xefbbd1b8
query_iduint64query id
to_addressaddressreciever address.
account?boolis reciever same trade account contract.
amountcoinsamount of nanoton trade account will be sending with the message to the pool.
modeuint16mode of message trade account will be sedning to the pool.
asset_amountcoinsamount of asset is being send for swap to the pool.
is_xboolfirst or second asset will be sent to the pool.
partial_executionintflag of further parsing (see below)
partial_execution=0normal_slippagecoinsmin token out.
partial_execution=1slippageuint256last sqrt price of swap.
exact_outcoinsexact out of tokens to recieve from swap.

withdraw

Internal interface for sending withdraw operation to pool.

PathMnemonicTypeDescription
opuint320xa3dbaae5
query_iduint64query id
amountcoinsamount of nanoton trade account will be sending with the message to the pool.
modeuint16mode of message trade account will be sedning to the pool.
to_addressaddressreciever address.
asset_x_amountcoinsamount of first asset is being withdrawn.
asset_y_amountcoinsamount of second asset is being withdrawn.

deposit

PathMnemonicTypeDescription
opuint320xfce1a3e6
query_iduint64query id
new_codemaybe_cellupgraded code of trade account contract from pool contract.
amount_xcoinsamount of first asset being deposited to trade account.
amount_ycoinsamount of second asset being deposited to trade account.

Get-methods

get_deposit_balance

Return

PathMnemonicTypeDescription
amount_xnumberamount of first asset currently deposited on trade account contract.
amount_ynumberamount of second asset currently deposited on trade account contract.

get_pool_address

Return

PathMnemonicTypeDescription
pool_addressaddresspool address to which trade account contract belongs to.

get_seqno

Return

PathMnemonicTypeDescription
seqnonumbercurrent sequence number. Same logic as wallet contract - increases with every successfull external message.

get_storage

Return

PathMnemonicTypeDescription
storagecellfull current storage of the contract.