Kotlin based indexer as used by: https://realfi.info. Provides historical and latest prices for all Cardano Native Tokens (CNT). Uses;
- Bloxbean Yaci JVM based Cardano mini-protocols library
- Blockbean YaciStore general purpose indexer, only for txOutput resolution (modular option)
- dcSpark Carp general purpose indexer, only for txOutput resolution (modular option)
- Koios Koios Cardano data API, only for txOutput resolution (modular option)
- Blockfrost Blockfrost Cardano data API, only for txOutput resolution (modular option)
- Cardano Foundation Token Registry for CNT metadata (modular, can be swapped)
- Trades obtained from on-chain Cardano DEX data including Minswap V1/V2, Sundaeswap V1 and Wingriders (modular can be extended)
- Koin dependency injection
Configure your environment
cp .env.template .envModify .env, in particular, these are required. You may modify other variables if needed
BLOCKFROST_DATASOURCE_APIKEY=<yours, get from https://blockfrost.io>
DATABASE_USERNAME=<yours>
DATABASE_PASSWORD=<yours>Run the system
From the project root,
docker compose up -dscripts/check_running.shWait until a state similar to the following
=== Docker Compose Stats Snapshot ===
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O
32c84ac16774 prise-app-1 130.91% 328.4MiB / 9.704GiB 3.30% 16.7kB / 16.1kB
f0621088a4e9 prise-indexer-1 0.51% 215MiB / 9.704GiB 2.16% 24.6kB / 21kB
5d5b53bee447 prise-redis-1 0.09% 19.23MiB / 9.704GiB 0.19% 2.26kB / 126B
acaad51cd1aa prise-postgres-1 0.07% 89.8MiB / 9.704GiB 0.90% 35.9kB / 31.3kB
=== Health Checks ===
Checking Postgres...
localhost:5433 - accepting connections
✓ Postgres is ready
Checking Indexer (http://localhost:9108/metrics) ...
✓ Indexer is responding (HTTP 200)
Checking Prise App (http://localhost:8092/tokens/symbols) ...
✓ Prise App is responding (HTTP 200)
Checking Redis...
✓ Redis is ready
All checks passed successfully!
Now you will have API endpoints available for price data, e.g.
curl localhost:8092/prices/latest
{"date":"2025-08-14T04:10:38","assets":[{...}]}curl localhost:8092/tokens/pairs
[{"first":"25c5de5f5b286073c593edfd77b48abc7a48e5a4f3d4cd9d428ff93557414e","second":"ADA"},...}]The indexer will take some time to process the chain data though, you can check progress in the logs like so
docker compose logs indexer -fWhich will show progress similar to the following
indexer | INFO ChainService : Processed Block >> 12285130, 8cbb9cbcd8678ace348c9ad77b1fa82d26d8fcbb26419790251d82778bf62251, 164186491
And you can view API documentation locally at: http://localhost:8092/swagger-ui/index.html
cd indexer
./gradlew clean build -x testConfigure .env, we don't need to export since docker-compose handles this
cp .env.template .env
## Modify .env, in particular, database, cardano-node and API KeysBuild and run in docker
docker build -t edgxtech/prise-indexer .
docker compose up indexer -d
docker compose logs -fLogin as postgres root user
postgres=# CREATE DATABASE prise;
postgres=# CREATE USER prise WITH PASSWORD '<yours>';
postgres=# GRANT USAGE, CREATE ON SCHEMA public TO prise;
postgres=# GRANT ALL PRIVILEGES ON DATABASE prise TO prise;
cd indexer
./gradlew flywayMigrate## It is necessary to have JAVA_HOME env variable set for the indexer to run, othewise you may see a 'Java Directory not found' type of error
## On Linux Java home is likely in /usr/lib/jvm/, On MacOS likely in ~/Library/Java/JavaVirtualMachines/
## Also suggest adding this export to your terminal profile, e.g. one of; ~/.bashrc, ~/zprofile, ~/.bash_profile
export JAVA_HOME=<Your Java Install>cd indexer
./gradlew clean build -x testTo configure, either modify .env and export all environment variables
cp .env.template .env
## Modify .env, in particular, database, cardano-node and API Keys
set -a
source .env
set +aOr customise the prise.properties file
then run the indexer with
java -jar build/libs/indexer-0.1.0.jar -config prise.propertiesrun.mode=livesync|oneshot
latest.prices.livesync.update.interval.seconds=
start.metrics.server=true|false
metrics.server.port=
app.datasource.driver-class-name=
app.datasource.url=
app.datasource.username=
app.datasource.password=
token.metadata.service.module=tokenRegistry
chain.database.service.module=blockfrost|yacistore
cnode.address=
cnode.port=
start.point.time=
# selects specific logback config logack-$logEnv.xml
log.env=default|prod|dev
*see prise.properties for more detailed descriptions
| Component | Description |
|---|---|
| indexer | Core component which listens to blockchain, parses trade data, computes and persists latest and historical prices |
| webserver | Optional; simple Spring Boot webserver with latest price and historical price endpoints |
| Dependency | Description |
|---|---|
| Cardano-node | Access to a fully synced Cardano node instance, for best performance in terms of stability and sync speed, use a dedicated node on a local network. Tested with cardano-node v10.1.4 |
| Carp (Only if using Carp module) | Access to a fully synced Carp database. Carp is a general purpose modular Cardano indexer using Posgresql. This is required primarily to resolve utxo references. Other alternatives will work also, however will require custom implementation of the ChainDatabaseService interface |
| Yaci Store (Only if using Yaci Store module) | Access to a fully synced Yaci Store database. Yaci Store is a general purpose modular Cardano indexer using Posgresql or MySQL. This is required primarily to resolve utxo references. Other alternatives will work also, however will require custom implementation of the ChainDatabaseService interface |
| Module | Description | Implementations |
|---|---|---|
| ChainDatabaseService | Implementations provide an ability to resolve transaction output references (e.g. txHash#index) and searching for the nearest block to a given slot/time | |
| TokenMetadataService | Implementations provide the ability to resolve token decimals specifications for Cardano Native Tokens | Other implementations can be added as required |
Tested with Java 11
* Have noticed at least one issue using Java 20
due to an issue with the KoinTest Mocking framework
(Unsupported class file major version 64)
* Make sure Operating System is using a timezone without daylight savings. Otherwise will see odd weekly candles misaligned
e.g. timedatectl set-timezone Asia/Kuala_Lumpur
Contributions welcome
This project is made possible by Delegators to the AUSST Cardano Stakepool and supporters of Edgx R&D