Query editor
-- Morpho Blue: borrow rate in the live FXRP-collateral markets, 6-hour buckets, from 2026-11-01.-- Flare USD₮0 / FXRP, LLTV 77% id 0x2f31ab3f…-- Flare WFLR / FXRP, LLTV 62.5% id 0xf87b6fec…-- Ethereum RLUSD / FXRP, LLTV 77% id 0x4fa31e3f… (loan-origination market; FXRP OFT 0xce6170ea…)-- Labels omit LLTV (user request); each pair has only one live market, so the labels stay unique.-- AccrueInterest.prevBorrowRate is the per-second rate (WAD) the IRM applied over the interval since the-- market's previous accrual, so it is the exact rate in effect. Each 6h point = time-weighted average of-- those rates, shown as APY = exp(rate_per_sec * 31,536,000) - 1 (Morpho compounds continuously; the app's-- "Borrow Rate (6h)" is the same quantity). Interval assigned to the bucket of its closing event.-- avg_7d_pct = trailing 7-day time-weighted average (uses late-October data for the first week);-- period_avg_pct = time-weighted average since 2026-11-01.with mk(id, market) as (values(0x2f31ab3fc12d6d10d1de9e5c74053126f03ac1f80a2e6d69d36a411fef7d942f, 'Flare USD₮0 / FXRP'),(0xf87b6fecf09dc0b726d16ac28dfcbe6a9fe9605d352cade79ca4e81fd5b19c90, 'Flare WFLR / FXRP'),(0x4fa31e3f8ba345227d44e1cf48559eea53a90dd5311dc006984c060f2f311d96, 'Ethereum RLUSD / FXRP')),ev as (select id, evt_block_time, evt_index, prevBorrowRatefrom morpho_blue_flare.morphoblue_evt_accrueinterestwhere evt_block_date >= date '2026-10-20'union allselect id, evt_block_time, evt_index, prevBorrowRatefrom morpho_blue_ethereum.morphoblue_evt_accrueinterestwhere evt_block_date >= date '2026-10-20'and id = 0x4fa31e3f8ba345227d44e1cf48559eea53a90dd5311dc006984c060f2f311d96),iv as (select mk.market, a.evt_block_time as t,cast(a.prevBorrowRate as double) / 1e18 as rps,date_diff('second', lag(a.evt_block_time) over (partition by a.id order by a.evt_block_time, a.evt_index),a.evt_block_time) as dtfrom ev ajoin mk on mk.id = a.id),b as (select market, date_trunc('hour', t) - interval '1' hour * (hour(t) % 6) as bucket,sum(rps * dt) as rps_dt, sum(dt) as dtfrom ivwhere dt > 0group by 1, 2),s as (select market, bucket, rps_dt, dt,rps_dt / dt as rps,sum(rps_dt) over (partition by market order by bucket range between interval '7' day preceding and current row)/ sum(dt) over (partition by market order by bucket range between interval '7' day preceding and current row) as rps_7dfrom b),w as (select * from s where bucket >= timestamp '2026-11-01 00:00:00')select bucket as time, market,100 * (exp(rps * 31536000) - 1) as borrow_apy_pct,100 * (exp(rps_7d * 31536000) - 1) as avg_7d_pct,100 * (exp(sum(rps_dt) over (partition by market) / sum(dt) over (partition by market) * 31536000) - 1) as period_avg_pctfrom worder by market, time