Skip to content

Commit

Permalink
feat: added ftm registry block
Browse files Browse the repository at this point in the history
  • Loading branch information
wavey0x committed Feb 16, 2022
1 parent 3416c0d commit a7e602b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/collect_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"START_DATE": datetime(2021, 4, 30, tzinfo=timezone.utc),
"START_BLOCK": 16241109,
"REGISTRY_ADDRESS": "0x727fe1759430df13655ddb0731dE0D0FDE929b04",
"REGISTRY_DEPLOY_BLOCK": 18455565,
"REGISTRY_HELPER_ADDRESS": "0x8CC45f739104b3Bdb98BFfFaF2423cC0f817ccc1",
"REGISTRY_HELPER_DEPLOY_BLOCK": 18456459,
"LENS_ADDRESS": "0x97D0bE2a72fc4Db90eD9Dbc2Ea7F03B4968f6938",
Expand All @@ -49,6 +50,7 @@
"START_DATE": datetime(2021, 9, 14, tzinfo=timezone.utc),
"START_BLOCK": 4841854,
"REGISTRY_ADDRESS": "",
"REGISTRY_DEPLOY_BLOCK": 12045555,
"REGISTRY_HELPER_ADDRESS": "",
"LENS_ADDRESS": "",
"VAULT_ADDRESS030": "",
Expand Down Expand Up @@ -142,7 +144,10 @@ def handle_event(event, multi_harvest, isOldApi):
r.multi_harvest = multi_harvest
r.chain_id = chain.id
r.vault_address = event.address
vault = contract(r.vault_address)
try:
vault = contract(r.vault_address)
except ValueError:
return
r.vault_decimals = vault.decimals()
r.strategy_address, r.gain, r.loss, r.debt_paid, r.total_gain, r.total_loss, r.total_debt, r.debt_added, r.debt_ratio = normalize_event_values(event.values(), r.vault_decimals)
if check_endorsed(r.vault_address, event.block_number) == False:
Expand Down Expand Up @@ -185,6 +190,7 @@ def handle_event(event, multi_harvest, isOldApi):
r.gov_fee_in_want, r.strategist_fee_in_want = parse_fees(tx, r.vault_address, r.strategy_address, r.vault_decimals)
r.gain_post_fees = r.gain - r.loss - r.strategist_fee_in_want - r.gov_fee_in_want
r.want_token = strategy.want()
print(r.want_token)
r.want_price_at_block = magic.get_price(r.want_token, r.block)
r.vault_api = vault.apiVersion()
r.want_gain_usd = r.gain * r.want_price_at_block
Expand Down

0 comments on commit a7e602b

Please sign in to comment.