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
opuint320x7049a968
query_iduint64query id
valid_untiluint32
number_of_seqnouint4which of 16 seqno will be used.
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_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.
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.

provide

This message is external.

Send ta_provide operation to pool address.

PathMnemonicTypeDescription
opuint320x49711c26
query_iduint64query id
valid_untiluint32
number_of_seqnouint4which of 16 seqno will be used.
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_bodydeposit_typeuint3one of deploy
provide_bodyliquidity_dictdictdictionary of tokens for each bin of provision.
provide_bodyamount_xcoinsamount of first asset to deposit on lp account.
provide_bodyamount_ycoinsamount of second asset to deposit on lp account.
provide_bodyreject_payloadmaybe_cellreject payload for liquidity provision. Sender recieves it with tokens refund.
provide_bodyforward_payloadmaybe_cellforward payload for liquidity provision. Sender recieves it with notify from lp multitoken contract.
signatureuint512signature of message body above. Same scheme as externals to wallet.

withdraw

This message is external.

Send withdraw operation to pool contract.

PathMnemonicTypeDescription
opuint320x9957277e
query_iduint64query id
valid_untiluint32
number_of_seqnouint4which of 16 seqno will be used.
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_addressaddressreceiver address.
swap_bodyasset_x_amountcoinsamount of first asset is being withdrawn.
swap_bodyasset_y_amountcoinsamount of second asset is being withdrawn.
swap_bodyforward_payloadmaybe_cellforward payload for withdrawing liquidity.
signatureuint512signature of message body above. Same scheme as externals to wallet

change_public_key

This message is external.

Change public key of trade account.

PathMnemonicTypeDescription
opuint320x9a669816
query_iduint64query id
valid_untiluint32
number_of_seqnouint4which of 16 seqno will be used.
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.
pkey_bodypublic_keyuint256new public key.
signatureuint512signature of message body above. Same scheme as externals to wallet

burn

This message is external.

Send burn custom shape liquidity operation to lpmt contract.

PathMnemonicTypeDescription
opuint320x88310d
query_iduint64query id
valid_untiluint32
number_of_seqnouint4which of 16 seqno will be used.
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 lpmt.
swap_bodymodeuint16mode of message trade account will be sedning to the lpmt.
swap_bodyto_addressaddressreceiver address.
swap_bodyburn_dictdictdictionary of lp tokens for each bin of burn.
swap_bodyforward_payloadmaybe_cellforward payload for burning liquidity.
signatureuint512signature of message body above. Same scheme as externals to wallet

burn_all

This message is external.

Send burn all liquidity operation to lpmt contract.

PathMnemonicTypeDescription
opuint320x52ea2d1e
query_iduint64query id
valid_untiluint32
number_of_seqnouint4which of 16 seqno will be used.
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 lpmt.
swap_bodymodeuint16mode of message trade account will be sedning to the lpmt.
swap_bodyto_addressaddressreceiver address.
swap_bodyforward_payloadmaybe_cellforward payload for burning liquidity.
signatureuint512signature of message body above. Same scheme as externals to wallet

swap

Internal interface for sending swap_from_account operation to pool.

PathMnemonicTypeDescription
opuint320x7049a968
query_iduint64query id
new_codemaybe_cellupgraded code of 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.
reject_payloadmaybe_cellreject payload for swap. Trade account owner recieves it in case of refund.
forward_payloadmaybe_cellforward payload for swap. Trade account owner recieves it with swapped tokens.

provide

Internal interface for sending ta_provide operation to pool.

PathMnemonicTypeDescription
opuint320x49711c26
query_iduint64query id
new_codemaybe_cellupgraded code of 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.
deposit_typeuint3one of deploy
liquidity_dictdictdictionary of tokens for each bin of provision.
amount_xcoinsamount of first asset to deposit on lp account.
amount_ycoinsamount of second asset to deposit on lp account.
reject_payloadmaybe_cellreject payload for liquidity provision. Sender recieves it with tokens refund.
forward_payloadmaybe_cellforward payload for liquidity provision. Sender recieves it with notify from lp multitoken contract.

withdraw

Internal interface for sending withdraw operation to pool.

PathMnemonicTypeDescription
opuint320x9957277e
query_iduint64query id
new_codemaybe_cellupgraded code of 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.
to_addressaddressreceiver address.
asset_x_amountcoinsamount of first asset is being withdrawn.
asset_y_amountcoinsamount of second asset is being withdrawn.

deposit

Interface for depositing balance from pool contract.

PathMnemonicTypeDescription
opuint320xc53df687
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.
forward_payloadmaybe_cellforward payload for liquidity provision. Sender recieves it with notify from lp multitoken contract.

change_public_key

Internal interface for changing public key of trade account.

PathMnemonicTypeDescription
opuint320x9a669816
query_iduint64query id
new_codemaybe_cellupgraded code of trade account contract.
public_keyuint256new public key.

burn

Internal interface for sending burn custom shape liquidity operation to lpmt contract.

PathMnemonicTypeDescription
opuint320x88310d
query_iduint64query id
new_codemaybe_cellupgraded code of trade account contract.
amountcoinsamount of nanoton trade account will be sending with the message to the lpmt.
modeuint16mode of message trade account will be sedning to the lpmt.
to_addressaddressmultitoken address.
burn_dictdictdictionary of lp tokens for each bin of burn.
forward_payloadmaybe_cellforward payload for liquidity provision. Sender recieves it with notify from lp multitoken contract.

burn_all

Internal interface for sending burn all liquidity operation to lpmt contract.

PathMnemonicTypeDescription
opuint320x52ea2d1e
query_iduint64query id
new_codemaybe_cellupgraded code of trade account contract.
amountcoinsamount of nanoton trade account will be sending with the message to the lpmt.
modeuint16mode of message trade account will be sedning to the lpmt.
to_addressaddressmultitoken address.
forward_payloadmaybe_cellforward payload for liquidity provision. Sender recieves it with notify from lp multitoken contract.

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_storage

Return

PathMnemonicTypeDescription
storagecellfull current storage of the contract.