API Reference
REST API for programmatic access to the Djinn protocol. All amounts are in plain USDC (not wei). All timestamps are ISO 8601.
Base URL: https://djinn.gg/api
Rate limit: 200 requests per minute per IP. Authenticated endpoints require a wallet signature session token.
Authentication
Endpoints marked with a lock icon require authentication. Connect your wallet and sign a challenge to receive a session token. Include it in the Authorization header.
// 1. Request a challenge
POST /api/auth/connect
{ "address": "0x68fc..." }
// 2. Sign and verify
POST /api/auth/verify
{ "address": "0x68fc...", "signature": "0x..." }
// 3. Use the session token
GET /api/genius/signals
Authorization: Bearer djn_...Genius Endpoints
/api/genius/signal/commitAuthSubmit an encrypted signal and distribute Shamir shares to validators. The SDK handles encryption, decoy generation, and Shamir splitting locally. The API only sees ciphertext. Use GET /api/network/config to get validator keys first.
Parameters
encrypted_blobstringrequiredHex-encoded encrypted signal blobcommit_hashstringrequiredKeccak256 hash of the blobsharesobject[]requiredPer-validator Shamir key and index sharescommit_tx_hashstringrequiredOn-chain commit transaction hashevent_idstringrequiredThe Odds API event ID (public metadata)Response
{
"signal_id": "0xa3f...",
"status": "active",
"validators_received": 4,
"validators_total": 4
}/api/genius/signalsAuthList all signals for the authenticated genius.
Parameters
statusstringFilter: active, expired, cancelled, settledsportstringFilter by sport keylimitintegerMax results (default 20)offsetintegerPagination offsetResponse
{
"signals": [
{
"signal_id": "0xa3f...",
"sport": "basketball_nba",
"status": "active",
"created_at": "2026-03-27T18:00:00Z",
"expires_at": "2026-03-28T00:00:00Z",
"purchases": 3,
"total_notional": 750,
"fees_earned": 37.50
}
],
"total": 1
}/api/genius/signal/{signal_id}AuthCancel an active signal. Refunds unreleased escrow to buyers.
Response
{
"signal_id": "0xa3f...",
"status": "cancelled",
"cancel_tx_hash": "0x..."
}/api/genius/earningsAuthSummary of fees earned, collateral status, and settlement history.
Response
{
"total_fees_earned_usdc": 1250.00,
"claimable_fees_usdc": 375.00,
"collateral_deposited_usdc": 8000.00,
"collateral_locked_usdc": 3500.00,
"quality_score_30d": 0.72,
"signals_settled": 14,
"signals_active": 3
}/api/genius/claimAuthClaim all available fees (subject to 48-hour post-settlement delay).
Response
{
"claimed_usdc": 375.00,
"claim_tx_hash": "0x...",
"next_claimable_at": "2026-03-29T14:00:00Z"
}Idiot Endpoints
/api/idiot/browseBrowse available signals with filtering and sorting.
Parameters
sportstringFilter by sport keygeniusstringFilter by genius addressmin_quality_scorenumberMinimum genius quality score (0-1)max_fee_bpsintegerMaximum fee in basis pointssortstringSort: quality_score, fee, expires_soon, notional_remaininglimitintegerMax results (default 20)Response
{
"signals": [
{
"signal_id": "0xa3f...",
"genius": "0x68fc...",
"sport": "basketball_nba",
"fee_bps": 500,
"sla_multiplier_bps": 15000,
"notional_remaining_usdc": 250,
"genius_quality_score_30d": 0.72,
"genius_win_rate": 0.64
}
]
}/api/idiot/genius/{address}/profileView a genius's public track record and performance history.
Response
{
"address": "0x68fc...",
"quality_score_30d": 0.72,
"total_signals": 47,
"settled_signals": 44,
"win_rate": 0.64,
"sports": ["basketball_nba", "americanfootball_nfl"],
"recent_settlements": [
{
"batch": 5,
"quality_score": 1250,
"favorable": 7,
"unfavorable": 2,
"void": 1
}
]
}/api/idiot/purchaseAuthPurchase a signal. Triggers MPC availability check, escrow debit, and encrypted key share release. The real pick must be available at a sportsbook.
Parameters
signal_idstringrequiredThe signal ID to purchasenotional_usdcnumberrequiredAmount in USDC to commitodds_decimalnumberDecimal odds (e.g. 1.91). Defaults to 2.0 if omittedResponse
{
"purchase_id": 42,
"signal_id": "0xa3f...",
"available": true,
"sportsbooks": ["DraftKings", "FanDuel"],
"encrypted_key_shares": ["0x...", "0x..."],
"purchase_tx_hash": "0x..."
}/api/idiot/purchasesAuthList all purchases with outcomes.
Parameters
statusstringFilter: pending, settled, voidlimitintegerMax results (default 20)Response
{
"purchases": [
{
"purchase_id": 42,
"signal_id": "0xa3f...",
"genius": "0x68fc...",
"notional_usdc": 200,
"outcome": "favorable",
"settled_at": "2026-03-28T06:00:00Z"
}
]
}/api/idiot/balanceAuthEscrow balance, locked funds, and transaction history.
Response
{
"escrow_balance_usdc": 2500.00,
"locked_in_purchases_usdc": 400.00,
"available_usdc": 2100.00,
"net_pnl_usdc": 340.00
}Public Endpoints
/api/network/configValidator public keys, Shamir parameters, and contract addresses needed by the SDK. Cached; doesn't change per signal.
Response
{
"validators": [
{ "uid": 2, "pubkey": "0x...", "endpoint": "..." },
{ "uid": 41, "pubkey": "0x...", "endpoint": "..." }
],
"chain_id": 8453,
"signal_commitment_address": "0x4712...",
"shamir_n": 10,
"shamir_k": 3
}/api/oddsCurrent odds from The Odds API. No authentication required.
Parameters
sportstringrequiredSport key (e.g., basketball_nba)/api/sportsList all supported sports with their keys.
/api/network/statusNetwork health: active validators, miner count, attestation rate.
/api/settlement/{genius}/{idiot}/statusSettlement status for a genius-idiot pair.
Response
{
"contract_version": 2,
"total_purchases": 12,
"resolved_count": 8,
"audited_count": 0,
"audit_batch_count": 0,
"ready_for_settlement": false
}https://v{uid}.djinn.gg/healthDirect validator health endpoint via the wildcard router. Self-advertises public_hostname and a list of peer validators for gossip-style discovery. Replace {uid} with any UID currently in the metagraph.
Response
{
"status": "ok",
"version": "1095+18",
"uid": 0,
"shares_held": 1238,
"pending_outcomes": 14,
"chain_connected": true,
"bt_connected": true,
"attest_capable": true,
"public_hostname": "v0.djinn.gg",
"peers": [{"uid": 1, "ip": "...", "port": 8421}]
}https://v{uid}.djinn.gg/v1/network/validatorsDirect validator listing from one validator's metagraph view. Used by the static IPFS-deployable client to discover the network without bouncing through a centralized proxy.
Response
{
"validators": [{"uid": 0, "ip": "...", "port": 8421, "hotkey": "5..."}],
"served_by_uid": 0,
"validator_count": 7,
"served_at_ms": 1775941616000
}https://v{uid}.djinn.gg/v1/odds/canonicalCanonical-schema odds for a sport+market, miner-driven. Replaces the legacy /api/odds Vercel proxy. Currently in bridge mode behind the canonical_odds feature flag.
Parameters
sportstringrequiredCanonical sport key (nba, nfl, mlb, ...)marketstringrequiredmoneyline, spread, or totalbookmakersstring[]Optional bookmaker filter (e.g. ["DRAFTKINGS", "FANDUEL"])event_idstringOptional event filterResponse
{
"sport": "nba",
"market": "moneyline",
"observations": [],
"miner_count": 0,
"served_at_ms": 1775941616000,
"feature_flag_enabled": false
}https://v{uid}.djinn.gg/v1/cb/status/{hotkey}Consensus circuit breaker status for a miner hotkey. Public so miners can self-monitor whether they're at risk of being flagged for sustained deviation from validator consensus.
Response
{
"hotkey": "5Aa...",
"score": 1.234,
"sample_count": 543,
"flagged": false,
"flagged_at": 0.0,
"last_disputes": [],
"threshold": 5.0
}https://v{uid}.djinn.gg/v1/cb/appealSubmit an appeal to clear a circuit-breaker flag. Currently runs in honor-system mode behind the appeal_mechanism feature flag. Real TLSNotary verification lands in a follow-up.
Parameters
hotkeystringrequiredMiner hotkey to appealdeclared_sourcestringrequiredURL of the upstream the miner claims to source fromdisputed_query_idsstring[]requiredRecent disputed query IDs from /v1/cb/statustlsnotary_proofstringTLSNotary proof of the declared source (TBD verifier)Response
{
"hotkey": "5Aa...",
"verdict": "honor_system_accepted",
"cleared": true,
"new_score": 0.0,
"verification_mode": "honor_system",
"message": "..."
}Client-side encryption
The Genius signal creation flow requires client-side encryption. The API never sees plaintext picks. Use the Djinn SDK to handle encryption, decoy generation, and Shamir splitting locally before calling the /api/genius/signal/commit endpoint.