-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update script to include OUSD as well
- Loading branch information
1 parent
d1f9e42
commit dd1e529
Showing
2 changed files
with
21 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.") |
This file was deleted.
Oops, something went wrong.