mento-protocol / reserve-site

Mento Reserve Website
https://reserve.mento.org
1 stars 4 forks source link

Implement logic to update target allocation dynamically #4

Closed ole-nov closed 2 years ago

ole-nov commented 2 years ago

Now when proposal 62 has passed, new logic should be implemented to determine target allocation % for each asset in the reserve. This issue aims only to update the target allocation displayed at reserve.mento.org based on the logic proposed in CGP-62

Step 1: Calculate Total Stables Value (sum of all outstanding stable tokens supply denominated in USD) Get current Total Reserve Value (sum of all assets held in the reserve, denominated in USD)

Step2: If Total Reserve Value / Total Stables Value >= 2

Stables Fraction = Total Stables Value / Total Reserve USDC/DAI Fraction = Stables Fraction / 2 CELO Fraction = 0.5 BTC/ETH Fraction = (1 - Stables fraction - CELO fraction) 0.49 cMCO2 Fraction = (1 - Stables fraction - CELO fraction) 0.02

If Total Reserve Value / Total Stables Value < 2

Stables Fraction = Total Stables Value / Total Reserve USDC/DAI Fraction = Stables Fraction / 2 CELO Fraction = 1 - Stables Fraction

If Total Reserve Value / Total Stables Value < 1

Stables Fraction = 1 USDC/DAI Fraction = Stables Fraction / 2