Stores user's virtual funds, enabling operations without jetton transfer.
Interfaces
deposit
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x30a3f9bc |
| 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 deposit. Trade account owner recieves it after deposit. |
swap
This message is external.
Send swap_from_account operation to pool address.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x7a92abc1 |
| query_id | uint64 | query id |
| valid_until | uint32 | None |
| number_of_seqno | uint4 | None |
| 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 | slippage | coins | minimum amount of token out (normal slippage) |
| swap_body | exact_out | coins | exact out of tokens to recieve from swap. 0 if no exact_out present. |
| 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. |
withdraw
This message is external.
Send withdraw operation to pool contract.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x28a95055 |
| query_id | uint64 | query id |
| valid_until | uint32 | None |
| number_of_seqno | uint4 | None |
| 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. |
| withdraw_body | amount | coins | amount of nanoton trade account will be sending with the message to the pool. |
| withdraw_body | mode | uint16 | mode of message trade account will be sedning to the pool. |
| withdraw_body | receiver_address | address | reciever address. |
| withdraw_body | x_amount | coins | amount of first asset is being withdrawn. |
| withdraw_body | y_amount | coins | amount of second asset is being withdrawn. |
| withdraw_body | forward_payload | maybe_cell | forward payload for withdraw. receiver_address receives it with assets from pool. |
| signature | uint512 | signature of message body above. Same scheme as externals to wallet |
provide
This message is external.
Send withdraw operation to pool contract.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0xbcef131d |
| query_id | uint64 | query id |
| valid_until | uint32 | None |
| number_of_seqno | uint4 | None |
| 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 | x_amount | coins | amount of first asset is being withdrawn. |
| provide_body | y_amount | coins | amount of second asset is being withdrawn. |
| provide_body | lock_liquidity? | bool | None |
| provide_body | reject_payload | maybe_cell | reject payload for providing liquidity. Trade account owner recieves it with refund. |
| provide_body | forward_payload | maybe_cell | forward payload for providing liquidity. Trade account owner recieves it after notification from lp jetton wallet. |
| signature | uint512 | signature of message body above. Same scheme as externals to wallet |
burn
This message is external.
Send withdraw operation to pool contract.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0xa5333a4 |
| query_id | uint64 | query id |
| valid_until | uint32 | None |
| number_of_seqno | uint4 | None |
| 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. |
| burn_body | amount | coins | amount of nanoton trade account will be sending with the message to the pool. |
| burn_body | mode | uint16 | mode of message trade account will be sedning to the pool. |
| burn_body | lp_amount | coins | amount of lp tokens to burn |
| burn_body | lp_wallet_address | address | None |
| burn_body | forward_payload | maybe_cell | forward payload for burn. Trade account owner recieves it after deposit. |
| signature | uint512 | signature of message body above. Same scheme as externals to wallet |
deposit_notification
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x8d0426f |
| query_id | uint64 | query id |
provide_liquidity_notification
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0x9e88c500 |
| query_id | uint64 | query id |
change_public_key
This message is external.
Change public key on trade account.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0xf0cf70b3 |
| query_id | uint64 | query id |
| valid_until | uint32 | None |
| number_of_seqno | uint4 | None |
| 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. |
| burn_body | new_public_key | uint256 | None |
| signature | uint512 | signature of message body above. Same scheme as externals to wallet |
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_user_address
Return
| Path | Mnemonic | Type | Description |
|---|
| user_address | address | None |
get_storage
Return
| Path | Mnemonic | Type | Description |
|---|
| storage | cell | full current storage of the contract. |