orakl-config

Scripts

Setup

# create virtual env called venv
python3 -m venv venv

# activate the venv
source venv/bin/activate

# install packages
pip install -r requirements.txt

Simply run deactivate for deactivating the venv.

Generate Config Files

Automatically generates per-pair <PAIR>.json config files based on supported WebSocket APIs.

Parameters

python3 script/generate-configs.py --network mainnet --refresh true --symbols "NOT-USDT, PEOPLE-USDT"

Only pairs an exchange reports as trading are used (e.g. bingx status == 1, bitget status == "online", okx state == "live"). If a provider’s symbols API is unreachable or returns an HTTP error, it is skipped with a warning (its feeds are neither added nor, with --replace, removed) and the cache is marked stale so the next run retries. A changed response format aborts the run.

Tests (mocked API responses, no network): python3 -m unittest discover -s script

Collect Files

The following script will gather all adapter & aggregator configurations for mainnet and kairos, and generate <network>_feeds.json and <network>_mag7.json for each network. Paths resolve against the repo root; runs from any directory.

python script/collect-files.py           # rewrites all 4 bundles (whole-file cosmetic diff, see below)
python script/collect-files.py --check   # exit 1 if a bundle != its source dir; writes nothing

The committed bundles are not byte-reproducible (#236: different indent/key order); writing rewrites them with a cosmetic diff, so hand-edit bundles alongside config//mag7/ instead. CI (.github/workflows/bundles.yml) runs --check on every PR and push to master: it compares parsed JSON, matching entries by name (bundle entry order and key order are ignored; within an entry, values incl. types and feed order must match exactly) and lists missing/extra/differing pairs and feeds.

Generate README

README.md at the repo root is generated by generate-readme.py — do not edit it by hand. It contains a short intro (served bundles + layout), one table per network (## Mainnet, ## Kairos) for the config/<network>/ pairs (pair | sources | fetchInterval | aggregateInterval | submitInterval). sources lists each feed’s source once: the provider for wss feeds, otherwise the feed-name prefix before the first - (e.g. UniswapV3, Dragonswap, naver). Mag7 feeds are only referenced in the intro, not tabled. Malformed config files are skipped with a warning on stderr. Output is deterministic.

Stdlib only; runs from any directory.

python script/generate-readme.py           # rewrite README.md
python script/generate-readme.py --check   # exit 1 if README.md is stale
python script/generate-readme.py --stdout  # print instead of writing

CI (.github/workflows/readme.yml) runs it on every PR: for same-repo PRs it commits chore: regenerate README to the PR branch if the output changed, so master is current on merge. Fork PRs cannot be pushed to, so they run --check and fail if README.md is stale — run the script locally and commit the result. Manual workflow_dispatch runs also use --check.