Pool State
Typescript SDK: https://github.com/mercurial-finance/mercurial-dynamic-amm-sdk/tree/master/ts-client
Pools State
Key Data retrieved:
Data | Description |
---|---|
lp_mint | LP mint of the pool |
token_a_mint | Pool token A mint. Eg: USDC mint |
token_b_mint | Pool token B mint. Eg: USDT mint |
a_vault | The vault to store pool token A |
b_vault | The vault to store pool token B |
a_vault_lp | The LP of the vault to store pool token A |
b_vault_lp | The LP of the vault to store pool token B |
a_vault_lp_bump | The nonce used to create signer seed |
enabled | Flag to determine the pool is enabled or disabled. If disabled, user couldn’t add liquidity, remove liquidity in imbalance ratio or swap at the given pool |
admin_token_a_fee | Used to collect swap fee |
admin_token_b_fee | Used to collect swap fee |
admin | The admin of the pool |
fees | The fee parameter of the pool. It will affect the fee charged during the swap process |
padding | Reserved space for future use |
curve_type | The curve of the pool. Example: Constant product, stable. |
Pool Fees
Data | Description |
---|---|
trade_fee_numerator | Numerator for trading fee |
trade_fee_denominator | Denominator for trading fee |
owner_trade_fee_numerator | Numerator for owner trading fee |
owner_trade_fee_denominator | Denominator for owner trading fee |
Padding
Data | Description |
---|---|
padding | 512 bytes reserved for future use |
Curve Type
Data | Description |
---|---|
ConstantProduct | Indicate the pool is constant product pool |
Stable | Indicate the pool is stable swap pool |
Token Multiplier
Because there are tokens with different decimals, the precision factor has been added to normalize the value to support tokens with different decimals in stable swap calculation.
Data | Description |
---|---|
token_a_multiplier | Multiplier for token A. Used to make sure that token A will have the same precision as token B. |
token_b_multiplier | Multiplier for token B. Used to make sure that token A will have the same precision as token A. |
precision_factor | The precision of token A and B of the pool. |
Depeg
Store the information about the depeg stable swap pool.
Data | Description |
---|---|
base_virtual_price | Store the virtual price of the staking/interest-bearing token. Used to calculate the native token amount. |
base_cache_updated | Store the last timestamp the base_virtual_price was updated. |
depeg_type | Indicate the type of the depeg pool supported. If the pool is a depeg pool, token_b of the pool will always be to depeg token. |
Depeg Type
Data | Description |
---|---|
None | Indicate that the pool does not support staking / interest bearing token |
Marinade | The pool supports marinade token (mSOL) |
Lido | The pool supports solido token (stSOL) |
spl-stake | The pool supports more LSTs like jitoSOL, bSOL, and more. |
User Functions
Data | Description |
---|---|
add_balance_liquidity |
|
add_imbalance_liquidity |
|
remove_balance_liquidity |
|
remove_liquidity_single_side |
|
swap |
|
get_pool_info |
|
initialize_permissionless_pool | Creates a new permissionless pool by depositing tokens A and B as bootstrap liquidity. |
Admin Functions
Data | Description |
---|---|
initialize_permissioned_pool | Admin creates a new permissioned pool by depositing tokens A and B as bootstrap liquidity. |
transfer_admin | Transfer the admin of the pool to the new admin for permissioned pools. |
set_pool_fees | Set a new fee parameter for permissioned pools. |
set_admin_fee_account | Set a new admin token fee account to receive the swap fee for permissioned pools. |
override_curve_param | Update curve parameters. For example, amplification coefficient of stable swap for permissioned pools. |
enable_or_disable_pool | Enable or disable permissioned pools. A disabled pool will allow only remove balanced liquidity. |
Last updated