Appearance
pool
The subnet's AMM pool at the current block: price, reserves and what a trade of a given size would do.
| Name | Description |
|---|---|
pool.price() | Pool price, TAO per alpha: the current block's in precise and live runs; the bar's close inside event.onCandle in quick backtests. |
pool.movingPrice() | The protocol's moving (smoothed) price at the current block or bar. |
pool.reserves() | Pool reserves at the current block or bar. |
pool.impact() | fraction of price impact for buying tao TAO at current reserves |
pool.quoteBuy() | What buying with tao TAO (fee included) would return at the current reserves. |
pool.quoteSell() | What selling alpha would return at the current reserves, after the fee. |
pool.capacity() | largest TAO size whose impact stays within maxImpact (fraction) |
pool.price()
ts
pool.price(): PricePool price, TAO per alpha: the current block's in precise and live runs; the bar's close inside event.onCandle in quick backtests.
Types: Price
pool.movingPrice()
ts
pool.movingPrice(): PriceThe protocol's moving (smoothed) price at the current block or bar.
Types: Price
pool.reserves()
ts
pool.reserves(): ReservesPool reserves at the current block or bar.
Types: Reserves
pool.impact()
ts
pool.impact(tao: number): numberfraction of price impact for buying tao TAO at current reserves
pool.quoteBuy()
ts
pool.quoteBuy(tao: number): QuoteWhat buying with tao TAO (fee included) would return at the current reserves.
Types: Quote
pool.quoteSell()
ts
pool.quoteSell(alpha: number): QuoteWhat selling alpha would return at the current reserves, after the fee.
Types: Quote
pool.capacity()
ts
pool.capacity(maxImpact: number): numberlargest TAO size whose impact stays within maxImpact (fraction)
Types
Reserves
Pool reserves.
| Field | Type | Description |
|---|---|---|
taoIn | number | TAO in the pool |
alphaIn | number | alpha in the pool |
alphaOut | number | alpha outstanding (staked outside the pool) |
Quote
What a trade would do at the current reserves (pool.quoteBuy() / pool.quoteSell()).
| Field | Type | Description |
|---|---|---|
alpha? | number | amount received: alpha for a buy, tao (after the fee) for a sell |
tao? | number | |
price | Price | average price of the trade, fee excluded |
impact | number | fraction, e.g. 0.005 = 0.5 % |
fee | number | fee in TAO |
