jiarongqiu commited on
Commit
2e7cd56
·
1 Parent(s): ab148d9
Files changed (1) hide show
  1. service/api.py +6 -5
service/api.py CHANGED
@@ -81,14 +81,15 @@ class API():
81
  return data
82
 
83
  def get_filecoin_deposit(self):
84
- url="https://api.spacescope.io/v2/fvm/defi/all_protocol_flow?start_date={}&end_date={}".format(TimeUtil.get_date(offset=-2,format='%Y-%m-%d'),TimeUtil.get_date(offset=-1,format='%Y-%m-%d'))
85
- headers = {
86
- 'authorization': f'Bearer {os.environ["SPACESCOPE_API_KEY"]}'
87
- }
88
  data = None
89
  try:
90
  response = requests.get(url, headers=headers)
91
- data = round(json.loads(response.text)['data'][-1]['total_inflow_fil'],1)
 
 
92
  except Exception as e:
93
  print(e)
94
  return data
 
81
  return data
82
 
83
  def get_filecoin_deposit(self):
84
+ url = "https://api.spacescope.io/v2/fvm/defi/leaderboard_summary_combined"
85
+ # url="https://api.spacescope.io/v2/fvm/defi/all_protocol_flow?start_date={}&end_date={}".format(TimeUtil.get_date(offset=-2,format='%Y-%m-%d'),TimeUtil.get_date(offset=-1,format='%Y-%m-%d'))
86
+ headers = {'authorization': f'Bearer {os.environ["SPACESCOPE_API_KEY"]}'}
 
87
  data = None
88
  try:
89
  response = requests.get(url, headers=headers)
90
+ data = json.loads(response.text)
91
+ data = data['data'][-1]['inflow_fil']
92
+ data = f"{data:,.0f}"
93
  except Exception as e:
94
  print(e)
95
  return data