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 | 0xefbbd1b8 |
| query_id | uint64 | query id |
| valid_until | uint32 | |
| 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 | to_address | address | reciever address. |
| swap_body | account? | bool | is reciever same trade account contract. |
| 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. |
| 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 | 0xa3dbaae5 |
| query_id | uint64 | query id |
| valid_until | uint32 | |
| 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 | reciever 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. |
| 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 | 0xefbbd1b8 |
| query_id | uint64 | query id |
| to_address | address | reciever address. |
| account? | bool | is reciever same 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. |
withdraw
Internal interface for sending withdraw operation to pool.
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0xa3dbaae5 |
| query_id | uint64 | query id |
| 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 | reciever address. |
| asset_x_amount | coins | amount of first asset is being withdrawn. |
| asset_y_amount | coins | amount of second asset is being withdrawn. |
deposit
| Path | Mnemonic | Type | Description |
|---|
| op | uint32 | 0xfce1a3e6 |
| 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. |
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_seqno
Return
| Path | Mnemonic | Type | Description |
|---|
| seqno | number | current sequence number. Same logic as wallet contract - increases with every successfull external message. |
get_storage
Return
| Path | Mnemonic | Type | Description |
|---|
| storage | cell | full current storage of the contract. |