jiarongqiu commited on
Commit
a711f0f
·
1 Parent(s): cab991e

add more;

Browse files
Files changed (2) hide show
  1. service/api.py +8 -0
  2. service/scheduler.py +4 -2
service/api.py CHANGED
@@ -138,5 +138,13 @@ class API():
138
  total_raw_bytes_power = int(data['total_raw_bytes_power'])/1024**6
139
  total_raw_bytes_power = f"{total_raw_bytes_power:,.1f}"
140
  return total_raw_bytes_power
 
 
 
 
 
 
 
 
141
 
142
  api = API()
 
138
  total_raw_bytes_power = int(data['total_raw_bytes_power'])/1024**6
139
  total_raw_bytes_power = f"{total_raw_bytes_power:,.1f}"
140
  return total_raw_bytes_power
141
+
142
+ def get_fvm_active_deal():
143
+ url="https://dashboard.starboard.ventures/v2/v1/network_core/market-deals/deal_states_aggregate_daily"
144
+ response = requests.get(url)
145
+ data = response.json()['data'][0]
146
+ active_deals_verified_bytes = int(data['active_deals_verified_bytes'])/1024**6
147
+ active_deals_verified_bytes = f"{active_deals_verified_bytes:,.1f}"
148
+ return active_deals_verified_bytes
149
 
150
  api = API()
service/scheduler.py CHANGED
@@ -22,12 +22,14 @@ class Scheduler:
22
  deposit = api.get_filecoin_deposit()
23
  tvl = api.get_filecoin_tvl()
24
  total_raw_bytes_power = api.get_fvm_storage()
 
25
  text = """
26
  The price of filecoin(FIL) is currently ${} USD.
27
  The Total DeFi Net Deposits of filecoin(FIL) is {} FIL.
28
  The Total Value Locked(TVL) of filecoin(FIL) is ${} USD.
29
- The Network Raw Byte Power of the Filecoin Network is {} EiB
30
- """.format(price,deposit,tvl)
 
31
  vector_store.upsert(text,"dataset_1")
32
 
33
 
 
22
  deposit = api.get_filecoin_deposit()
23
  tvl = api.get_filecoin_tvl()
24
  total_raw_bytes_power = api.get_fvm_storage()
25
+ active_deals_verified_bytes = api.get_fvm_active_deal()
26
  text = """
27
  The price of filecoin(FIL) is currently ${} USD.
28
  The Total DeFi Net Deposits of filecoin(FIL) is {} FIL.
29
  The Total Value Locked(TVL) of filecoin(FIL) is ${} USD.
30
+ The Network Raw Byte Power of the Filecoin Network is {} EiB.
31
+ The Total Active Filecoin Deals of the Filecoin Network is {} EiB.
32
+ """.format(price,deposit,tvl,total_raw_bytes_power,active_deals_verified_bytes)
33
  vector_store.upsert(text,"dataset_1")
34
 
35