Skip to content

Commit

Permalink
Merge pull request #40 from Synthetixio/dashboard-updates
Browse files Browse the repository at this point in the history
Dashboard Updates
  • Loading branch information
Tburm authored Jan 23, 2025
2 parents c409245 + 154b214 commit 2a62de9
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
4 changes: 4 additions & 0 deletions dashboards/all_metrics/modules/v2/perp_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ def fetch_data(chain, start_date, end_date, resolution):
ts,
exchange_fees,
liquidation_fees,
exchange_fees + liquidation_fees as total_fees,
volume,
amount_liquidated,
cumulative_volume,
cumulative_exchange_fees,
cumulative_liquidation_fees,
cumulative_exchange_fees + cumulative_liquidation_fees as cumulative_total_fees,
cumulative_amount_liquidated,
long_oi_usd,
short_oi_usd,
Expand Down Expand Up @@ -82,12 +84,14 @@ def make_charts(data, resolution):
["cumulative_exchange_fees", "cumulative_liquidation_fees"],
"Cumulative Fees",
smooth=True,
custom_agg=dict(field="cumulative_total_fees", name="Total", agg="sum"),
),
"daily_fees": chart_bars(
data["market_stats_agg"],
"ts",
["exchange_fees", "liquidation_fees"],
f"{resolution.capitalize()} Fees",
custom_agg=dict(field="total_fees", name="Total", agg="sum"),
),
"cumulative_liquidation": chart_lines(
data["market_stats_agg"],
Expand Down
7 changes: 7 additions & 0 deletions dashboards/all_metrics/modules/v3/chain_core_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,48 +115,55 @@ def make_charts(data, resolution):
y_cols="debt",
title="Debt",
color_by="collateral_type",
custom_agg=dict(field="debt", name="Total", agg="sum"),
),
"hourly_issuance": chart_bars(
df=data["apr"],
x_col="ts",
y_cols="hourly_issuance",
title="Hourly Issuance",
color_by="collateral_type",
custom_agg=dict(field="hourly_issuance", name="Total", agg="sum"),
),
"issuance": chart_lines(
df=data["apr"],
x_col="ts",
y_cols="cumulative_issuance",
title="Issuance",
color_by="collateral_type",
custom_agg=dict(field="cumulative_issuance", name="Total", agg="sum"),
),
"pnl": chart_lines(
df=data["apr"],
x_col="ts",
y_cols="cumulative_pnl",
title="Pnl",
color_by="collateral_type",
custom_agg=dict(field="cumulative_pnl", name="Total", agg="sum"),
),
"hourly_pnl": chart_bars(
df=data["apr"],
x_col="ts",
y_cols="hourly_pnl",
title="Hourly Pnl",
color_by="collateral_type",
custom_agg=dict(field="hourly_pnl", name="Total", agg="sum"),
),
"hourly_rewards": chart_bars(
df=data["apr"],
x_col="ts",
y_cols="rewards_usd",
title="Hourly Rewards",
color_by="collateral_type",
custom_agg=dict(field="rewards_usd", name="Total", agg="sum"),
),
"hourly_rewards_token": chart_bars(
df=data["apr_token"],
x_col="ts",
y_cols="rewards_usd",
title="Hourly Rewards (Collateral : Reward)",
color_by="token_pair",
custom_agg=dict(field="rewards_usd", name="Total", agg="sum"),
),
"apr": chart_lines(
df=data["apr"],
Expand Down
5 changes: 5 additions & 0 deletions dashboards/all_metrics/modules/v3/chain_perp_integrators.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ def make_charts(data):
color_by="tracking_code",
y_format="#",
no_decimals=True,
custom_agg=dict(field="accounts", name="Total", agg="sum"),
),
"volume": chart_bars(
df=data["stats"],
x_col="ts",
y_cols="volume",
title="Volume",
color_by="tracking_code",
custom_agg=dict(field="volume", name="Total", agg="sum"),
),
"volume_pct": chart_bars(
df=data["stats"],
Expand All @@ -94,6 +96,7 @@ def make_charts(data):
color_by="tracking_code",
y_format="#",
no_decimals=True,
custom_agg=dict(field="trades", name="Total", agg="sum"),
),
"trades_pct": chart_bars(
df=data["stats"],
Expand All @@ -109,6 +112,7 @@ def make_charts(data):
y_cols="exchange_fees",
title="Exchange Fees",
color_by="tracking_code",
custom_agg=dict(field="exchange_fees", name="Total", agg="sum"),
),
"exchange_fees_pct": chart_bars(
df=data["stats"],
Expand All @@ -124,6 +128,7 @@ def make_charts(data):
y_cols="referral_fees",
title="Referral Fees",
color_by="tracking_code",
custom_agg=dict(field="referral_fees", name="Total", agg="sum"),
),
"referral_fees_pct": chart_bars(
df=data["stats"],
Expand Down
3 changes: 3 additions & 0 deletions dashboards/all_metrics/modules/v3/chain_perp_keepers.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def make_charts(data):
y_format="#",
unified_hover=False,
no_decimals=True,
custom_agg=dict(field="trades", name="Total", agg="sum"),
),
"trades_pct": chart_bars(
df,
Expand All @@ -85,6 +86,7 @@ def make_charts(data):
title="Notional Size Settled",
color_by="keeper",
unified_hover=False,
custom_agg=dict(field="amount_settled", name="Total", agg="sum"),
),
"amount_settled_pct": chart_bars(
df,
Expand All @@ -102,6 +104,7 @@ def make_charts(data):
title="Settlement Rewards",
color_by="keeper",
unified_hover=False,
custom_agg=dict(field="settlement_rewards", name="Total", agg="sum"),
),
"settlement_rewards_pct": chart_bars(
df,
Expand Down
4 changes: 2 additions & 2 deletions dashboards/key_metrics/views/cross_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

st.markdown("# Synthetix Overview")

APR_RESOLUTION = "7d"
APR_RESOLUTION = "28d"
PERPS_RESOLUTION = "daily"

if "chain" not in st.session_state:
Expand Down Expand Up @@ -150,7 +150,7 @@ def fetch_data(date_range, chain):
data["core_stats_by_collateral"],
x_col="ts",
y_cols=f"apr_{APR_RESOLUTION}",
title="APR by Collateral (7d average)",
title="APR by Collateral (28d average)",
color_by="label",
y_format="%",
help_text="APR includes pool performance and yields from underlying Aave deposits over the specified timeframe.",
Expand Down
2 changes: 1 addition & 1 deletion dashboards/key_metrics/views/lp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

st.markdown("# Liquidity Providers")

APR_RESOLUTION = "7d"
APR_RESOLUTION = "28d"

if "chain" not in st.session_state:
st.session_state.chain = st.query_params.get("chain", "all")
Expand Down

0 comments on commit 2a62de9

Please sign in to comment.