Query editor
/* PST Orca whirlpool: lifetime NAV markout, per-tx fills.nav(t,m,e): epoch seconds and the two fitted NAV references, piecewise linear.m = local level (14-day knots fitted to a centred 7-day rolling median)e = upper reference (same, fitted to the centred 7-day 98th percentile) */WITH nav(t, m, e) AS (VALUES(1742572800.0, 0.98978665, 0.97258840),(1744300800.0, 0.99875269, 0.99866186),(1745510400.0, 1.00502892, 1.01691328),(1746720000.0, 1.02362235, 1.03496647),(1747929600.0, 1.02362235, 1.03518842),(1749139200.0, 1.02362235, 1.03518842),(1750348800.0, 1.02362235, 1.03518842),(1751558400.0, 1.02953041, 1.03844825),(1752768000.0, 1.02953041, 1.03844825),(1753977600.0, 1.03195544, 1.03844825),(1755187200.0, 1.03605664, 1.03844825),(1756396800.0, 1.03892520, 1.03973189),(1757606400.0, 1.04324273, 1.04411305),(1758816000.0, 1.04755866, 1.04791903),(1760025600.0, 1.05113875, 1.05154115),(1761235200.0, 1.05449428, 1.05487126),(1762444800.0, 1.05733166, 1.05850016),(1763654400.0, 1.06083019, 1.06177674),(1764864000.0, 1.06469631, 1.06544056),(1766073600.0, 1.06866597, 1.06907614),(1767283200.0, 1.07221530, 1.07255399),(1768492800.0, 1.07561346, 1.07571994),(1769702400.0, 1.07884441, 1.07897229),(1770912000.0, 1.08144175, 1.08211293),(1772121600.0, 1.08513136, 1.08531331),(1773331200.0, 1.08838866, 1.08859761),(1774540800.0, 1.09132961, 1.09167821),(1775750400.0, 1.09460596, 1.09492845),(1776960000.0, 1.09796466, 1.09830748),(1778169600.0, 1.10124148, 1.10139344),(1779379200.0, 1.10453268, 1.10474911),(1780588800.0, 1.10766413, 1.10801413),(1781798400.0, 1.11120731, 1.11124953),(1783008000.0, 1.11445637, 1.11450678),(1784217600.0, 1.11774929, 1.11780917),(1785427200.0, 1.12109367, 1.12111034),(1786608000.0, 1.12413351, 1.12434836),(1788336000.0, 1.12858206, 1.12908693)),navi AS (SELECT t, m, e,LEAD(t) OVER (ORDER BY t) AS t2,LEAD(m) OVER (ORDER BY t) AS m2,LEAD(e) OVER (ORDER BY t) AS e2FROM nav),tx AS (SELECT tx_id,MIN(to_unixtime(block_time)) AS ts,SUM(CASE WHEN token_bought_mint_address = '59obFNBzyTBGowrkif5uK7ojS58vsuWz3ZCvg6tfZAGw'THEN token_bought_amount ELSE -token_sold_amount END) AS pst,SUM(CASE WHEN token_bought_mint_address = '59obFNBzyTBGowrkif5uK7ojS58vsuWz3ZCvg6tfZAGw'THEN -token_sold_amount ELSE token_bought_amount END) AS usdcFROM dex_solana.tradesWHERE block_date >= DATE '2025-04-10'