For Developers
Oracles
Redemption Price Oracle

Redemption price oracle

The oracle allows you to get the latest ratio and calculate the Redemption Price by one of the formulas mentioned in the Redemption Price explanation.

Although, technically, it isn't a separate oracle contract but a method from Liquid Staking token contracts, we chose to present it as such, as logically it can be perceived as a service, and also for better discoverability.

What is Redemption Price?

The Redemption Price defines the exact amount of assets that a user will get if they redeem their Liquid Staking tokens, after waiting its respective unbonding period. It also defines the amount of Liquid Staking tokens (LSTs) they receive when staking their assets on the Ankr platform.

The formula is:

  1. original_asset = liquid_staking_token / ratio when the user unstakes their assets. This is why the user gets more assets than the number of the redeemed Liquid Staking tokens.
  2. liquid_staking_token = original_asset * ratio when the user stakes their assets. This is why the user gets less Liquid Staking tokens than the number of the staked assets.

All this is due to Liquid Staking tokens increasing in value overtime to the originally staked assets, which happens because ratio = supply / (TVL + rewards * (1-fee)). For example, ETH ratio = supply / (TVL + rewards * 0.9).

Ankr's Redemption Price should be considered as the primary market, and market prices on Exchanges should be perceived as the second market.

Redemption price

To get the Redemption Price for an LST, use the rateProvider contracts:

Ratio for bridged tokens

You may also want to get ratio for bridged tokens.
To remind you what the ratio is, here's the formula: liquid_staking_token/ratio=original_asset, e.g., ankrETH/ratio=ETH.
You can get it, calling the getRatioFor() function. The function takes a contract address of the original Liquid Staking token, e.g., 0xE95A203B1a91a908F9B9CE46459d101078c2c3cb (ankrETH), and returns the ratio as a uint256 if the token has been bridged to the network you're calling the function on.

The addresses of all contracts on all supported networks are:

Avalanche

Avalanche ratio()

Returns the number of ankrAVAX tokens the user gets when staking their 1 AVAX. Practically, the returned value is also ratio, since 1 * ratio is effectively ratio. ankrAVAX/ratio=AVAX.

Parameters

The function returns:

  • price (uint256) — ankrAVAX ratio.
Smart contracts
Examples

You can query for a ratio on the contract page by the links above, anytime.

Avalanche getRatioFor()

Returns the ratio for any Liquid Staking token if it was bridged to Avalanche. ankrETH/ratio=ETH, etc.

Parameters

The function takes:

  • token (address) — contract address of the original Liquid Staking token. For example, 0xE95A203B1a91a908F9B9CE46459d101078c2c3cb which is the address of ankrETH.

The function returns:

  • ratio (uint256) — ratio for any Liquid Staking token that was bridged to Avalanche.
Smart contracts
Examples

You can query for a ratio on the contract page by the links above, anytime.

Binance

Binance ratio()

Returns the number of ankrBNB tokens the user gets when staking their BNB. Practically, the returned value is also ratio, since 1 * ratio is effectively ratio. ankrBNB/ratio=BNB.

Parameters

The function returns:

  • price (uint256) — ankrBNB ratio.
Smart contracts
Examples

You can query for a ratio on the contract page by the links above, anytime.

Binance getRatioFor()

Returns the ratio for any Liquid Staking token if it was bridged to BNB Smart Chain. ankrETH/ratio=ETH, etc.

Parameters

The function takes:

  • token (address) — contract address of the original Liquid Staking token. For example, 0xE95A203B1a91a908F9B9CE46459d101078c2c3cb which is the address of ankrETH.

The function returns:

  • ratio (uint256) — ratio for any Liquid Staking token that was bridged to BNB Smart Chain.
Smart contracts
Examples

You can query for a ratio on the contract page by the links above, anytime.

Ethereum

Ethereum ratio()

Returns the number of ankrETH tokens the user gets when staking their ETH. Practically, the returned value is also ratio, since 1 * ratio is effectively ratio. ankrETH/ratio=ETH.

Parameters

The function returns:

  • price (uint256) — ankrETH ratio.
Smart contracts
Examples

You can query for a ratio on the contract page by the links above, anytime.

Fantom

Fantom ratio()

Returns the number of ankrFTM tokens the user gets when staking their FTM. Practically, the returned value is also ratio, since 1 * ratio is effectively ratio. ankrFTM/ratio=FTM.

Parameters

The function returns:

  • price (uint256) — ankrFTM ratio.
Smart contracts
Examples

You can query for a ratio on the contract page by the links above, anytime.

Fantom getRatioFor()

Returns the ratio for any Liquid Staking token if it was bridged to Fantom. ankrETH/ratio=ETH, etc.

Parameters

The function takes:

  • token (address) — contract address of the original Liquid Staking token. For example, 0xE95A203B1a91a908F9B9CE46459d101078c2c3cb which is the address of ankrETH.

The function returns:

  • ratio (uint256) — ratio for any Liquid Staking token that was bridged to Fantom.
Smart contracts
Examples

You can query for a ratio on the contract page by the links above, anytime.

Mode

Mode getRatioFor()

Returns the ratio for any Liquid Staking token if it was bridged to Mode. ankrETH/ratio=ETH, etc.

Parameters

The function takes:

  • token (address) — contract address of the original Liquid Staking token. For example, 0x12D8CE035c5DE3Ce39B1fDD4C1d5a745EAbA3b8C which is the address of ankrETH.

The function returns:

  • ratio (uint256) — ratio for any Liquid Staking token that was bridged to Mode.
Smart contracts
Examples

You can query for a ratio on the contract page by the links above, anytime.

Optimism

Optimism getRatioFor()

Returns the ratio for any Liquid Staking token if it was bridged to Optimisms. ankrETH/ratio=ETH, etc.

Parameters

The function takes:

  • token (address) — contract address of the original Liquid Staking token. For example, 0xE95A203B1a91a908F9B9CE46459d101078c2c3cb which is the address of ankrETH.

The function returns:

  • ratio (uint256) — ratio for any Liquid Staking token that was bridged to Optimism.
Smart contracts
Examples

You can query for a ratio on the contract page by the links above, anytime.

Polkadot

Polkadot ratio()

Returns the number of aDOTb tokens the user gets when staking their DOT.

Parameters

The function returns:

  • price (uint256) — aDOTb ratio.
Smart contracts
Examples

You can query for a ratio on the contract page by the links above, anytime.

Polygon

Polygon ratio()

Returns the number of ankrMATIC tokens the user gets when staking their MATIC. Practically, the returned value is also ratio, since 1 * ratio is effectively ratio. ankrMATIC/ratio=MATIC.

Parameters

The function returns:

  • price (uint256) — ankrMATIC ratio.
Smart contracts
Examples

You can query for a ratio on the contract page by the links above, anytime.