Advertisement
999ms

Untitled

Jul 4th, 2024 (edited)
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.12 KB | None | 0 0
  1. with open('./collector_db_pusher/data.csv', 'r') as f:
  2.     csv_reader = csv.reader(f)
  3.     data = list(csv_reader)[1:]
  4.     transfers = []
  5.     for row in data:
  6.         timestamp = int(row[2])
  7.         f = row[4]
  8.         t = row[5]
  9.         amount = float(row[6].replace(',', ''))
  10.         transfers.append({
  11.             'timestamp': timestamp,
  12.             'from': f,
  13.             'to': t,
  14.             'amount': amount
  15.         })
  16.  
  17.     current_timestamp = 1720136819
  18.     cumulative_wsteth_balance = 0
  19.     for transfer in transfers:
  20.         coeff = (current_timestamp -
  21.                  transfer['timestamp']) / 3600
  22.         if transfer['from'] == '0x0000000000000000000000000000000000000000':
  23.             cumulative_wsteth_balance += transfer['amount'] * coeff
  24.         else:
  25.             cumulative_wsteth_balance -= transfer['amount'] * coeff
  26.  
  27.     # 3600 constant price for wsteth for all time. At the same time, the rate of symbiotic points is: 1 point for $4000 per hour.
  28.     price_coefficient = 3600 / 4000
  29.     # 3.7M points
  30.     print(cumulative_wsteth_balance * price_coefficient)
  31.     # symbiotic API returns 2.99M points
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement