Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuously display the interest to Claim without depending on Savings Contract update. #3

Open
kento-sadim opened this issue Sep 28, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@kento-sadim
Copy link

Right now the interest is being pulled from our smart contract which only gets updated when someone actually interacts with the savings contract from mStable. We should be able to do better and actually show the interest value increasing by the second.

This is the savings contract for mStable https://etherscan.io/address/0xcf3f73290803fc04425bee135a4caeb2bab2c2a1#readContract

Here you can find the current exchange rate. The way mStable works is that it actually saves a credit balance and then it multiplies that to the exchange rate to come up with the actual mUSD value one should receive.

This is Contribute's Vault https://etherscan.io/address/0xda1fd36cfc50ed03ca4dd388858a78c904379fb3#readContract

Every mUSD that gets sent to the savings account actually gets sent by the vault. The vault is the proxy contract that deposits and withdraws to the savings account, so all Contribute's balance is actually saved under the vault address in the saving's contract.

So this is our current credit balance 2,716,367
If you multiply that by the exchange rate you get ~3,016,000

This is how you know how much Contribute actually has in the vault. But we can only find out how much is actually there once the exchange rate has been updated.

One way to find out how we can display this in real time is to see how mStable shows their interest accumulating in real time. https://app.mstable.org/save

When you put mUSD in their savings account this number keeps increasing.
You can find out how they do it here:
https://github.com/mstable/mStable-app/blob/master/src/components/pages/Save/SaveInfo.tsx

@kento-sadim kento-sadim added the enhancement New feature or request label Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant