Documentation
Everything you need to connect, stream, and integrate Aleatoric data feeds into your trading infrastructure. Most teams are streaming within 15 minutes.
Quickstart
1. Get an API Key
Sign up at get-started and create an API key from your dashboard. Keys are scoped by service and region.
2. Authenticate
# All requests require the x-api-key header
curl -H "x-api-key: ak_your_key" \
https://rpc.aleatoric.systems/health 3. First Request
# JSON-RPC: query a balance
curl -X POST https://rpc.aleatoric.systems \
-H "x-api-key: ak_your_key" \
-H "Content-Type: application/json" \
-d '{jsonrpc":"2.0","method":"eth_getBalance","params":["0x...","latest"],"id":1}' 4. First Stream
# gRPC stream: real-time mid prices
grpcurl -H "x-api-key: ak_your_key" \
hl.grpc.aleatoric.systems:443 \
hyperliquid.StreamMids Integration Paths
Python SDK
pip install, connect, and stream in 3 lines.
TypeScript SDK
npm install, typed events, async iterators.
gRPC Examples
Protocol Buffers, streaming RPCs, raw performance.
WebSocket Examples
Unified Stream, disk-sync, reconnection patterns.
Signal Streams
Pre-classified market signals via gRPC or WS.
Historical Queries
Block replay, liquidation archives, event queries.
Getting Started
Benchmark Endpoint
Run a latency test from your infrastructure to confirm performance meets your requirements.
Connect to Stream
Use the SDK or raw gRPC/WS to subscribe to your first data feed. Auth with your API key.
Parse Signal
Events arrive pre-decoded and typed. Map signal fields to your strategy's input format.
Move to Production
Upgrade to Pro for production throughput, both regions, and Signal Radar access.
Code Examples
from aleatoric import Client
client = Client(api_key="ak_your_key")
# Stream real-time mid prices
async for event in client.stream("BTC"):
print(f"BTC mid: {event.mid} at {event.timestamp}")
# Query L2 book
book = await client.l2_book("ETH", depth=5)
print(f"Best bid: {book.bids[0].price}") import { Aleatoric } from '@aleatoric/sdk'
const client = new Aleatoric('ak_your_key')
// Stream real-time mid prices
for await (const event of client.stream('BTC')) {
console.log(`BTC mid: ${event.mid} at ${event.timestamp}`)
}
// Query L2 book
const book = await client.l2Book('ETH', { depth: 5 })
console.log(`Best bid: ${book.bids[0].price}`) # Stream mid prices via gRPC
grpcurl -H "x-api-key: ak_your_key" \
hl.grpc.aleatoric.systems:443 \
hyperliquid.StreamMids
# Get L2 book snapshot
grpcurl -H "x-api-key: ak_your_key" \
-d '{coin":"BTC","depth":5}' \
hl.grpc.aleatoric.systems:443 \
hyperliquid.GetL2Book // WebSocket connection
const ws = new WebSocket('wss://unified.grpc.aleatoric.systems')
ws.onopen = () => {
ws.send(JSON.stringify({
type: 'subscribe',
channel: 'trades',
coin: 'BTC',
apiKey: 'ak_your_key'
}))
}
ws.onmessage = (event) => {
const data = JSON.parse(event.data)
console.log('Trade:', data)
}