Documentation Index Fetch the complete documentation index at: https://docs.generalmarket.io/llms.txt
Use this file to discover all available pages before exploring further.
Infrastructure Endpoints
The plumbing. Contract addresses, health checks, testnet faucet, market history, and the catch-all proxy. Not glamorous. Essential.
+------------------------------------------------------------------+
| Infrastructure Routes |
+------------------------------------------------------------------+
| |
| /api/deployment ------> reads JSON from server filesystem |
| |
| /api/explorer/health -> Data Node /explorer/health/{endpoint} |
| (injects EXPLORER_TOKEN server-side) |
| |
| /api/market/history --> Data Node /market/prices/{source}/{id} |
| |
| /api/faucet ----------> L3 RPC (mint USDC) |
| +----> Settlement RPC (drip gas) |
| |
| /api/dn/{...path} ---> Data Node /{path} (catch-all, SSE ok) |
| |
+------------------------------------------------------------------+
Get Deployment Config
Where the contracts live. The frontend reads this at runtime to know which addresses to call.
GET /api/deployment?file={filename}
Deployment file name. Must be one of:
active-deployment.json
morpho-e2e.json
local-e2e.json
local-frontend.json
curl "https://generalmarket.io/api/deployment?file=active-deployment.json"
{
"chainId" : 111222333 ,
"contracts" : {
"Index" : "0x1234...abcd" ,
"L3_WUSDC" : "0xabcd...1234" ,
"VisionReserve" : "0x5678...ef00" ,
"OracleRegistry" : "0xef00...5678"
}
}
Resolution path:
1. Try ../deployments/{file} (local dev: monorepo root)
2. Fall public/deployment.json (Vercel prod, active-deployment.json only)
3. 404 if both fail
Status Meaning 200File found, JSON returned 400Invalid or missing file parameter 404Deployment file not found on server
Get Explorer Health
Consensus metrics, peer counts, order throughput. The pulse of the system. Token-authenticated, but the proxy handles that for you.
GET /api/explorer/health?endpoint={endpoint}&range={range}
One of history or latest. Default: history.
Time range for history. One of: 1h, 6h, 24h, 7d, 30d. Default: 24h.
# Latest health snapshot
curl "https://generalmarket.io/api/explorer/health?endpoint=latest"
# Health history over 7 days
curl "https://generalmarket.io/api/explorer/health?endpoint=history&range=7d"
Show Response (endpoint=latest)
{
"network" : {
"poll_batch_ts" : "2026-03-14T12:00:00Z" ,
"quorum_met" : true ,
"worst_status" : "healthy" ,
"consensus_rounds_total" : 1542 ,
"consensus_success_total" : 1538 ,
"consensus_failed_total" : 4 ,
"signatures_collected" : 3 ,
"avg_consensus_time_ms" : 245 ,
"avg_cycle_duration_ms" : 5012 ,
"orders_processed_last_60s" : 12 ,
"pending_order_count" : 0 ,
"total_peers" : 3 ,
"p2p_messages_received" : 48210 ,
"p2p_messages_sent" : 48195 ,
"total_peers_healthy" : 3 ,
"total_peers_unhealthy" : 0
}
}
Show Response (endpoint=history)
{
"snapshots" : [
{
"poll_batch_ts" : "2026-03-14T11:55:00Z" ,
"quorum_met" : true ,
"worst_status" : "healthy" ,
"consensus_rounds_total" : 1540 ,
"consensus_success_total" : 1536 ,
"consensus_failed_total" : 4 ,
"total_peers" : 3 ,
"total_peers_healthy" : 3 ,
"total_peers_unhealthy" : 0
}
]
}
Whitelisted response fields (all other fields are stripped server-side):
poll_batch_ts Timestamp of the health poll
quorum_met Whether BLS quorum was achieved
worst_status Worst status across all oracles
consensus_rounds_total Total consensus rounds attempted
consensus_success_total Rounds that reached quorum
consensus_failed_total Rounds that failed quorum
signatures_collected BLS signatures in latest round
avg_consensus_time_ms Average consensus latency
avg_cycle_duration_ms Average full cycle time
orders_processed_last_60s Recent order throughput
pending_order_count Orders waiting for processing
total_peers Number of oracle peers
p2p_messages_received P2P messages received
p2p_messages_sent P2P messages sent
total_peers_healthy Peers reporting healthy
total_peers_unhealthy Peers reporting unhealthy
Status Meaning 200Health data returned 400Invalid endpoint or range parameter 502Data-node upstream unavailable 503EXPLORER_TOKEN not configured on server
Get Market Price History
Historical prices for a specific source and asset. The raw material for charts and analysis.
GET /api/market/history?source={source}&asset={assetId}&from={ts}&to={ts}
Data source identifier (e.g., earthquake, crypto, weather).
Asset identifier within the source (e.g., USGS/us7000abc1, BTC).
Start timestamp (Unix seconds). Optional.
End timestamp (Unix seconds). Optional.
curl "https://generalmarket.io/api/market/history?source=crypto&asset=BTC&from=1708000000&to=1708600000"
{
"prices" : [
{ "timestamp" : 1708000000 , "value" : 97100.50 },
{ "timestamp" : 1708003600 , "value" : 97250.80 },
{ "timestamp" : 1708007200 , "value" : 97432.15 }
]
}
Status Meaning 200Price history returned 400Missing source or asset parameter 502Data-node upstream unavailable
Responses are cached at the CDN for 60 seconds with a 5-minute stale-while-revalidate window.
Testnet Faucet
Free money. Testnet only. Mints USDC on L3 and optionally drips gas on Settlement.
Recipient wallet address (checksummed hex, 0x...).
USDC amount to mint. Default: 100. Maximum: 10000.
When true, also sends 0.5 S (Sonic testnet native token) for settlement gas. Default: false.
curl -X POST "https://generalmarket.io/api/faucet" \
-H "Content-Type: application/json" \
-d '{"address": "0xYourAddress", "amount": "1000", "gas": true}'
{
"success" : true ,
"to" : "0xYourAddress" ,
"usdc" : {
"hash" : "0xabc123...def" ,
"amount" : "1000 USDC"
},
"gas" : {
"hash" : "0x789ghi...jkl" ,
"amount" : "0.5 S"
}
}
Faucet flow:
1. Validate address format (0x + 40 hex chars)
2. Clamp amount to [0, 10000]
3. Call L3_WUSDC.mint(address, amount * 1e18) on L3 chain
4. Wait for L3 tx receipt
5. If gas=true:
a. Check deployer balance on Settlement chain
b. If sufficient, send 0.5 S to address
c. Wait for Settlement tx receipt
6. Return tx hashes
Status Meaning 200Mint successful (check individual usdc and gas fields) 400Invalid address format or amount 500Transaction failed
L3 USDC uses 18 decimals (not 6). The faucet handles this conversion internally. The amount parameter is in human-readable USDC (e.g., "1000" = 1000 USDC).
Data Node Proxy (Catch-All)
Everything that does not have its own route goes through here. Transparent pass-through to the data node, with SSE streaming support.
Everything after /api/dn/ is forwarded to the data node, with all query parameters intact.
Browser request Upstream request
--------------------------------- -----------------------------------
/api/dn/sim/run-stream?top_n=10 DATA_NODE:8200/sim/run-stream?top_n=10
/api/dn/sim/categories DATA_NODE:8200/sim/categories
/api/dn/portfolio?address=0x... DATA_NODE:8200/portfolio?address=0x...
/api/dn/snapshot?itp_id=0x... DATA_NODE:8200/snapshot?itp_id=0x...
SSE streaming support:
Regular JSON response:
Browser --GET--> /api/dn/sim/categories
Proxy --GET--> DATA_NODE:8200/sim/categories
Proxy <--200-- { "categories": [...] }
Browser <--200-- { "categories": [...] }
SSE streaming response (backtest progress):
Browser --GET--> /api/dn/sim/run-stream?...
Proxy --GET--> DATA_NODE:8200/sim/run-stream?...
Proxy <--200-- Content-Type: text/event-stream
Browser <--200-- data: {"type":"progress","pct":10}
data: {"type":"progress","pct":50}
data: {"type":"progress","pct":100}
data: {"type":"result","stats":{...}}
Behaviors:
5-minute timeout for long-running simulations
SSE pass-through with X-Accel-Buffering: no to bypass nginx buffering
No caching at the proxy layer
502 on failure when the data node is unreachable
Status Meaning 200Upstream response forwarded successfully 502Data-node unreachable or timed out Other Upstream HTTP status forwarded as-is