MONTH | TOTAL_SOL_REPAID | NUM_LOANS_REPAID | AVG_SOL_PER_LOAN | TOTAL_PLATFORM_FEES | TOTAL_COMMUNITY_FEES | PCT_DIFF_TOTAL_SOL_REPAID | PCT_DIFF_NUM_LOANS_REPAID | PCT_DIFF_AVG_SOL_PER_LOAN | PCT_DIFF_TOTAL_PLATFORM_FEES | PCT_DIFF_TOTAL_COMMUNITY_FEES | |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | 2025-05-01 00:00:00.000 | 5520.635605144 | 3007 | 1.835928036 | 20.599801124 | 6.866598724 | -42.883119117 | -33.4145 | -14.220208158 | -28.063805554 | -28.063806036 |
2 | 2025-04-01 00:00:00.000 | 9665.50609867 | 4516 | 2.140280358 | 28.636211969 | 9.545401759 | -28.347641758 | -3.5043 | -25.745563204 | -23.256628878 | -23.256632987 |
3 | 2025-03-01 00:00:00.000 | 13489.445896569 | 4680 | 2.882360234 | 37.314248189 | 12.438080489 | 15.616432402 | 9.6275 | 5.462938018 | 12.003116003 | 12.00311628 |
4 | 2025-02-01 00:00:00.000 | 11667.412336012 | 4269 | 2.733055127 | 33.315366144 | 11.10512002 | -32.118281066 | -22.1554 | -12.798466472 | -33.372378969 | -33.372380692 |
5 | 2025-01-01 00:00:00.000 | 17187.856346728 | 5484 | 3.134182412 | 50.00233481 | 16.667442324 | -3.428912862 | -18.4899 | 18.477438779 | -7.084274776 | -7.08427336 |
6 | 2024-12-01 00:00:00.000 | 17798.139025005 | 6728 | 2.645383327 | 53.81471725 | 17.938235998 | 73.854852321 | 26.2052 | 37.755680399 | 74.872880036 | 74.872892605 |
7 | 2024-11-01 00:00:00.000 | 10237.3553498 | 5331 | 1.920344279 | 30.773620952 | 10.257871149 | -13.872757895 | 3.7967 | -17.023163487 | -13.290036536 | -13.290040131 |
8 | 2024-10-01 00:00:00.000 | 11886.315060863 | 5136 | 2.31431368 | 35.49029399 | 11.830095602 | -8.611774738 | -8.7096 | 0.10711747 | -8.660197359 | -8.660197693 |
9 | 2024-09-01 00:00:00.000 | 13006.396641076 | 5626 | 2.311837298 | 38.855233933 | 12.95174207 | -17.097950061 | -30.0857 | 18.576750064 | -17.528684128 | -17.528681836 |
10 | 2024-08-01 00:00:00.000 | 15688.872169839 | 8047 | 1.949654799 | 47.113634022 | 15.704541116 | 6.446917063 | 0.9788 | 5.415121421 | 4.800933016 | 4.800936084 |
11 | 2024-07-01 00:00:00.000 | 14738.681591461 | 7969 | 1.849502019 | 44.955357425 | 14.985115308 | 10.446793471 | 0.34 | 10.072585487 | 11.302105738 | 11.302107799 |
12 | 2024-06-01 00:00:00.000 | 13344.598904358 | 7942 | 1.680256724 | 40.390392551 | 13.46346049 | -23.363792884 | -27.5695 | 5.806599222 | -25.410305653 | -25.410305051 |
13 | 2024-05-01 00:00:00.000 | 17412.916696416 | 10965 | 1.588045298 | 54.150097952 | 18.050027553 | -80.98786446 | -52.2742 | -60.16381085 | -76.544005698 | -76.544009065 |
14 | 2024-04-01 00:00:00.000 | 91588.431292882 | 22975 | 3.986438794 | 230.858249939 | 76.952739294 | 17.435177673 | -2.2673 | 20.159571566 | 9.557959606 | 9.557961704 |
15 | 2024-03-01 00:00:00.000 | 77990.626921032 | 23508 | 3.317620679 | 210.717916588 | 70.239294431 | 28.098611871 | 23.3368 | 3.860793868 | 6.314214952 | 6.314212683 |
16 | 2024-02-01 00:00:00.000 | 60883.272489868 | 19060 | 3.194295514 | 198.202955911 | 66.067642941 | 21.074423236 | 6.5638 | 13.616848584 | 20.719012444 | 20.719014642 |
17 | 2024-01-01 00:00:00.000 | 50285.824918609 | 17886 | 2.811462871 | 164.185368898 | 54.728447823 | -43.757133313 | -19.0789 | -30.496696724 | -42.949658846 | -42.949661309 |
18 | 2023-12-01 00:00:00.000 | 89408.360349113 | 22103 | 4.045078059 | 287.790336702 | 95.930101518 | 45.146470553 | 0.5276 | 44.384719181 | 45.843339986 | 45.843346408 |
19 | 2023-11-01 00:00:00.000 | 61598.714738564 | 21987 | 2.801597068 | 197.328405074 | 65.776124781 | -25.501946649 | -12.5835 | -14.778048943 | -28.123388063 | -28.123389855 |
20 | 2023-10-01 00:00:00.000 | 82684.999093915 | 25152 | 3.287412496 | 274.537710887 | 91.512558325 | -31.890106696 | -6.9788 | -26.780239939 | -31.151706343 | -31.151708658 |
rw2023Loan KPIs monthly
Updated 2025-05-25Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
WITH repay_events AS (
SELECT
DATE_TRUNC('month', block_timestamp) AS month,
inner_instruction:instructions[0]:parsed:info:lamports / 1e9 AS sol_repaid, -- Monto total repagado en SOL
inner_instruction:instructions[1]:parsed:info:destination AS platform_fee_address, -- Dirección de la plataforma
inner_instruction:instructions[1]:parsed:info:lamports / 1e9 AS platform_fee_amount, -- Monto a la plataforma en SOL
inner_instruction:instructions[2]:parsed:info:destination AS community_fee_address, -- Dirección de la comunidad
inner_instruction:instructions[2]:parsed:info:lamports / 1e9 AS community_fee_amount -- Monto a la comunidad en SOL
FROM
solana.core.fact_events
WHERE
program_id LIKE 'SHARK%'
AND succeeded = TRUE
AND block_timestamp >= CURRENT_DATE - INTERVAL '2 YEAR'
AND inner_instruction:instructions[0]:parsed:type = 'transfer'
AND inner_instruction:instructions[1]:parsed:type = 'transfer'
AND inner_instruction:instructions[2]:parsed:type = 'transfer'
),
repaid_loans_agg AS (
SELECT
month,
SUM(sol_repaid) AS total_sol_repaid,
COUNT(*) AS num_loans_repaid,
CASE
WHEN COUNT(*) > 0 THEN SUM(sol_repaid) / COUNT(*)
ELSE 0
END AS avg_sol_per_loan,
SUM(platform_fee_amount) AS total_platform_fees,
SUM(community_fee_amount) AS total_community_fees
FROM
repay_events
GROUP BY
month
),
financial_metrics_with_variation AS (
SELECT
Last run: 2 months ago
25
4KB
12s