Commit graph

30 commits

Author SHA1 Message Date
Jakob Notland
51e73606b1 Review and clean up 2026-03-25 11:26:17 +01:00
jakobsn
15f7331867 dormant-pools-report-inflated-apy 2026-03-19 08:55:51 +00:00
jakobsn
381cb94295 Commit alternative solution for pool inflation 2026-03-11 09:31:21 +00:00
jakobsn
1877b09b47 Resolve pool id array aapy 2026-03-06 12:08:15 +00:00
Dagur Valberg Johannsson
f421327a5d
Switch to tokio and sqlx
This makes the application fully async; freeing web server threads to
handle new connections when waiting on SQL queries.

Additionally sqlx will allow easier move to a different database if
needed in the future.

Includes some SQL optimizations as well (slow queries more easliy identifiable
with sqlx).
2026-02-18 10:16:51 +01:00
Dagur Valberg Johannsson
16d7ff42b0
bug: Fix AAPY issue; follow up from BLOB change 2026-02-05 15:09:47 +01:00
Dagur Valberg Johannsson
beebc2c86f
bugfix: Reverse hash issues with blob 2026-02-02 11:34:18 +01:00
Dagur Valberg Johannsson
58fd9595d7
Convert hash columns from TEXT to BLOB storage
Migrate all 32-byte hash fields from TEXT (64-char hex) to BLOB
(32 bytes) for ~50% storage savings on hash columns.

Changes:
- Add src/db/blob.rs with ToBlob/FromBlob traits for hash types
- Update all table schemas to use BLOB for hash columns
- Replace .to_hex() with .to_blob() for DB inserts
- Replace ::from_hex() with ::from_blob() for DB reads
- Use SQL hex() function where API responses need hex strings
- Bump DB_VERSION from 4 to 5

Affected tables: tx, pool, pool_history_entry, utxo_spending,
utxo_funding, user_action, auth_chain_entry, bcmr_data,
bcmr_failure, bcmr_well_known, crc20, crc20_candidates,
delphi_entry, cached_token_metrics

Fixes #1
2026-01-22 08:30:17 +01:00
Dagur Valberg Johannsson
d85bc2c9db
Update copyright headers 2026-01-21 12:37:13 +01:00
Dagur Valberg Johannsson
50cd23dd34
Add RPC call to retrieve pool ID
Add a call that returns a pool ID given an utxo
2026-01-09 15:29:05 +01:00
Dagur Valberg Johannsson
8be4cf894e
Add a volume index
Significantly improves cpu load of volume queries
2025-10-08 13:56:36 +02:00
Dagur Valberg Johannsson
8dc824860c
bug: Fix volume for periods with no trades
Return 0 in volume rather than query error.
2025-08-19 11:45:12 +02:00
Dagur Valberg Johannsson
ec49bf765b
Improve pool visitor queries; make price a visitor
This adds a big performance boost to pool visitor queries, also moving
token price queries to use the visitor model.
2025-08-19 02:37:28 +02:00
Dagur Valberg Johannsson
14a7486c1d
rpc: Add /volume endpoints
Add /volume endpoints that use the new token/sats delta entries for
faster volume queries.
2025-08-18 09:53:40 +02:00
Dagur Valberg Johannsson
6e0a56e33b
Add traded sats delta to pool history entry
Will make it faster to calculate volume.
2025-08-15 22:26:03 +02:00
Dagur Valberg Johannsson
dc0457de9f
Remove duplicate code; make use of pool visitor 2025-07-18 17:09:56 +02:00
Dagur Valberg Johannsson
8284b03528
Improve TVL queries
Fixes #8
2025-07-18 14:13:08 +02:00
Dagur Valberg Johannsson
7d9352cf53
Fix clippy issues 2025-07-16 13:52:46 +02:00
Dagur Valberg Johannsson
460a1fc7f1
Add arbitrary int support 2025-07-16 09:30:17 +02:00
Dagur Valberg Johannsson
84ea84f4be
Filter tokens with no liquidity 2025-02-17 21:10:16 +01:00
Dagur Valberg Johannsson
4bf31c0131
Don't trigger parallel cache updates 2025-02-17 21:07:26 +01:00
Dagur Valberg Johannsson
0b4da0287d
bug: Fix tvl in token list 2024-11-28 10:27:35 +01:00
Dagur Valberg Johannsson
39131d4670
bug: Fix current price calculation 2024-11-28 08:45:21 +01:00
Dagur Valberg Johannsson
1f3ffa42a2
rpc: Add pool owner/token to history 2024-11-13 13:24:06 +01:00
Dagur Valberg Johannsson
b1e88ff261
rpc: Add pool history call 2024-11-13 11:28:27 +01:00
Dagur Valberg Johannsson
058f751a21
Improve querying for active pools
By using new field in the pool history entry table, we can improve the
query time for finding active cauldron pools.

This change also fixes a datatype issue in the table where TEXT was used
instead of INT.
2024-10-25 14:45:37 +02:00
Dagur Valberg Johannsson
19b3a3d3ea
Update tests for new table layout
Also rewrote tests to use insert functions
2024-10-24 09:12:12 +02:00
Dagur Valberg Johannsson
e4e7ec3b71
Add aggregated APY endpoint
Add an endpoint that gives a APY value across multiple micro-pools
2024-10-23 16:54:06 +02:00
Dagur Valberg Johannsson
3abbdbc177
Add timestamp to pools table
To speed up historical price queries, add timestamp to pools.
This denormalizes the database a bit for improved query performance.
2024-10-08 17:22:37 +02:00
Dagur Valberg Johannsson
e38eaaa26c
Add BCMR indexer
This adds BCMR indexer, including downloading and parsing the actual
BCMR files.
2024-05-27 11:56:35 +02:00
Renamed from src/db/pool.rs (Browse further)