feat/savax-pricer Adding sAVAX pricer #454
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature Name: sAvax Pricer
High Level Description
Opyn pricer to support sAVAX token on Avalanche.
sAvax is a token from the Benqi Finance team.
sAVAX uses a pool share system where the user's balance of sAVAX tokens is representative of the user's portion of the total AVAX in the whole system. The token contract keeps track of the sum of all staked AVAX and the amount of paid staking rewards, as well as the total number of minted sAVAX tokens. The ratio of these two (the exchange rate) determines the sAVAX valuation in terms of the underlying AVAX; the sAVAX tokens can always be redeemed for at least as many AVAX tokens as determined by the current exchange rate. This exchange rate changes over time, making 1 sAVAX more and more valuable as time goes on.
Contract: 0x2b2C81e08f1Af8835a78Bb2A90AE924ACE0eA4bE
Specific Changes:
Code
The contract has a helper function (getPooledAvaxByShares(1e18), returns how much the amount of sAVAX tokens given as the argument is worth in AVAX) that returns the exchange rate.
Documentation