Overview
Allium is replacing the legacysolana.defi.lending* tables with a new solana.lending.* schema. The new schema splits the monolithic lending_tvl event table (which used an ACTION column to distinguish event types) into dedicated per-action tables — deposits, withdrawals, loans, repayments, liquidations — for simpler querying and better performance. It also adds richer per-event fields and replaces the single daily TVL rollup with multiple purpose-specific aggregates.
Table mapping
Additional new tables with no legacy equivalent:
Schema changes
solana.defi.lending_tvl → per-action tables
solana.defi.lending_tvl → per-action tables
The legacy
lending_tvl table used a single ACTION column (deposit / withdraw / borrow / repay / liquidate) to distinguish event types. The new tables split this into dedicated tables.Common columns across all new action tables (deposits, withdrawals, loans, repayments, liquidations):Party address columns differ by action type:
Columns removed from legacy
lending_tvl (no equivalent in new tables):ACTION— replaced by the table nameFROM_ADDRESS,TOKEN_ACC_FROM,TO_ADDRESS,TOKEN_ACC_TO— replaced by role-specific address columnsRAW_AMOUNT— replaced byRAW_AMOUNT_STRLENDING_ID,LENDING_RESERVE_ID— usePROGRAM_ID+EXTRA_FIELDSinsteadLIQUIDITY_VAULT— usePROGRAM_IDfrom themarkets_dailytablePSEUDO_GLOBAL_ORDER— removed
solana.defi.lending_tvl_daily → solana.lending.tvl_daily
solana.defi.lending_tvl_daily → solana.lending.tvl_daily
The new
tvl_daily table covers per-market, per-token daily TVL. Key column changes:For daily flow aggregates (net deposit/borrow volume, USD TVL by action), use
solana.lending.metrics_daily instead.solana.defi.lending → solana.lending.markets_daily
solana.defi.lending → solana.lending.markets_daily
The old
lending table was a static reserve/pool metadata list. The new markets_daily table is a daily snapshot of market state with richer fields.What to do
- Replace
solana.defi.lending_tvlqueries: filter by action type and switch to the corresponding table (deposits,withdrawals,loans,repayments,liquidations). Remove theACTIONfilter — it is now implicit in the table name. - Replace
solana.defi.lending_tvl_dailyqueries: usesolana.lending.tvl_dailyfor per-market token balances. For flow aggregates (deposit volume, borrow volume, net TVL), usesolana.lending.metrics_daily. - Replace
solana.defi.lendingqueries: usesolana.lending.markets_dailyfor market/reserve state, scoped to a date. - Update column references: see schema changes above for renamed and removed columns.
- Complete migration by November 30, 2026 — the
solana.defi.lending*tables will be removed after this date.