@interlay/interbtc-api / Exports / StableLiquidityMetaPool
↳ StableLiquidityMetaPool
• new StableLiquidityMetaPool(lpToken
, metaPooledCurrencies
, pooledCurrencies
, rewardAmountsYearly
, tradingFee
, poolId
, amplificationCoefficient
, totalSupply
, isEmpty
, basePool
): StableLiquidityMetaPool
Name | Type |
---|---|
lpToken |
StableLpToken |
metaPooledCurrencies |
PooledCurrencies |
pooledCurrencies |
PooledCurrencies |
rewardAmountsYearly |
MonetaryAmount <CurrencyExt >[] |
tradingFee |
Big |
poolId |
number |
amplificationCoefficient |
Big |
totalSupply |
MonetaryAmount <StableLpToken > |
isEmpty |
boolean |
basePool |
StableLiquidityPool |
StableLiquidityPool.constructor
src/parachain/amm/liquidity-pool/stable-meta.ts:8
• actuallyPooledCurrencies: PooledCurrencies
StableLiquidityPool.actuallyPooledCurrencies
src/parachain/amm/liquidity-pool/stable.ts:14
• amplificationCoefficient: Big
StableLiquidityPool.amplificationCoefficient
src/parachain/amm/liquidity-pool/stable.ts:20
• basePool: StableLiquidityPool
src/parachain/amm/liquidity-pool/stable-meta.ts:18
• isEmpty: boolean
src/parachain/amm/liquidity-pool/stable.ts:22
• lpToken: StableLpToken
src/parachain/amm/liquidity-pool/stable.ts:12
• poolId: number
src/parachain/amm/liquidity-pool/stable.ts:19
• pooledCurrencies: PooledCurrencies
StableLiquidityPool.pooledCurrencies
src/parachain/amm/liquidity-pool/stable.ts:16
• rewardAmountsYearly: MonetaryAmount
<CurrencyExt
>[]
StableLiquidityPool.rewardAmountsYearly
src/parachain/amm/liquidity-pool/stable.ts:17
• totalSupply: MonetaryAmount
<StableLpToken
>
StableLiquidityPool.totalSupply
src/parachain/amm/liquidity-pool/stable.ts:21
• tradingFee: Big
StableLiquidityPool.tradingFee
src/parachain/amm/liquidity-pool/stable.ts:18
• type: STABLE_PLAIN
| STABLE_META
src/parachain/amm/liquidity-pool/stable.ts:11
• get
_feePerToken(): Big
Big
StableLiquidityPool._feePerToken
src/parachain/amm/liquidity-pool/stable.ts:35
• get
xp(): Big
[]
Big
[]
StableLiquidityPool.xp
src/parachain/amm/liquidity-pool/stable.ts:194
▸ calculateRemoveLiquidityOneToken(tokenLPAmount
, outputCurrencyIndex
): [MonetaryAmount
<CurrencyExt
>, MonetaryAmount
<CurrencyExt
>]
Name | Type |
---|---|
tokenLPAmount |
MonetaryAmount <StableLpToken > |
outputCurrencyIndex |
number |
[MonetaryAmount
<CurrencyExt
>, MonetaryAmount
<CurrencyExt
>]
StableLiquidityPool.calculateRemoveLiquidityOneToken
src/parachain/amm/liquidity-pool/stable.ts:223
▸ calculateSwap(inputIndex
, outputIndex
, inputAmount
): MonetaryAmount
<CurrencyExt
>
Name | Type |
---|---|
inputIndex |
number |
outputIndex |
number |
inputAmount |
MonetaryAmount <CurrencyExt > |
MonetaryAmount
<CurrencyExt
>
StableLiquidityPool.calculateSwap
src/parachain/amm/liquidity-pool/stable.ts:263
▸ calculateTokenAmount(amounts
, deposit
): MonetaryAmount
<StableLpToken
>
Name | Type | Description |
---|---|---|
amounts |
PooledCurrencies |
Array of monetary amount for each pooled currency of this pool. |
deposit |
boolean |
True for deposit, false for withdrawal |
MonetaryAmount
<StableLpToken
>
LP token amount that will be minted/burned after operation.
StableLiquidityPool.calculateTokenAmount
src/parachain/amm/liquidity-pool/stable.ts:204
▸ getLiquidityDepositInputAmounts(amount
): MonetaryAmount
<CurrencyExt
>[]
Calculates how much of pooled currencies needs to be deposited into pool with current ratio of currencies.
Name | Type | Description |
---|---|---|
amount |
MonetaryAmount <CurrencyExt > |
Amount of one of the pooled currencies. |
MonetaryAmount
<CurrencyExt
>[]
Monetary amounts of all pooled currencies in balanced proportion.
Throws
If pool is empty. Note: handle by checking isEmpty
property of pool.
StableLiquidityPool.getLiquidityDepositInputAmounts
src/parachain/amm/liquidity-pool/calculator.ts:29
▸ getLiquidityDepositLpTokenAmount(amount
): MonetaryAmount
<StableLpToken
>
Calculates expected amount of LP token account will get after depositing
amount
of pooled currency into pool.
Name | Type | Description |
---|---|---|
amount |
MonetaryAmount <CurrencyExt > |
Amount of one of the pooled currencies. |
MonetaryAmount
<StableLpToken
>
Expected amount of lp token that will be received after amount
is added to pool.
Note
This method assumes all pooled currencies will be added in balance.
Throws
If pool is empty. Note: handle by checking isEmpty
property of pool.
StableLiquidityPool.getLiquidityDepositLpTokenAmount
src/parachain/amm/liquidity-pool/calculator.ts:47
▸ getLiquidityWithdrawalPooledCurrencyAmounts(amount
): MonetaryAmount
<CurrencyExt
>[]
Calculates expected amount of pooled currencies account will get
after withdrawing amount
of LP token.
Name | Type | Description |
---|---|---|
amount |
MonetaryAmount <StableLpToken > |
Amount of liquidity in LP token to be withdrawn. |
MonetaryAmount
<CurrencyExt
>[]
Amounts of pooled currencies to be returned to account.
Note
This method assumes all pooled currencies will be withdrawn in balance.
Throws
If pool is empty. Note: handle by checking isEmpty
property of pool.
StableLiquidityPool.getLiquidityWithdrawalPooledCurrencyAmounts
src/parachain/amm/liquidity-pool/calculator.ts:64
▸ getTokenIndex(currency
): number
Name | Type |
---|---|
currency |
CurrencyExt |
number
StableLiquidityPool.getTokenIndex
src/parachain/amm/liquidity-pool/stable.ts:188
▸ involvesToken(currency
): boolean
Name | Type |
---|---|
currency |
CurrencyExt |
boolean
StableLiquidityPool.involvesToken