Stores user's virtual funds, enabling operations without jetton transfer.
Interfaces
swap
This message is external.
Send swap_from_account operation to pool address.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x7049a968 |
| query_id | uint64 | query id |
| valid_until | uint32 | |
| number_of_seqno | uint4 | which of 16 seqno will be used. |
| seqno | uint32 | current sequence number of trade account. Same logic as wallet contract - increases with every successfull external message. |
| pool_address | address | pool address to which trade account contract belongs to. |
| seed | cell | seed of deployed trade account. |
| swap_body | amount | coins | amount of nanoton trade account will be sending with the message to the pool. |
| swap_body | mode | uint16 | mode of message trade account will be sedning to the pool. |
| swap_body | asset_amount | coins | amount of asset is being send for swap to the pool. |
| swap_body | is_x | bool | first or second asset will be sent to the pool. |
| swap_body | partial_execution | int | flag of further parsing (see below) |
| partial_execution=0 | normal_slippage | coins | min token out. |
| partial_execution=1 | slippage | uint256 | last sqrt price of swap. |
| swap_body | exact_out | coins | exact out of tokens to recieve from swap. |
| swap_body | reject_payload | maybe_cell | reject payload for swap. Trade account owner recieves it in case of refund. |
| swap_body | forward_payload | maybe_cell | forward payload for swap. Trade account owner recieves it with swapped tokens. |
| signature | uint512 | signature of message body above. Same scheme as externals to wallet. |
provide
This message is external.
Send ta_provide operation to pool address.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x49711c26 |
| query_id | uint64 | query id |
| valid_until | uint32 | |
| number_of_seqno | uint4 | which of 16 seqno will be used. |
| seqno | uint32 | current sequence number of trade account. Same logic as wallet contract - increases with every successfull external message. |
| pool_address | address | pool address to which trade account contract belongs to. |
| seed | cell | seed of deployed trade account. |
| provide_body | amount | coins | amount of nanoton trade account will be sending with the message to the pool. |
| provide_body | mode | uint16 | mode of message trade account will be sedning to the pool. |
| provide_body | deposit_type | uint3 | one of deploy |
| provide_body | liquidity_dict | dict | dictionary of tokens for each bin of provision. |
| provide_body | amount_x | coins | amount of first asset to deposit on lp account. |
| provide_body | amount_y | coins | amount of second asset to deposit on lp account. |
| provide_body | reject_payload | maybe_cell | reject payload for liquidity provision. Sender recieves it with tokens refund. |
| provide_body | forward_payload | maybe_cell | forward payload for liquidity provision. Sender recieves it with notify from lp multitoken contract. |
| signature | uint512 | signature of message body above. Same scheme as externals to wallet. |
withdraw
This message is external.
Send withdraw operation to pool contract.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x9957277e |
| query_id | uint64 | query id |
| valid_until | uint32 | |
| number_of_seqno | uint4 | which of 16 seqno will be used. |
| seqno | uint32 | current sequence number of trade account. Same logic as wallet contract - increases with every successfull external message. |
| pool_address | address | pool address to which trade account contract belongs to. |
| seed | cell | seed of deployed trade account. |
| swap_body | amount | coins | amount of nanoton trade account will be sending with the message to the pool. |
| swap_body | mode | uint16 | mode of message trade account will be sedning to the pool. |
| swap_body | to_address | address | receiver address. |
| swap_body | asset_x_amount | coins | amount of first asset is being withdrawn. |
| swap_body | asset_y_amount | coins | amount of second asset is being withdrawn. |
| swap_body | forward_payload | maybe_cell | forward payload for withdrawing liquidity. |
| signature | uint512 | signature of message body above. Same scheme as externals to wallet |
change_public_key
This message is external.
Change public key of trade account.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x9a669816 |
| query_id | uint64 | query id |
| valid_until | uint32 | |
| number_of_seqno | uint4 | which of 16 seqno will be used. |
| seqno | uint32 | current sequence number of trade account. Same logic as wallet contract - increases with every successfull external message. |
| pool_address | address | pool address to which trade account contract belongs to. |
| seed | cell | seed of deployed trade account. |
| pkey_body | public_key | uint256 | new public key. |
| signature | uint512 | signature of message body above. Same scheme as externals to wallet |
burn
This message is external.
Send burn custom shape liquidity operation to lpmt contract.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x88310d |
| query_id | uint64 | query id |
| valid_until | uint32 | |
| number_of_seqno | uint4 | which of 16 seqno will be used. |
| seqno | uint32 | current sequence number of trade account. Same logic as wallet contract - increases with every successfull external message. |
| pool_address | address | pool address to which trade account contract belongs to. |
| seed | cell | seed of deployed trade account. |
| swap_body | amount | coins | amount of nanoton trade account will be sending with the message to the lpmt. |
| swap_body | mode | uint16 | mode of message trade account will be sedning to the lpmt. |
| swap_body | to_address | address | receiver address. |
| swap_body | burn_dict | dict | dictionary of lp tokens for each bin of burn. |
| swap_body | forward_payload | maybe_cell | forward payload for burning liquidity. |
| signature | uint512 | signature of message body above. Same scheme as externals to wallet |
burn_all
This message is external.
Send burn all liquidity operation to lpmt contract.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x52ea2d1e |
| query_id | uint64 | query id |
| valid_until | uint32 | |
| number_of_seqno | uint4 | which of 16 seqno will be used. |
| seqno | uint32 | current sequence number of trade account. Same logic as wallet contract - increases with every successfull external message. |
| pool_address | address | pool address to which trade account contract belongs to. |
| seed | cell | seed of deployed trade account. |
| swap_body | amount | coins | amount of nanoton trade account will be sending with the message to the lpmt. |
| swap_body | mode | uint16 | mode of message trade account will be sedning to the lpmt. |
| swap_body | to_address | address | receiver address. |
| swap_body | forward_payload | maybe_cell | forward payload for burning liquidity. |
| signature | uint512 | signature of message body above. Same scheme as externals to wallet |
swap
Internal interface for sending swap_from_account operation to pool.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x7049a968 |
| query_id | uint64 | query id |
| new_code | maybe_cell | upgraded code of trade account contract. |
| amount | coins | amount of nanoton trade account will be sending with the message to the pool. |
| mode | uint16 | mode of message trade account will be sedning to the pool. |
| asset_amount | coins | amount of asset is being send for swap to the pool. |
| is_x | bool | first or second asset will be sent to the pool. |
| partial_execution | int | flag of further parsing (see below) |
| partial_execution=0 | normal_slippage | coins | min token out. |
| partial_execution=1 | slippage | uint256 | last sqrt price of swap. |
| exact_out | coins | exact out of tokens to recieve from swap. |
| reject_payload | maybe_cell | reject payload for swap. Trade account owner recieves it in case of refund. |
| forward_payload | maybe_cell | forward payload for swap. Trade account owner recieves it with swapped tokens. |
provide
Internal interface for sending ta_provide operation to pool.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x49711c26 |
| query_id | uint64 | query id |
| new_code | maybe_cell | upgraded code of trade account contract. |
| amount | coins | amount of nanoton trade account will be sending with the message to the pool. |
| mode | uint16 | mode of message trade account will be sedning to the pool. |
| deposit_type | uint3 | one of deploy |
| liquidity_dict | dict | dictionary of tokens for each bin of provision. |
| amount_x | coins | amount of first asset to deposit on lp account. |
| amount_y | coins | amount of second asset to deposit on lp account. |
| reject_payload | maybe_cell | reject payload for liquidity provision. Sender recieves it with tokens refund. |
| forward_payload | maybe_cell | forward payload for liquidity provision. Sender recieves it with notify from lp multitoken contract. |
withdraw
Internal interface for sending withdraw operation to pool.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x9957277e |
| query_id | uint64 | query id |
| new_code | maybe_cell | upgraded code of trade account contract. |
| amount | coins | amount of nanoton trade account will be sending with the message to the pool. |
| mode | uint16 | mode of message trade account will be sedning to the pool. |
| to_address | address | receiver address. |
| asset_x_amount | coins | amount of first asset is being withdrawn. |
| asset_y_amount | coins | amount of second asset is being withdrawn. |
deposit
Interface for depositing balance from pool contract.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0xc53df687 |
| query_id | uint64 | query id |
| new_code | maybe_cell | upgraded code of trade account contract from pool contract. |
| amount_x | coins | amount of first asset being deposited to trade account. |
| amount_y | coins | amount of second asset being deposited to trade account. |
| forward_payload | maybe_cell | forward 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.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x9a669816 |
| query_id | uint64 | query id |
| new_code | maybe_cell | upgraded code of trade account contract. |
| public_key | uint256 | new public key. |
burn
Internal interface for sending burn custom shape liquidity operation to lpmt contract.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x88310d |
| query_id | uint64 | query id |
| new_code | maybe_cell | upgraded code of trade account contract. |
| amount | coins | amount of nanoton trade account will be sending with the message to the lpmt. |
| mode | uint16 | mode of message trade account will be sedning to the lpmt. |
| to_address | address | multitoken address. |
| burn_dict | dict | dictionary of lp tokens for each bin of burn. |
| forward_payload | maybe_cell | forward 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.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x52ea2d1e |
| query_id | uint64 | query id |
| new_code | maybe_cell | upgraded code of trade account contract. |
| amount | coins | amount of nanoton trade account will be sending with the message to the lpmt. |
| mode | uint16 | mode of message trade account will be sedning to the lpmt. |
| to_address | address | multitoken address. |
| forward_payload | maybe_cell | forward payload for liquidity provision. Sender recieves it with notify from lp multitoken contract. |
Get-methods
get_deposit_balance
Return
| Path | Mnemonic | Type | Description |
|---|
| amount_x | number | amount of first asset currently deposited on trade account contract. |
| amount_y | number | amount of second asset currently deposited on trade account contract. |
get_pool_address
Return
| Path | Mnemonic | Type | Description |
|---|
| pool_address | address | pool address to which trade account contract belongs to. |
get_public_key
Return
| Path | Mnemonic | Type | Description |
|---|
| public_key | number | public key of trade account. In most cases should be the public key of owner's wallet. |
get_seqno
Return
| Path | Mnemonic | Type | Description |
|---|
| seqno | number | current sequence number. Same logic as wallet contract - increases with every successfull external message. |
get_seqno_slice
Return
| Path | Mnemonic | Type | Description |
|---|
| seqnos | slice | slice of all trade account seqnos |
get_seqno_by_number
| Path | Mnemonic | Type | Description |
|---|
| number_of_seqno | number | index of seqno |
Return
| Path | Mnemonic | Type | Description |
|---|
| seqno | number | one of seqnos value by index |
get_storage
Return
| Path | Mnemonic | Type | Description |
|---|
| storage | cell | full current storage of the contract. |