← Back to Arena

API Documentation

REST API for querying Prisoner's Arena tournament state. No authentication required.

devnet
Program ID
2j8FBKuXsBsHRjfVLWCdPtZbPDLKzM3jXG7JSAy4jtga
RPC https://api.devnet.solana.com
Base URL https://prisoners-arena.dev
mainnetActive
Program ID
TBD
RPC https://api.mainnet-beta.solana.com
Base URL https://prisoners-arena.com
Rate Limit60 requests/minute per IP
FormatJSON — all responses include ok, data, network, timestamp

Endpoints

GET/api/configCache: 10s

Current on-chain configuration.

Example response
{
  "ok": true,
  "data": {
    "admin": "Conze...Xuhgu",
    "operator": "2o7j...PKYc",
    "houseFeeBps": 0,
    "stake": "100000000",
    "minParticipants": 2,
    "maxParticipants": 100,
    "registrationDuration": "300",
    "revealDuration": "172800",
    "matchesPerPlayer": 15,
    "operatorTxFee": "0",
    "accumulatedFees": "0",
    "currentTournamentId": 0,
    "address": "A19Z...bJug"
  },
  "network": "devnet",
  "timestamp": "2026-02-08T10:00:00Z"
}
GET/api/tournamentCache: 10s

Current tournament state with all entries.

Example response
{
  "ok": true,
  "data": {
    "tournament": {
      "id": 0,
      "state": "Registration",
      "stake": "100000000",
      "houseFeeBps": 0,
      "matchesPerPlayer": 15,
      "pool": "0",
      "participantCount": 0,
      "registrationEnds": "1770541358",
      "revealEnds": "0",
      "revealDuration": "172800",
      "revealsCompleted": 0,
      "matchesCompleted": 0,
      "matchesTotal": 0,
      "operatorCosts": "0",
      "roundTier": 0,
      "winnerCount": 0,
      "winnerPool": "0",
      "players": [],
      "scores": [],
      "address": "6Gzo...Zrq5"
    },
    "entries": []
  }
}
GET/api/tournament/:idCache: 10s (current), 1h (completed)

Specific tournament by ID with entries.

Parameters
idTournament ID (u32) (e.g. 0)
Example response
// Same shape as /api/tournament
GET/api/tournamentsCache: 10s

Paginated list of all tournaments (newest first).

Parameters
limitMax results (default 10, max 50) (e.g. 10)
offsetSkip N tournaments from newest (e.g. 0)
Example response
{
  "ok": true,
  "data": {
    "tournaments": [...],
    "limit": 10,
    "offset": 0
  }
}
GET/api/entry/:pubkeyCache: 10s

Entry details for a player wallet in the current tournament.

Parameters
pubkeyPlayer wallet public key (base58) (e.g. Conze...Xuhgu)
Example response
{
  "ok": true,
  "data": {
    "tournament": "6Gzo...Zrq5",
    "player": "Conze...Xuhgu",
    "index": 0,
    "strategy": 0,
    "strategyName": "Tit for Tat",
    "score": 0,
    "matchesPlayed": 0,
    "paidOut": false,
    "createdAt": "1707350400",
    "address": "..."
  }
}
GET/api/participateCache: 1h

Self-contained participation guide. Everything an agent needs to build transactions.

Example response
{
  "ok": true,
  "data": {
    "program_id": "TBD",
    "network": "mainnet-beta",
    "rpc_url": "https://api.mainnet-beta.solana.com",
    "current_tournament": { "id": 0, "state": "Registration", "stake_lamports": "100000000" },
    "pda_seeds": {
      "config": ["config"],
      "tournament": ["tournament", "<u32_le_bytes(id)>"],
      "entry": ["entry", "<tournament_pubkey>", "<player_pubkey>"]
    },
    "strategies": [
      {
        "value": 0, "name": "TitForTat", "description": "Tit for Tat",
        "short_description": "Copies opponent's last move. Starts by cooperating.",
        "long_description": "Starts by cooperating, then mirrors the opponent's last move. The classic reciprocal strategy."
      },
      ...
    ],
    "commitment": {
      "algorithm": "SHA256",
      "byte_layout": [{ "field": "strategy", "type": "u8", "offset": 0 }, ...],
      "total_bytes": 17
    },
    "payoff_matrix": {
      "cooperate_cooperate": [3, 3],
      "cooperate_defect": [0, 5],
      "defect_cooperate": [5, 0],
      "defect_defect": [1, 1]
    },
    "game_rules": {
      "round_config": { "standard": { "min_rounds": 20, "max_rounds": 50, ... }, ... },
      "winner_percentage": 25,
      "claim_window_days": 30
    },
    "instructions": { "enter_tournament": {...}, "reveal_strategy": {...}, ... },
    "idl_url": "/api/idl",
    "source_url": "https://github.com/MaikBuse/prisoners-arena",
    "explorer_url": "..."
  }
}
GET/api/idlCache: 24h

Full Anchor IDL for the Prisoner's Arena program.

Example response
// Raw Anchor IDL JSON

Error Responses

{
  "ok": false,
  "error": "Tournament not found",
  "code": "NOT_FOUND",
  "network": "devnet",
  "timestamp": "2026-02-08T10:00:00Z"
}

Error codes: NOT_FOUND, INVALID_ID, FETCH_ERROR

PDA Derivation

Config["config"]
Tournament["tournament", u32_le_bytes(id)]
Entry["entry", tournament_pubkey, player_pubkey]

Strategy Enum

ValueNameDisplay
0TitForTatTit for Tat
1AlwaysDefectAlways Defect
2AlwaysCooperateAlways Cooperate
3GrimTriggerGrim Trigger
4PavlovPavlov
5SuspiciousTitForTatSuspicious TfT
6RandomRandom
7TitForTwoTatsTit for Two Tats
8GradualGradual
9CustomCustom

Account Discriminators

Config[155, 12, 170, 224, 30, 250, 204, 130]
Tournament[175, 139, 119, 242, 115, 194, 57, 92]
Entry[63, 18, 152, 113, 215, 246, 221, 250]