Spaces:
Runtime error
Runtime error
gauravlochab
commited on
Commit
·
5e378b4
1
Parent(s):
a691cb9
feat: Update title of total value locked visualization
Browse files- app.py +5 -4
- app_value_locked.py +0 -1
app.py
CHANGED
@@ -192,13 +192,13 @@ def create_visualizations():
|
|
192 |
x="date",
|
193 |
y="total_value_locked_usd",
|
194 |
color="chain_name",
|
195 |
-
title="Total
|
196 |
labels={"date": "Date", "total_value_locked_usd": "Total Value Locked (USD)"},
|
197 |
barmode='stack',
|
198 |
color_discrete_map={
|
199 |
-
"
|
200 |
-
"
|
201 |
-
"
|
202 |
}
|
203 |
)
|
204 |
fig_tvl.update_layout(
|
@@ -214,6 +214,7 @@ def create_visualizations():
|
|
214 |
height=700,
|
215 |
)
|
216 |
fig_tvl.update_xaxes(tickformat="%Y-%m-%d")
|
|
|
217 |
|
218 |
chain_name_map = {
|
219 |
10: "Optimism",
|
|
|
192 |
x="date",
|
193 |
y="total_value_locked_usd",
|
194 |
color="chain_name",
|
195 |
+
title="Total Volume Invested in Pools in Different Chains Daily",
|
196 |
labels={"date": "Date", "total_value_locked_usd": "Total Value Locked (USD)"},
|
197 |
barmode='stack',
|
198 |
color_discrete_map={
|
199 |
+
"optimism": "blue",
|
200 |
+
"base": "purple",
|
201 |
+
"ethereum": "darkgreen"
|
202 |
}
|
203 |
)
|
204 |
fig_tvl.update_layout(
|
|
|
214 |
height=700,
|
215 |
)
|
216 |
fig_tvl.update_xaxes(tickformat="%Y-%m-%d")
|
217 |
+
|
218 |
|
219 |
chain_name_map = {
|
220 |
10: "Optimism",
|
app_value_locked.py
CHANGED
@@ -266,7 +266,6 @@ def requests_retry_session(
|
|
266 |
def get_token_price_usd(chain, token_address):
|
267 |
chain_dict = {"optimism": "optimistic-ethereum", "base": "base", "ethereum": "ethereum"}
|
268 |
chain_name = chain_dict.get(chain, chain)
|
269 |
-
time.sleep(4)
|
270 |
url = f"https://api.coingecko.com/api/v3/simple/token_price/{chain_name}?contract_addresses={token_address}&vs_currencies=usd"
|
271 |
|
272 |
headers = {
|
|
|
266 |
def get_token_price_usd(chain, token_address):
|
267 |
chain_dict = {"optimism": "optimistic-ethereum", "base": "base", "ethereum": "ethereum"}
|
268 |
chain_name = chain_dict.get(chain, chain)
|
|
|
269 |
url = f"https://api.coingecko.com/api/v3/simple/token_price/{chain_name}?contract_addresses={token_address}&vs_currencies=usd"
|
270 |
|
271 |
headers = {
|