Baselight
-- Token Trends Analysis for Chart Comparison
SELECT 
    createdat::date as date,
    
    -- Daily token metrics
    COUNT(*) as daily_tokens_issued,
    COUNT(DISTINCT issuer) as daily_unique_issuers,
    SUM(holders) as daily_new_token_holders,
    
    -- Cumulative token metrics
    SUM(COUNT(*)) OVER (ORDER BY createdat::date) as cumulative_tokens_issued,
    SUM(SUM(holders)) OVER (ORDER BY createdat::date) as cumulative_token_holders,
    
    -- Token quality metrics
    COUNT(CASE WHEN meta_token_trust_level >= 3 THEN 1 END) as daily_high_trust_tokens,
    COUNT(CASE WHEN amms > 0 THEN 1 END) as daily_tokens_with_amm,
    COUNT(CASE WHEN blackholed = 'true' THEN 1 END) as daily_blackholed_tokens,
    
    -- Average metrics for the day
    ROUND(AVG(holders), 0) as avg_holders_per_token,
    ROUND(AVG(COALESCE(meta_token_trust_level, 0)), 2) as avg_trust_level,
    
    -- 7-day rolling averages for smoothed trends
    ROUND(AVG(COUNT(*)) OVER (
        ORDER BY createdat::date 
        ROWS BETWEEN 6 PRECEDING AND CURRENT ROW
    ), 1) as tokens_issued_7d_avg,
    
    ROUND(AVG(COUNT(DISTINCT issuer)) OVER (
        ORDER BY createdat::date 
        ROWS BETWEEN 6 PRECEDING AND CURRENT ROW
    ), 1) as unique_issuers_7d_avg

FROM @xrpscan.xrp_ledger.tokens
WHERE createdat >= '2025-01-01'  -- Focus on recent activity
  AND createdat IS NOT NULL
GROUP BY createdat::date
ORDER BY createdat::date ASC;
datedaily_tokens_issueddaily_unique_issuersdaily_new_token_holderscumulative_tokens_issuedcumulative_token_holdersdaily_high_trust_tokensdaily_tokens_with_ammdaily_blackholed_tokensavg_holders_per_tokenavg_trust_leveltokens_issued_7d_avgunique_issuers_7d_avg
2025-01-093887334950345618538873345618554134930890.213887334950
2025-01-11650641884139523346502602690140.3319761.517795.5
2025-01-15124812432647640771349150204900210.3413590.312278
2025-01-274444427879012452153570514117110180.2911303.810278
2025-01-2825224765464546735770607880260.379093.48271.8
2025-01-2923623626814570335797410830110.147617.26932.5
2025-01-3028826538914599135836320890140.136570.15980
2025-01-312252221843462163585475077080.210491018.9
2025-02-0115014821614636635876360560140.19977.6948.4
2025-02-021151141090464813588726038090.2815.7787.1
2025-02-0314714714604662835901860540100.27201.9197
2025-02-041271261124467553591310050090.32184179.7
2025-02-0511411216164686935929260420140.31166.6162
2025-02-06999620834696835950090320210.23139.6137.9
2025-02-0710710444534707535994620300420.2122.7121
2025-02-0845458364712036002980160190.22107.7106.3
2025-02-0923810527674735836030650250120.06125.3105
2025-02-10131131506474893603571028040.15123102.7
2025-02-112121111898477013605469037090.12135.1100.6
2025-02-123151481471480163606940032050.07163.9105.7
2025-02-13969518984811236088380270200.19163.4105.6
2025-02-1410410044914821636133291280430.2163105
2025-02-1512112014824833736148110380120.16173.9115.7
2025-02-16737214214841036162320210190.14150.3111
2025-02-17706910384848036172700220150.21141.6102.1
2025-02-1811410316184859436188880350140.11127.6101
2025-02-19777414514867136203390230190.1393.690.4
2025-02-20858417644875636221030320210.129288.9
2025-02-21727212194882836233220260170.1787.484.9
2025-02-2211011030594893836263810460280.0985.983.4
2025-02-23757414504901336278310270190.1386.183.7
2025-02-24828054424909536332730260660.1687.985.3
2025-02-25706922184916536354910310320.1381.680.4
2025-02-26444311554920936366460150260.2376.976
2025-02-271139955074932236421530440490.0780.978.1
2025-02-285454454493763642607024080.1178.375.6
2025-03-01929211754946836437820310130.0775.773
2025-03-02807412114954836449930240150.1976.473
2025-03-032365947454978436497380180200.0198.470
2025-03-0473737434985736504810140100.198.970.6
2025-03-0553539144991036513950170170.11100.172
2025-03-0660607694997036521640200130.1292.666.4
2025-03-07656314195003536535830230220.1294.167.7
2025-03-0811010520495014536556320290190.1996.769.6
2025-03-09260621605504053657237016060.04122.467.9
2025-03-1049495205045436577570110110.1695.766.4
2025-03-1117769641506313658398024040.07110.665.9
2025-03-125353470506843658868015090.19110.665.9
2025-03-135554517507393659385012090.11109.965
2025-03-144847424507873659809014090.17107.462.7
2025-03-15716947765085836645850200670.15101.957.6
2025-03-1646468085090436653930170180.271.355.3
2025-03-176359552509673665945017090.2173.356.7
2025-03-1848456655101536666100100140.0654.953.3
2025-03-1948488595106336674690180180.2354.152.6
2025-03-20878713715115036688400280160.0758.757.3
2025-03-217877678512283669518018090.066361.6
2025-03-226363494512913670012013080.0861.960.7
2025-03-2369687935136036708050260110.2365.163.9
2025-03-24606010045142036718090150170.1564.764
2025-03-256565425514853672234015070.1767.166.9
2025-03-2664637515154936729850180120.1669.469
2025-03-277272666516213673651026090.1967.366.9
2025-03-2849496415167036742920160130.1463.162.9
2025-03-297878502517483674794013060.1465.365
2025-03-306262572518103675366022090.2364.364.1
2025-03-3156569365186636763020180170.1463.763.6
2025-04-01363625851902367656008070.1959.659.4
2025-04-0243435345194536770940130120.1956.656.6
2025-04-0341412299519863679393090560.1252.152.1
2025-04-04393933452025367972707090.1350.750.7
2025-04-051204035635214536832900100300.0756.745.3
2025-04-06343318752179368347707060.2152.741.1
2025-04-0735354285221436839050100120.1449.738.1
2025-04-0867676605228136845650200100.0654.142.6
2025-04-09232313852304368470304060.0951.339.7
2025-04-105656351523603685054021060.0453.441.9
2025-04-11222216652382368522006080.325139.4
2025-04-1241405905242336858100100140.1539.739.4
2025-04-132929487524523686297090170.283938.9
2025-04-141111112524633686409030100.3635.635.4
2025-04-152926280524923686689080100.1430.129.6
2025-04-163937235525313686924012060.132.431.6
2025-04-1736331112525673688036190310.3129.628.3
2025-04-18232317552590368821103080.0429.728.4
2025-04-194444409526343688620010090.1130.129
2025-04-20333319152667368881107060.1830.729.6
2025-04-2120188052687368889115040.253230.6
2025-04-22413935652728368924709090.1233.732.4
2025-04-234848427527763689674011090.153534
2025-04-243938200528153689874012050.1535.434.7
2025-04-2553511191528683691065080220.1339.738.7
2025-04-26787817035294636927680180220.144.643.6
2025-04-276262550530083693318018090.1648.747.7
2025-04-2810910958765311736991940310540.1961.460.7
2025-04-29939015155321037007090330160.1968.968
2025-04-30707026235328037033320220370.27271.1
2025-05-015751424533373703756011070.1474.673
2025-05-02777613065341437050620190170.177876.6
2025-05-037170534534853705596016080.117775.4
2025-05-0470698705355537064660210120.1778.176.4
2025-05-0564546855361937071510110110.1471.768.6
2025-05-06949115475371337086980270160.2271.968.7
2025-05-0782779815379537096790200120.1873.669.7
2025-05-08817614625387637111410230180.197773.3
2025-05-091096112495398537123901210110.1681.671.1
2025-05-1044434425402937128320120100.1877.767.3
2025-05-114139348540703713180013080.273.663
2025-05-124640512541163713692080110.097161
2025-05-1372689675418837146590110130.0467.957.7
2025-05-14625735385425037181970140570.196554.9
2025-05-156561580543153718777214090.262.752.7
2025-05-1677737985439237195750150100.0658.154.4
2025-05-1711811644954510372002408040.0368.764.9
2025-05-18777461054587372063409080.0873.969.9
2025-05-19423854355462937260690901290.173.369.6
2025-05-20625849895469137310580170800.1571.968.1
2025-05-21119119367548103731425015030.098077
2025-05-22969632785490637347030110340.0784.482
2025-05-234444428549503735131080100.279.777.9
2025-05-2457579755500737361060190170.127169.4
2025-05-2559599595506637370650180160.0768.467.3
2025-05-2647411175551133738240050250.0669.167.7
2025-05-2752454506551653742746050870.0467.765.9
2025-05-281259426835529037454290180210.1168.662.3
2025-05-29665627495535637481781130420.1864.356.6
2025-05-30695824955542537506730160360.267.958.6
2025-05-31565326385548137533110140470.2367.758
2025-06-01777411185555837544290180150.2170.360.1
2025-06-0280739065563837553350170110.137564.7
2025-06-03686410155570637563500200150.1877.367.4
2025-06-04857530445579137593940190360.1671.664.7
2025-06-05736967455586437661390170920.172.666.6
2025-06-0655546315591937667700110110.0970.666
2025-06-075856477559773767247014080.0570.966.4
2025-06-0854515795603137678260140110.0467.663.1
2025-06-09999250745613037729001310510.1570.365.9
2025-06-10686238855619837767850170570.0770.365.6
2025-06-11807531905627837799751100400.0669.665.6
2025-06-12666144675634437844420120680.0368.664.4
2025-06-1345412200563893786642080490.0767.162.6
2025-06-14464614625643537881040130320.0265.461.1
2025-06-15585730455649337911490150530.056662
2025-06-16665562156559379177001309061.356.7
2025-06-171328514655669137932351260110.0370.460
2025-06-18817616735677237949080250210.0270.660.1
2025-06-19635824935683537974010160400.0670.159.7
2025-06-20585814995689337989000190260.037262.1
2025-06-21595926105695238015100140440.0373.964
2025-06-223534366569873801876090100.1170.660.7
2025-06-23464539557033380227109090.0467.759.3
2025-06-24107105957571403803228030090.0264.162.1
2025-06-2571712379572113805607025034062.761.4
2025-06-26909014685730138070751320160.0766.666
2025-06-27424215535734338086280150370.0564.363.7
2025-06-2864617035740738093310190110.026564
2025-06-295554810574623810141012015067.966.9
2025-06-30474520975750938122380404506866.9
2025-07-018681158257595381382002301806563.4
2025-07-0265631936576603815756015030064.162.3
2025-07-0377601647577373817403014021062.358
2025-07-046860162457805381902701402406660.6
2025-07-054141425578463819452011010062.757.7
2025-07-063838455578843819907010012060.355.4
2025-07-0783823055796738202120604065.460.7
2025-07-0853502995802038205110706060.756.3
2025-07-094848291558068382342607061058.354.1
2025-07-103030147758098382490308049051.649.9
2025-07-11313060358129382550608019046.345.6
2025-07-1256565015818538260070809048.447.7
2025-07-13191930858204382631506016045.745
2025-07-14717115035827538278181210210.044443.4
2025-07-1593921249583683829067026013049.749.4
2025-07-16858344885845338335552280530.075554.4
2025-07-17828020775853538356320250250.0162.461.6
2025-07-1864632316585993837948021036067.166.3
2025-07-194544600586443838548012013065.664.6
2025-07-206464144158708383998902502307271
2025-07-21989815955880638415841380160.0375.974.9
2025-07-22268751566590743843150124060.01100.972.4
2025-07-23887912145916238443640320140101.371.9
2025-07-243737412591993844776011011094.965.7

Share link

Anyone who has the link will be able to view this.