Skip to content

Commit

Permalink
Update script to include OUSD as well
Browse files Browse the repository at this point in the history
  • Loading branch information
shahthepro committed Aug 24, 2023
1 parent d1f9e42 commit dd1e529
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 27 deletions.
21 changes: 21 additions & 0 deletions eagleproject/scripts/compute_boost_multiplier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import datetime

from decimal import Decimal
from core.models import OriginTokens, SupplySnapshot
from core.blockchain.rpc import OETHCurveAMOStrategy, OUSDMetaStrategy

def run(*script_args):
snapshots = SupplySnapshot.objects.filter(non_rebasing_boost_multiplier=0).order_by('-block_number').all()

print("Found {} Supply snapshots".format(len(snapshots)))
for s in snapshots:
if s.project == OriginTokens.OETH:
print("Computing OETH Boost multiplier at block {}".format(s.block_number))
amo_supply = OETHCurveAMOStrategy.get_underlying_balance(s.block_number).get("OETH", Decimal(0))
elif s.project == OriginTokens.OUSD:
print("Computing OUSD Boost multiplier at block {}".format(s.block_number))
amo_supply = OUSDMetaStrategy.get_underlying_balance(s.block_number).get("OUSD", Decimal(0))
s.non_rebasing_boost_multiplier = (s.computed_supply - amo_supply) / (s.computed_supply - s.non_rebasing_supply)
s.save()

print("Done.")
27 changes: 0 additions & 27 deletions eagleproject/scripts/recompute_oeth_supplysnapshot.py

This file was deleted.

0 comments on commit dd1e529

Please sign in to comment.