Stage 1

Data: divers fetch

divers fetch builds a compact dataset from the Onchain Divers indexer's ClickHouse: only the ecosystems, tables, columns and days you need. divers datasets lists, extends and deletes finished datasets.

Stage
Data
Command or package
divers fetch, divers datasets
Indexer
required
State
with caveats Works against the live development ClickHouse of the indexer (one host): check-catalog passes, small datasets of all three ecosystems matched independent server counts row for row, a killed download resumed byte-identical. The catalog (1.1.0) is the real schema of host 1; other production hosts were not available.

What it is

A dataset is a folder of parquet files per day plus a manifest: what was requested, what is already downloaded, checksums, column groups, the verification flag. The fetcher knows the semantics of the indexer's tables; it is not a generic database client.

Dataset layout
<dataset>/manifest.json
<dataset>/<ecosystem>/<entity>/date=YYYY-MM-DD/*.parquet

The ecosystems are pump, raydium and meteora; each has a launchpad, AMMs, migrations, trades, liquidity events and token creation. Which ClickHouse host holds a table is decided by the table catalog, not by the user.

What it gives traders and quants

  • Related records. Trades of a token come with its creation parameters, migrations and the pool's liquidity events, including those from days outside the selected range. Each record goes into the folder of its entity and its date.
  • Column groups. "backtest required" and "validation required", one flag per group: every column the backtest or the validator cannot work without is selected (pool reserves, tx_timestamp, event keys, fees). The groups are written to the manifest.
  • Resume. A day is downloaded in slices (--slices-per-day, 24 by default); each slice is an atomically written parquet file. After an interruption divers fetch resume continues from the first unfinished slice, with no duplicates and no gaps.
  • Extend. Dates, tables and columns are added to a dataset without downloading what is already there.
  • Normalisation. Deduplication by the table key (slot + tx idx + ix idx for events), times in UTC, FixedString without padding \0.
  • TUI and flags. A creation wizard and a dataset dashboard in the terminal; everything is also available as flags, and --json prints one JSON document.

How to run

The .onchaindivers file (values are placeholders)
[hosts.1]
url = "https://clickhouse-1.example.com:8443"
login = "YOUR_LOGIN"
password = "YOUR_PASSWORD"

Credentials: the .onchaindivers file (current folder, any folder above it, home) or the variables DIVERS_HOST_{1..8}_{URL,LOGIN,PASSWORD}, which take precedence over the file.

Fetcher commands
divers fetch list                       # ecosystems, tables, columns, groups
divers fetch create pump-jan --ecosystem pump --backtest-required \
    --from 2024-01-01 --to 2024-01-07 --amm-mode launchpad-only
divers fetch resume pump-jan            # after an interruption
divers datasets                         # list: status, verified, size, dates
divers datasets show pump-jan
divers datasets extend pump-jan --to 2024-01-14
divers datasets delete pump-jan --yes
divers fetch check-catalog              # the catalog against system.columns on every host

divers fetch without a subcommand opens the wizard in the terminal; the review screen shows the equivalent divers fetch create … command. The data folder is ~/.local/share/onchaindiversdata by default, otherwise --data-dir, DIVERS_DATA_DIR or data_dir in the file.

Limitations

  • One host checked. The catalog (1.1.0) is the real schema of database default on the development host; other production hosts were not available. divers fetch check-catalog compares the catalog with every configured host.
  • Concentrated-liquidity pools (Raydium CLMM, Meteora DLMM) are not downloaded.
  • Access to the Onchain Divers indexer's ClickHouse is required: an address, a login and a password for every host.
  • Windows is not supported yet.

Place in the chain

Input
The Onchain Divers indexer's ClickHouse.
Output
A dataset on disk, for validation and the backtest.