Stores liquidity assets, routes messages for adding liquidity and swaps to the appropriate range contracts, ensures payouts to users.
Interfaces
swap
This message should be sent as forward_payload of jetton-transfer.
Route jetton swap operation to range contract.
Path | Mnemonic | Type | Description |
---|
| op | uint32 | 0xf2ef6c1b |
| query_id | uint64 | query id |
| to_address | address | reciever address. |
| 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. 0 if no exact_out present. |
| ref_addr | address | if null address then no referral fee applied. |
| additional_data | maybe_cell | additional data for swap. Now it is address of swap origin. |
| reject_payload | maybe_cell | reject payload for swap. Sender recieves it with tokens refund. |
| forward_payload | maybe_cell | forward payload for swap. Sender recieves it with swapped tokens. |
swap
Route swap operation in native to range contract. works only on native pools.
Path | Mnemonic | Type | Description |
---|
| op | uint32 | 0xf2ef6c1b |
| query_id | uint64 | query id |
| native_amount | coins | amount of tons is being sent for swap. |
| to_address | address | reciever address. |
| 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. 0 if no exact_out present. |
| ref_addr | address | if null address then no referral fee applied. |
| additional_data | maybe_cell | additional data for swap. Now it is address of swap origin. |
| reject_payload | maybe_cell | reject payload for swap. Sender recieves it with tokens refund. |
| forward_payload | maybe_cell | forward payload for swap. Sender recieves it with swapped tokens. |
provide
This message should be sent as forward_payload of jetton-transfer.
Route add liquidity operation in jetton to range contract.
Path | Mnemonic | Type | Description |
---|
| op | uint32 | 0x96feef7b |
| query_id | uint64 | query id |
| deposit_type | uint3 | one of deploy |
| liquidity_type | uint1 | one of custom |
| liquidity_dict | dict | dictionary of tokens for each bin of provision. |
| 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. |
provide_both
This message should be sent as forward_payload of jetton-transfer.
Route add liquidity operation in jetton and native assets to range contract. works only on native pools.
Path | Mnemonic | Type | Description |
---|
| op | uint32 | 0x3ea0bafc |
| query_id | uint64 | query id |
| native_amount | coins | amount of nanoton for liquidity provision. |
| deposit_type | uint3 | one of deploy |
| liquidity_type | uint1 | one of custom |
| liquidity_dict | dict | dictionary of tokens for each bin of provision. |
| 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. |
provide
Route add liquidity operation in native to range contract. works only on native pools.
Path | Mnemonic | Type | Description |
---|
| op | uint32 | 0x96feef7b |
| query_id | uint64 | query id |
| native_amount | coins | amount of nanoton for liquidity provision. |
| deposit_type | uint3 | one of deploy |
| liquidity_type | uint1 | one of custom |
| liquidity_dict | dict | dictionary of tokens for each bin of provision. |
| 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. |
lp_account_provide
Path | Mnemonic | Type | Description |
---|
| op | uint32 | 0xaf31d23f |
| query_id | uint64 | query id |
| user_address | address | lp account's user owner. |
| amount_x | coins | amount of first asset to deposit on lp account. |
| amount_y | coins | amount of second asset to deposit on lp account. |
| deposit_type | uint3 | one of deploy |
| liquidity_type | uint1 | one of custom |
| liquidity_dict | dict | dictionary of tokens for each bin of provision. |
| 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. |
swap_success_callback
Pay user result of swap operation.
Path | Mnemonic | Type | Description |
---|
| op | uint32 | 0x520e4831 |
| query_id | uint64 | query id |
| new_current_bin_number | int32 | new current bin number, that was set after swap on the range contract. |
| new_sqrt_p | int256 | new sqrt price, that was set after swap on the range contract. |
| from_account | bool | always false |
| amount_x | coins | amount of first asset to send. |
| amount_y | coins | amount of second asset to send. |
| is_x | bool | is swap was from asset_x to asset_y or otherwise. |
| receiver_address | address | address that should receive swapped tokens. |
| ref_cell | maybe_cell | cell with referral address if present. |
| from_address | maybe_cell | cell with address that should receive refunded tokens. |
| reject_payload | maybe_cell | reject payload for swap. Sender recieves it with tokens refund. |
| forward_payload | maybe_cell | forward payload for swap. Sender recieves it with swapped tokens. |
success_provide_callback
Pay user refund from add liquidity operation.
Path | Mnemonic | Type | Description |
---|
| op | uint32 | 0x2422cbe |
| query_id | uint64 | query id |
| first_bin | int32 | first bin of sender range contract. Used for validating sender address. |
| amount_x | coins | amount of first asset to send. |
| amount_y | coins | amount of second asset to send. |
| user_address | address | address that should receive swapped tokens. |
| forward_payload | maybe_cell | forward payload for swap. Sender recieves it with swapped tokens. |
success_burn_callback
Pay user result of remove liquidity operation.
Path | Mnemonic | Type | Description |
---|
| op | uint32 | 0x42062d62 |
| query_id | uint64 | query id |
| first_bin | int32 | first bin of sender range contract. Used for validating sender address. |
| amount_x | coins | amount of first asset to send. |
| amount_y | coins | amount of second asset to send. |
| user_address | address | address that should receive swapped tokens. |
| forward_payload | maybe_cell | forward payload for swap. Sender recieves it with swapped tokens. |
lp_account_refund
Path | Mnemonic | Type | Description |
---|
| op | uint32 | 0x9ba48e67 |
| query_id | uint64 | query id |
| amount_x | coins | amount of first asset to withdraw from user's lp account. |
| amount_y | coins | amount of second asset to withdraw from user's lp account. |
| user_address | address | address for calculating lp account's address. |
| forward_payload | maybe_cell | forward payload. |
swap_fallback
Refund user assets after slippage trigger on swap.
Path | Mnemonic | Type | Description |
---|
| op | uint32 | 0x1bba3896 |
| query_id | uint64 | query id |
| first_bin | int32 | first bin of sender range contract. Used for validating sender address. |
| from_account | bool | always false |
| user_address | address | user address. |
| is_x | bool | is swap was from asset_x to asset_y or otherwise. |
| amount | coins | amount of first or second asset. |
| additional_data | maybe_cell | additional data for swap. Now it is address of swap origin. |
| reject_payload | maybe_cell | reject payload for swap. Sender recieves it with tokens refund. |
Get-methods
get_protocol_fees
Collected protocol fees on pool.
Return
Path | Mnemonic | Type | Description |
---|
| collected_token_x_protocol_fee | number | |
| collected_token_y_protocol_fee | number | |
get_pool_info
Return
Path | Mnemonic | Type | Description |
---|
| token_x_address | address | token x jetton wallet |
| token_y_address | address | token y jetton wallet |
| bin_step | number | bin step of pool |
| lp_fee | number | lp fee in pool |
get_active_range
Current active range address.
Return
Path | Mnemonic | Type | Description |
---|
| range_address | address | |
get_range_address
Range address, calculated from first bin number of this range.
Path | Mnemonic | Type | Description |
---|
| first_bin | number | |
Return
Path | Mnemonic | Type | Description |
---|
| range_address | address | |
get_lp_account_address
Path | Mnemonic | Type | Description |
---|
| user_address | address | |
Return
Path | Mnemonic | Type | Description |
---|
| lp_account_address | address | |
get_pool_tokens
Addresses of pool's jetton wallets.
Return
Path | Mnemonic | Type | Description |
---|
| pool_token_x_address | address | token x jetton wallet |
| pool_token_y_address | address | token y jetton wallet |
get_admin_address
Return
Path | Mnemonic | Type | Description |
---|
| admin_address | address | admin of pool |
get_current_bin
Return
Path | Mnemonic | Type | Description |
---|
| current_bin | number | current active bin in pool |
get_sqrt_p
Return
Path | Mnemonic | Type | Description |
---|
| sqrt_p | number | current sqrt_p in pool |
get_is_inited
Return
Path | Mnemonic | Type | Description |
---|
| init | number | init status of pool |
get_tvl
Return
Path | Mnemonic | Type | Description |
---|
| token_x_amount | number | amount of token x in pool |
| token_y_amount | number | amount of token y in pool |
get_fees_info
Fees data, multiplicated by 10000.
Return
Path | Mnemonic | Type | Description |
---|
| ref_fee | number | |
| protocol_fee | number | |
| protocol_fee_address | address | |
get_storage
Return
Path | Mnemonic | Type | Description |
---|
| storage | cell | full current storage of the contract. |