Skip to main content

Trade_account

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

Interfaces​

deposit​

PathMnemonicTypeDescription
opuint320x30a3f9bc
query_iduint64query id
new_codemaybe_cellupgraded code of trade account contract from pool contract.
initial_datamaybe_cellinitial storage data for trade account.
amount_xcoinsamount of first asset being deposited to trade account.
amount_ycoinsamount of second asset being deposited to trade account.
forward_payloadmaybe_cellforward payload for deposit. Trade account owner recieves it after deposit.

swap​

This message is external.

Send swap_from_account operation to pool address.

PathMnemonicTypeDescription
opuint320x7a92abc1
query_iduint64query id
valid_untiluint32
number_of_seqnouint4
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_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_bodyslippagecoinsminimum amount of token out (normal slippage)
swap_bodyexact_outcoinsexact out of tokens to recieve from swap. 0 if no exact_out present.
swap_bodyreject_payloadmaybe_cellreject payload for swap. Trade account owner recieves it in case of refund.
swap_bodyforward_payloadmaybe_cellforward payload for swap. Trade account owner recieves it with swapped tokens.
signatureuint512signature of message body above. Same scheme as externals to wallet.

withdraw​

This message is external.

Send withdraw operation to pool contract.

PathMnemonicTypeDescription
opuint320x28a95055
query_iduint64query id
valid_untiluint32
number_of_seqnouint4
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.
withdraw_bodyamountcoinsamount of nanoton trade account will be sending with the message to the pool.
withdraw_bodymodeuint16mode of message trade account will be sedning to the pool.
withdraw_bodyreceiver_addressaddressreciever address.
withdraw_bodyx_amountcoinsamount of first asset is being withdrawn.
withdraw_bodyy_amountcoinsamount of second asset is being withdrawn.
withdraw_bodyforward_payloadmaybe_cellforward payload for withdraw. receiver_address receives it with assets from pool.
signatureuint512signature of message body above. Same scheme as externals to wallet

provide​

This message is external.

Send withdraw operation to pool contract.

PathMnemonicTypeDescription
opuint320xbcef131d
query_iduint64query id
valid_untiluint32
number_of_seqnouint4
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.
provide_bodyamountcoinsamount of nanoton trade account will be sending with the message to the pool.
provide_bodymodeuint16mode of message trade account will be sedning to the pool.
provide_bodyx_amountcoinsamount of first asset is being withdrawn.
provide_bodyy_amountcoinsamount of second asset is being withdrawn.
provide_bodylock_liquidity?bool
provide_bodyreject_payloadmaybe_cellreject payload for providing liquidity. Trade account owner recieves it with refund.
provide_bodyforward_payloadmaybe_cellforward payload for providing liquidity. Trade account owner recieves it after notification from lp jetton wallet.
signatureuint512signature of message body above. Same scheme as externals to wallet

burn​

This message is external.

Send withdraw operation to pool contract.

PathMnemonicTypeDescription
opuint320xa5333a4
query_iduint64query id
valid_untiluint32
number_of_seqnouint4
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.
burn_bodyamountcoinsamount of nanoton trade account will be sending with the message to the pool.
burn_bodymodeuint16mode of message trade account will be sedning to the pool.
burn_bodylp_amountcoinsamount of lp tokens to burn
burn_bodylp_wallet_addressaddress
burn_bodyforward_payloadmaybe_cellforward payload for burn. Trade account owner recieves it after deposit.
signatureuint512signature of message body above. Same scheme as externals to wallet

deposit_notification​

PathMnemonicTypeDescription
opuint320x8d0426f
query_iduint64query id

provide_liquidity_notification​

PathMnemonicTypeDescription
opuint320x9e88c500
query_iduint64query id

change_public_key​

This message is external.

Change public key on trade account.

PathMnemonicTypeDescription
opuint320xf0cf70b3
query_iduint64query id
valid_untiluint32
number_of_seqnouint4
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.
burn_bodynew_public_keyuint256
signatureuint512signature of message body above. Same scheme as externals to wallet

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_public_key​

Return​

PathMnemonicTypeDescription
public_keynumberpublic key of trade account. In most cases should be the public key of owner's wallet.

get_seqno​

Return​

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

get_seqno_slice​

Return​

PathMnemonicTypeDescription
seqnossliceslice of all trade account seqnos

get_seqno_by_number​

Input​

PathMnemonicTypeDescription
number_of_seqnonumberindex of seqno

Return​

PathMnemonicTypeDescription
seqnonumberone of seqnos value by index

get_user_address​

Return​

PathMnemonicTypeDescription
user_addressaddress

get_storage​

Return​

PathMnemonicTypeDescription
storagecellfull current storage of the contract.