⚠️ Deprecated — superseded by verusapi_v4, which produces byte-identical output with ~7× less RPC load. This repo is kept for reference only; new deployments should run v4. The longer-term plan is for the explorer's market-worker (in scan-verus-cx) to absorb both.
Python/FastAPI service that aggregates Verus DEX trading-pair data from a local verusd and serves it in CoinGecko / CoinMarketCap / Coinpaprika formats for volume-aggregator ingestion.
- What you get
- What you provide
- Quick start
- API endpoints
- Response formats
- Configuration
- Operating in production
- Migrating to v4
- License
- Disclaimer
- Trading-pair ticker data for the Verus DEX (VRSC + PBaaS chains) in three aggregator formats
- 60-second cached endpoints (~50 ms response) + optional live debug endpoints
- Volume-weighted price aggregation across multiple converters trading the same pair
- ERC20 symbol mapping for cross-chain compatibility
- Python 3.8+
- A running local
verusd(withtxindex/addressindexenabled for the chains you index) - RPC credentials for that daemon (read from your
.env)
git clone https://github.com/Fried333/verusapi_v3.git
cd verusapi_v3
pip install fastapi uvicorn requests python-dotenv
cp env_format .env
$EDITOR .env # fill RPC creds
python3 main.py
# → http://localhost:8765Sanity check:
curl http://localhost:8765/health
curl http://localhost:8765/coingecko | head -c 200| Endpoint | Description |
|---|---|
GET /health |
RPC connection, cache status, block heights |
GET /verussupply |
VRSC supply info |
GET /stats |
CoinGecko format rendered as HTML with USD volume |
| Endpoint | Format |
|---|---|
GET /coingecko |
CoinGecko |
GET /coinmarketcap |
CoinMarketCap |
GET /coinpaprika |
Coinpaprika |
GET /coinmarketcap_iaddress |
CMC format with Verus i-address identifiers |
Set ENABLE_LIVE_ENDPOINTS=true in .env to enable. Each makes fresh RPC calls — slower (~2-5 s) but reflects current chain state.
| Endpoint |
|---|
GET /coingecko_live |
GET /coinmarketcap_live |
GET /coinpaprika_live |
GET /coinmarketcap_iaddress_live |
[
{
"ticker_id": "VRSC_DAI.vETH",
"pool_id": "iH37kRsdfoHtHK5TottP1Yfq8hBSHz9btw",
"base_currency": "VRSC",
"target_currency": "DAI.vETH",
"last_price": "2.15310337",
"base_volume": "1234.56789",
"target_volume": "2658.91234"
}
]{
"0": {
"base_name": "VRSC",
"base_symbol": "VRSC",
"quote_name": "DAI.vETH",
"quote_symbol": "DAI.vETH",
"last_price": "2.15310337",
"base_volume": "1234.56789",
"quote_volume": "2658.91234"
}
}{
"code": "200000",
"data": {
"time": 1756195613998,
"ticker": [
{ "symbol": "VRSC-DAI.vETH", "last": "2.15310337", "volume": "1234.56789", "high": "2.20000000", "low": "2.10000000", "open": "2.18000000" }
]
}
}# VRSC RPC connection
VERUS_RPC_HOST=127.0.0.1
VERUS_RPC_PORT=27486
VERUS_RPC_USER=your_rpc_user
VERUS_RPC_PASSWORD=your_rpc_password
# Live endpoints off by default (CPU-heavy — only enable for dev)
ENABLE_LIVE_ENDPOINTS=falseAdd per-chain RPC blocks for PBaaS (vDEX, vARRR, CHIPS) using the same naming pattern — see env_format in the repo.
Multiple converters trading the same pair contribute to one price via quote-volume weighting:
weighted_price = (price1 × quote_vol1 + price2 × quote_vol2) / (quote_vol1 + quote_vol2)
Stablecoins (DAI, vUSDC, vUSDT) are hardcoded at $1.00.
stdout/stderr from python3 main.py. Hostile under load — v3 emits ~9,600 log lines per 60-s refresh cycle. Recommend v4 if you care about log volume.
| Symptom | Likely cause |
|---|---|
/health shows RPC disconnected |
wrong VERUS_RPC_* creds, daemon not running, or wrong port |
| Cached endpoints return empty / 500 | converter discovery failed — check daemon is fully synced and has DEX baskets |
| Stale data past 60 s TTL | background refresh hung on a slow RPC; restart resolves |
v4 is a drop-in replacement with the same port + endpoints + output. git clone github.com/Fried333/verusapi_v4, copy your .env, switch the systemd unit. See Migrating to v4.
v4's behaviour is intentionally byte-identical to v3 (validated 2026-03-11). The only difference is efficiency:
| Metric | v3 | v4 |
|---|---|---|
| Cached response time | ~280 ms | ~21 ms |
| RPC calls / 60-s cycle | ~286 | ~40 |
| Log lines / cycle | ~9,600 | ~360 |
Switching:
- Clone v4 alongside v3
- Copy
.envover (same shape) - Stop v3's systemd unit, point
ExecStartat v4'smain.py - Start;
curl /healthto confirm
MIT — see LICENSE if present, or the standard MIT terms.
This software is provided "AS IS", without warranty of any kind, express or implied. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability arising from the use of this software. Run your own review before relying on it for production volume-aggregator reporting.