Commit graph

226 commits

Author SHA1 Message Date
jakobsn
6ca7a194a2 Merge branch 'useDelphiForIndexer' into 'master'
Remove oracle_cash quickfix introduced Apr 24 2026

See merge request riftenlabs/riftenlabs-indexer!87
2026-06-09 13:15:21 +00:00
Jakob Notland
f186eda48e format 2026-06-09 15:14:10 +02:00
Jakob Notland
8d46dc3159 Remove unused 2026-06-09 13:56:45 +02:00
Jakob Notland
a622d48b29 Resolve tests 2026-06-09 13:56:25 +02:00
Jakob Notland
8b10473b9f Fix stale oracle_cash reference in ORACLE_SCALE comment
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 13:28:55 +02:00
Jakob Notland
7c196faf87 cash/closest: return 404 when no oracle price within 2h of timestamp
Prevents returning stale v1 data as if it were the price for a gap-period
timestamp (Apr 23–May 4 2026). If the closest indexed entry is more than
MAX_ORACLE_STALENESS_SECS (7200s) away, respond with PriceNotFound 404
instead of silently returning wrong data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 13:20:22 +02:00
Jakob Notland
62c5b2ff4a Re-add cash/closest and cash/history endpoints backed by Delphi v2
The frontend still routes the Apr 23–May 4 gap period to these endpoints.
Instead of the removed oracle_cash table, they now delegate to get_closest
and get_range with no token_id filter — returning the nearest Delphi entry
(v1 for historical, v2 for recent, closest available for the gap).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 13:16:26 +02:00
Jakob Notland
acfed56475 Remove oracle_cash quickfix introduced Apr 24 2026
Deletes all oracle_cash infrastructure: the background poller
(oracle_cash.rs), DB layer (db/oracle/oracle_cash.rs), RPC endpoints
(cash/closest, cash/history), table init, and all wiring in main.rs.

usd_per_bch_at_or_before is simplified to a single get_closest(&None, ts)
call now that Delphi v2 data is indexed in the same delphi_entry table.
Returns anyhow::Result<Decimal> and errors instead of silently returning
zero when no oracle price is available. Callers updated with ?.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 13:09:46 +02:00
Jakob Notland
12f50429de Use delphi for indexer price calculation. 2026-06-09 12:18:45 +02:00
jakobsn
d8edfe15fb Merge branch 'chartImprovementFirstSeen' into 'master'
Use first time seen for phe same as transactions to make the live price chart sensible.

See merge request riftenlabs/riftenlabs-indexer!85
2026-05-08 14:24:18 +00:00
Jakob Notland
071bd3552b Use first time seen for phe same as transactions to make the live price chart sensible. 2026-05-07 14:25:52 +02:00
Dagur Valberg Johannsson
7fbe2b2b79 Merge branch 'delphi-v2' into 'master'
Delphi v2 support

See merge request riftenlabs/riftenlabs-indexer!84
2026-05-04 21:49:48 +00:00
Dagur Valberg Johannsson
4d205cada4
Delphi v2 support
Same API from consumer-standpoint
2026-05-04 15:03:40 +02:00
Dagur Valberg Johannsson
4fe4492620 Merge branch 'well-known-bug' into 'master'
bcmr: Look for well-known on bare domains

Closes #24

See merge request riftenlabs/riftenlabs-indexer!83
2026-04-29 08:39:48 +00:00
Dagur Valberg Johannsson
2633166705
bcmr: Look for well-known on bare domains
According to BCMR spec, if bare domains are un op_return, we should look
up "well known" path for the domain.

Fallback to previous behaviour if well known is not found.
2026-04-29 10:35:34 +02:00
jakobsn
00a28f71c0 Merge branch 'oraclesCashDirectly' into 'master'
using oracles cash feed

See merge request riftenlabs/riftenlabs-indexer!82
2026-04-24 05:19:43 +00:00
jakobsn
f56cc16d93 using oracles cash feed 2026-04-24 05:19:43 +00:00
jakobsn
22f890d6ff Merge branch '4-price-token-at-timestamp-does-not-count-previously-active-pools' into 'master'
Count pools that were not withdrawn at the given time.

Closes #4

See merge request riftenlabs/riftenlabs-indexer!80
2026-04-16 12:35:15 +00:00
jakobsn
460794f067 Count pools that were not withdrawn at the given time. 2026-04-16 12:35:15 +00:00
Dagur Valberg Johannsson
37779e68f8 Merge branch 'moria' into 'master'
Added support for indexing Moria contracts

See merge request riftenlabs/riftenlabs-indexer!77
2026-04-08 08:27:33 +00:00
Dagur Valberg Johannsson
c7eb5bcc36 Added support for indexing Moria contracts 2026-03-30 23:52:29 +02:00
jakobsn
3996264bd3 Merge branch 'cacheCandles' into 'master'
Cachecandles

See merge request riftenlabs/riftenlabs-indexer!78
2026-03-25 11:38:10 +00:00
jakobsn
bcab4db2fe Cachecandles 2026-03-25 11:38:10 +00:00
jakobsn
a1753deedb Merge branch '23-dormant-pools-report-inflated-apy-due-to-end-snapshot-not-clamped-to-window-boundary' into 'master'
dormant-pools-report-inflated-apy

Closes #23

See merge request riftenlabs/riftenlabs-indexer!76
2026-03-19 08:55:51 +00:00
jakobsn
15f7331867 dormant-pools-report-inflated-apy 2026-03-19 08:55:51 +00:00
jakobsn
9130c43dbf Merge branch '20-alternative-solution' into 'master'
Commit alternative solution for pool inflation

Closes #20

See merge request riftenlabs/riftenlabs-indexer!74
2026-03-11 09:31:21 +00:00
jakobsn
381cb94295 Commit alternative solution for pool inflation 2026-03-11 09:31:21 +00:00
jakobsn
87ba024a04 Merge branch '21-return-aapy-for-an-array-of-pkhs' into 'master'
Resolve pool id array aapy

Closes #21

See merge request riftenlabs/riftenlabs-indexer!71
2026-03-06 12:08:18 +00:00
jakobsn
1877b09b47 Resolve pool id array aapy 2026-03-06 12:08:15 +00:00
Dagur Valberg Johannsson
79e8968ef0 Merge branch 'update-docs' into 'master'
Document improvements

See merge request riftenlabs/riftenlabs-indexer!70
2026-02-24 10:43:59 +00:00
Dagur Valberg Johannsson
e8371c3967
Document improvements
Misc improves to API documentation
2026-02-24 11:39:20 +01:00
Dagur Valberg Johannsson
18c0f41a58 Merge branch 'bump-electrum' into 'master'
Bump electrum dep to allow larger websocket msg

See merge request riftenlabs/riftenlabs-indexer!69
2026-02-24 09:35:02 +00:00
Dagur Valberg Johannsson
527b9ba91c
Bump electrum dep to allow larger websocket msg
We need to allow larger messages to index large blocks via websocket
interface.
2026-02-24 10:33:39 +01:00
Dagur Valberg Johannsson
9d909e4e72 Merge branch 'sqlx' into 'master'
Switch to tokio and sqlx

See merge request riftenlabs/riftenlabs-indexer!68
2026-02-18 10:53:28 +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
ebe4bfa176 Merge branch 'cached_bcmr' into 'master'
Add 'bcmr' to metrics cache

See merge request riftenlabs/riftenlabs-indexer!67
2026-02-17 13:25:59 +00:00
Dagur Valberg Johannsson
ceb0e54dc0
Add 'bcmr' to metrics cache
This removes the need to have a BCMR connction during token search /
listing; also saving 2x lookups per token in results.
2026-02-17 14:06:16 +01:00
Dagur Valberg Johannsson
809b13e1f0 Merge branch 'rpc-health' into 'master'
Add /health endpoint

See merge request riftenlabs/riftenlabs-indexer!66
2026-02-10 14:40:01 +00:00
Dagur Valberg Johannsson
3ff73473df
Add /health endpoint 2026-02-10 15:36:21 +01:00
Dagur Valberg Johannsson
52ad406cf1 Merge branch 'db-cfg' into 'master'
Make DB read pool size configurable

See merge request riftenlabs/riftenlabs-indexer!65
2026-02-10 14:31:03 +00:00
Dagur Valberg Johannsson
bac43bbb98
Make DB read pool size configurable 2026-02-10 14:49:28 +01:00
Dagur Valberg Johannsson
36d620eb82 Merge branch 'bug-aapy' into 'master'
bug: Fix AAPY issue; follow up from BLOB change

See merge request riftenlabs/riftenlabs-indexer!64
2026-02-05 14:14:08 +00:00
Dagur Valberg Johannsson
17995ea520
Shorten db lock in BCMR downloader
Don't need to hold a write lock while we wait for BCMR download.
2026-02-05 15:10:07 +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
8180efdfe5 Merge branch 'fd-reduce' into 'master'
Reduce file descriptor usage

See merge request riftenlabs/riftenlabs-indexer!63
2026-02-04 08:11:47 +00:00
Dagur Valberg Johannsson
d6fa922154
Reduce file descriptor usage
Misc changes to reduce file descriptor usage for the indexer.
2026-02-04 08:53:27 +01:00
Dagur Valberg Johannsson
02e8ea2d4a Merge branch 'ws' into 'master'
Add WebSocket support

See merge request riftenlabs/riftenlabs-indexer!62
2026-02-03 08:47:12 +00:00
Dagur Valberg Johannsson
7ad0303209
Add WebSocket support 2026-02-03 09:39:12 +01:00
Dagur Valberg Johannsson
774fff6c92 Merge branch 'cache-write-lock' into 'master'
Fix potential API hangs from write lock contention

See merge request riftenlabs/riftenlabs-indexer!60
2026-02-02 20:14:09 +00:00
Dagur Valberg Johannsson
d8929dc913 Merge branch 'crc20-fix' into 'master'
Fix cross-database query bug in CRC20 BCMR filtering

See merge request riftenlabs/riftenlabs-indexer!61
2026-02-02 20:11:19 +00:00