Skip to content

Transformers - Add Underlying Yields per Account models#206

Merged
marcus-snx merged 5 commits intomainfrom
feat/transformer-add-yields-per-account
Mar 18, 2025
Merged

Transformers - Add Underlying Yields per Account models#206
marcus-snx merged 5 commits intomainfrom
feat/transformer-add-yields-per-account

Conversation

@marcus-snx
Copy link
Contributor

  • Get account balances from DelegationUpdate events in core_delegation_updated models
  • Get yield token exchange rate PnL from fct_token_yields models (calculated as current_exchange_rate - previous_exchange_rate where exchange_rate = token_price / yield_token_price (where e.g. token = stataUSDC and yield_token = USDC)
  • Forward fill balances to get hourly balances
  • Calculate hourly yield using hourly_yield = hourly_collateral_balance * yield_token_exchange_rate_pnl
  • Sum hourly yields to get total yields per collateral per account (per pool)

@marcus-snx marcus-snx requested a review from noisekit March 7, 2025 20:38

with recursive yield_tokens as (
select distinct collateral_type
from {{ ref('fct_token_yields_arbitrum_mainnet') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this necessary, given the unwind of arbitrum?

synthetix:
+schema: seeds
tokens:
arbitrum_mainnet_tokens:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we drop arbitrum? or do we keep it for the vibes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely, I will remove it, we will soon be deprecating arbitrum from remaining dashboards too.

@marcus-snx marcus-snx merged commit bc7613e into main Mar 18, 2025
1 of 3 checks passed
@marcus-snx marcus-snx deleted the feat/transformer-add-yields-per-account branch March 20, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments