Commit graph

57 commits

Author SHA1 Message Date
Dagur Valberg Johannsson
d85bc2c9db
Update copyright headers 2026-01-21 12:37:13 +01:00
Dagur Valberg Johannsson
e93d46ec69 Add Cache-Control headers to RPC endpoints for load balancer caching
Introduce CachedJson response wrapper with cache duration based on data mutability:
- CACHE_IMMUTABLE (1 day): historical data with explicit timestamps
- CACHE_BCMR (5 min): token metadata
- CACHE_AGGREGATE (60s): aggregate data that changes with blocks
- CACHE_NONE: real-time data (current price, active pools, latest txs)

Endpoints dynamically select cache duration based on whether time parameters
are explicitly provided (historical/immutable) or defaulted to now (live).
2026-01-21 10:37:55 +01:00
Dagur Valberg Johannsson
2c76bf09c7 Fix incorrect 5XX responses for user input errors
Return proper 4XX status codes for client errors to prevent load balancers
from misinterpreting input validation failures as server errors. Add
centralized ApiResult type and ApiErrorCode enum for consistent handling.
2026-01-21 08:27:57 +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
jakobsn
885dde9534 Resolve "Panic occurred: attempt to multiply with overflow" 2025-10-03 13:32:37 +00:00
jakobsn
36ec60e049 Merge branch '13-returnoldestpoolcreationtime' into 'master'
Expose first pool created timestamp

Closes #13

See merge request riftenlabs/riftenlabs-indexer!38
2025-09-17 10:11:32 +00:00
Jakob Notland
46462284e8 Clean 2025-09-17 11:52:22 +02:00
jakobsn
93de5e04eb Resolve "incorrectVolumeForCandles" 2025-09-17 09:50:39 +00:00
Jakob Notland
7e7f5b9bc7 Expose first pool created timestamp 2025-09-17 11:11:21 +02:00
jakobsn
f83f472656
Goodsearchandsort 2025-09-05 13:53:10 +00: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
5017713ab2
bug: TVL filtered by token
Fix query bug for TVL filtered by token and add a test.
2025-08-15 14:55:54 +02:00
Dagur Valberg Johannsson
007aeb06dd
contrib: Tool for documenting API calls 2025-07-22 13:08:48 +02:00
Dagur Valberg Johannsson
be152c33e5
Add a tvl test 2025-07-18 17:10:08 +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
jakobsn
b17b8a3947 Resolve "Oracle prices" 2025-06-17 14:04:26 +00:00
Dagur Valberg Johannsson
3d83bdee47 Merge branch 'candlesticks2' into 'master'
Candlesticks2

See merge request riftenlabs/riftenlabs-indexer!20
2025-06-17 13:22:46 +00:00
jakobsn
d1e265cf2f Candlesticks2 2025-06-17 13:22:46 +00:00
Dagur Valberg Johannsson
78e391560f
Added support for delphi oracle
This allows fetching historical asset prices from the blockchain.
2025-05-21 13:33:26 +02:00
Dagur Valberg Johannsson
4bf31c0131
Don't trigger parallel cache updates 2025-02-17 21:07:26 +01:00
Dagur Valberg Johannsson
bb46b8e3f8
Add IPFS gateway 2025-02-15 09:15:22 +01:00
Dagur Valberg Johannsson
219d0ff75d
missing file 2025-02-14 20:43:51 +01:00
Dagur Valberg Johannsson
5bb841f5c5
bug: don't crash on db read failure 2025-02-14 18:02:48 +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
2449665fad
aapy: higher weight for larger pools 2024-11-13 22:32:32 +01:00
Dagur Valberg Johannsson
1f3ffa42a2
rpc: Add pool owner/token to history 2024-11-13 13:24:06 +01:00
Dagur Valberg Johannsson
5d4b525743
Add total interractions to contract count
Closes #6
2024-11-13 11:28:27 +01:00
Dagur Valberg Johannsson
b1e88ff261
rpc: Add pool history call 2024-11-13 11:28:27 +01:00
Dagur Valberg Johannsson
7ab3e1960b
bug: Fix 'active' pools showing old instance 2024-11-13 11:28:27 +01:00
jakobsn
1248929fb4 Search tokens 2024-10-31 10:55:29 +00: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
751c1df6a7
Add CRC20 index 2024-10-21 13:35:24 +02:00
jakobsn
07c75b1a7e Tokens page 2024-10-14 11:18:50 +00:00
Dagur Valberg Johannsson
528cc79725
API call for latest transactions 2024-09-25 13:39:06 +02:00
Dagur Valberg Johannsson
cd6ce4d4ef
Add well-known BCMR sources
This adds additional BCMR data sources, mainly OTR.
2024-09-10 22:39:30 +02:00
Dagur Valberg Johannsson
675b3f08f9
rpc: Unique addresses
RPC method to show number of unique addresses interracting with cauldron
2024-09-04 13:25:36 +02:00
Dagur Valberg Johannsson
fea08d2b84
fix division by zero 2024-06-06 08:03:12 +02:00
Dagur Valberg Johannsson
37f2e15333
bugfix: Use correct cache key in closure 2024-05-30 12:20:52 +02:00
Dagur Valberg Johannsson
3ba04dfd58
Cache list_by_volume call
This is an expensive call used by all users of Cauldron DEX; cache for
60 seconds.
2024-05-29 08:46:35 +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
Dagur Valberg Johannsson
49730f27ca
chore: Fix clippy issue 2024-05-06 11:18:05 +02:00
Dagur Valberg Johannsson
c2bb75b375
bugfix: Don't list old APY state 2024-05-04 19:45:13 +02:00
Dagur Valberg Johannsson
98ab9a81b3
bugfix: List most recent pool utxos 2024-04-15 23:05:06 +02:00