Power your apps & AI agents with real-time token data.
- Provide a formal, machine-readable contract for all REST endpoints, including request and response models.
- Serve as a basis for automated documentation and client/server code generation.
- Capture everything from parameter schemas to response structures to ensure consistency across different implementations.
- Represent raw, parameterized queries that can be directly executed within a ClickHouse environment.
- Provide an unambiguous means of data manipulation and retrieval, enabling straightforward operational transparency (e.g., paste into a ClickHouse client for immediate testing).
- Hosts the service logic while embedding the relevant SQL statements to orchestrate data queries.
- Ensures that each database operation is correctly contextualized, allowing consistent use across various application layers or microservices.
- Expose each SQL operation via HTTP endpoints, encapsulating user inputs and query parameters into well-defined APIs.
- Streamline external access to database functionality by abstracting the underlying SQL implementation from the client.
- Accommodates immediate adjustments or patches where Substreams data is incomplete or erroneous.
- Allows custom logic to amend, replace, or enrich dataset records before they are processed or stored, ensuring robust data integrity despite upstream issues.
flowchart LR
S1[EVM Tokens.spkg] --> Sink{Substreams SQL Sink}
S2[SVM Tokens.spkg] --> Sink
S3[Antelope Tokens.spkg] --> Sink
Sink --> Clickhouse
Clickhouse((Clickhouse)) --> Server{MCP Server}
Clickhouse --> API{Token API}
- Balances
- Holders
- Tokens
- Transfers
- OHLC
- Prices
- EVM (Ethereum, Base, Arbitrum, BSC, etc.)
- SVN (Solana)
- Antelope (Vaulta, WAX, Telos, Ultra)
Install Bun
bun install
bun dev
Tests
bun lint
bun test
# API Server
PORT=8000
HOSTNAME=localhost
IDLE_TIMEOUT=60
# MCP Server
SSE_PORT=8080
SSE_ENDPOINT=sse
# Clickhouse Database
URL=http://127.0.0.1:8123
DATABASE=default
USERNAME=default
PASSWORD=
MCP_USERNAME=default
MCP_PASSWORD=
MAX_LIMIT=10000
NETWORKS=mainnet,bsc,base,optimism,arbitrum-one
DB_EVM_SUFFIX=evm-tokens@v1.9.0:db_out
DB_SVM_SUFFIX=svm-tokens@v1.0.0:db_out
DB_ANTELOPE_SUFFIX=antelope-tokens@v1.0.0:db_out
# OpenAPI
DISABLE_OPENAPI_SERVERS=false
# Logging
PRETTY_LOGGING=true
VERBOSE=true
- Pull from GitHub Container registry
For latest tagged release
docker pull ghcr.io/pinax-network/token-api:latest
For head of main
branch
docker pull ghcr.io/pinax-network/token-api:develop
- Build from source
docker build -t token-api .
- Run with
.env
file
docker run -it --rm --env-file .env -p 8000:8000 ghcr.io/pinax-network/token-api:develop
See CONTRIBUTING.md
.