{
    "schemes": [
        "https"
    ],
    "swagger": "2.0",
    "info": {
        "description": "Read API for the Synth miner-analytics dashboard. Serves precomputed\nview-models (leaderboards, profiles, badges, performance, rewards and\nnetwork stats) from the synth-miner-profiles serving DB. Endpoints are\nserved behind the shared host at the /v1 path prefix.",
        "title": "Synth Miner Dashboard API",
        "contact": {
            "url": "https://synthdata.co"
        },
        "version": "1.0"
    },
    "host": "monitoring.synthdata.co",
    "paths": {
        "/health": {
            "get": {
                "description": "Liveness/readiness probe. Returns {\"status\":\"ok\"} when the process is up.",
                "produces": [
                    "application/json"
                ],
                "summary": "Health check",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/v1/badges/catalog": {
            "get": {
                "description": "Full static badge catalog (the badge definitions the pipeline writes into badge_catalog). Earned badges per coldkey are served by the profile endpoint, not here.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "badges"
                ],
                "summary": "Badge catalog",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/badges.catalogResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/v1/competitions/{competition}/assets/{asset}/miners/{uid}/series": {
            "get": {
                "description": "One miner's precomputed per-prompt series for a competition + asset: scored times, prompt scores, CRPS, per-prompt rank, gaps to the rank-1/rank-10 miner, plus the average-gap KPI cards. Columnar payload (parallel arrays).",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "performance"
                ],
                "summary": "Miner performance series",
                "parameters": [
                    {
                        "type": "string",
                        "example": "crypto-24h",
                        "description": "Competition slug",
                        "name": "competition",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "example": "BTC",
                        "description": "Asset symbol (not Overall)",
                        "name": "asset",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "example": 42,
                        "description": "Miner UID",
                        "name": "uid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "example": 10,
                        "description": "Look-back window in days (default 10, max 60)",
                        "name": "days",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/performance.seriesResponse"
                        }
                    },
                    "400": {
                        "description": "invalid miner uid / asset does not belong to this competition",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "404": {
                        "description": "unknown competition",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/v1/competitions/{competition}/assets/{asset}/scoreboard": {
            "get": {
                "description": "Prompt score at the fixed benchmark rank positions (1, 2, 3, 10, 25, 50, 100, 200) over time for a competition + asset — the reference lines plotted on the performance chart. Columnar matrix: one row per benchmark rank present, one column per scored_time.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "performance"
                ],
                "summary": "Benchmark scoreboard",
                "parameters": [
                    {
                        "type": "string",
                        "example": "crypto-24h",
                        "description": "Competition slug",
                        "name": "competition",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "example": "BTC",
                        "description": "Asset symbol (not Overall)",
                        "name": "asset",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "example": 10,
                        "description": "Look-back window in days (default 10, max 60)",
                        "name": "days",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/performance.scoreboardResponse"
                        }
                    },
                    "400": {
                        "description": "asset does not belong to this competition",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "404": {
                        "description": "unknown competition",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/v1/competitions/{competition}/assets/{asset}/scored-times": {
            "get": {
                "description": "Distinct scored times available for a competition + asset (most recent first, capped at 200) — used to populate the snapshot picker.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "performance"
                ],
                "summary": "Available scored times",
                "parameters": [
                    {
                        "type": "string",
                        "example": "crypto-24h",
                        "description": "Competition slug",
                        "name": "competition",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "example": "BTC",
                        "description": "Asset symbol (not Overall)",
                        "name": "asset",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "example": 10,
                        "description": "Look-back window in days (default 10, max 60)",
                        "name": "days",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "asset does not belong to this competition",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "404": {
                        "description": "unknown competition",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/v1/competitions/{competition}/assets/{asset}/snapshot": {
            "get": {
                "description": "All miners' scores/ranks/gaps at a single scored_time for a competition + asset, ordered by rank (missed last). Includes each miner's current smoothed_score (this asset) and reward_weight (Overall) joined from the leaderboard.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "performance"
                ],
                "summary": "Field snapshot at a scored time",
                "parameters": [
                    {
                        "type": "string",
                        "example": "crypto-24h",
                        "description": "Competition slug",
                        "name": "competition",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "example": "BTC",
                        "description": "Asset symbol (not Overall)",
                        "name": "asset",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "example": "2026-06-25T00:00:00Z",
                        "description": "Scored time (RFC3339)",
                        "name": "scored_time",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/performance.snapshotResponse"
                        }
                    },
                    "400": {
                        "description": "scored_time must be RFC3339 / asset does not belong to this competition",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "404": {
                        "description": "unknown competition",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/v1/competitions/{competition}/leaderboard": {
            "get": {
                "description": "Paginated, precomputed leaderboard for a competition + asset. Returns source \"wip\" with empty rows for a newly onboarded competition/asset that has no rows yet.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "leaderboard"
                ],
                "summary": "Competition leaderboard",
                "parameters": [
                    {
                        "type": "string",
                        "example": "crypto-24h",
                        "description": "Competition slug",
                        "name": "competition",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "example": "Overall",
                        "description": "Asset symbol, or Overall (default)",
                        "name": "asset",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "1-based page number (default 1)",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Rows per page (default 50, max 500)",
                        "name": "page_size",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/leaderboard.response"
                        }
                    },
                    "400": {
                        "description": "asset does not belong to this competition",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "404": {
                        "description": "unknown competition",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/v1/competitions/{competition}/leaderboard/series": {
            "get": {
                "description": "Per-run Overall leaderboard history for a competition over the last N days: each miner's rank / smoothed_score / reward_weight time-series, columnar (aligned to a shared snapshot-time axis). Source for the leaderboard overview charts.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "leaderboard"
                ],
                "summary": "Leaderboard overview history",
                "parameters": [
                    {
                        "type": "string",
                        "example": "crypto-24h",
                        "description": "Competition slug",
                        "name": "competition",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "example": 10,
                        "description": "Look-back window in days (default 10, max 60)",
                        "name": "days",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/leaderboard.seriesResponse"
                        }
                    },
                    "404": {
                        "description": "unknown competition",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/v1/miners/rewards/30d": {
            "get": {
                "description": "Ranked top earners over the trailing 30 days, per coldkey (USD/TAO/alpha totals + latest daily USD). Precomputed by the pipeline.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "rewards"
                ],
                "summary": "30-day reward leaderboard",
                "parameters": [
                    {
                        "type": "integer",
                        "example": 30,
                        "description": "Max rows (default 30, max 500)",
                        "name": "limit",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/rewards.tableResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/v1/miners/rewards/series": {
            "get": {
                "description": "Daily cumulative-USD series for the top-N 30-day earners, as a columnar matrix: coldkeys (rank order), days (sorted), and cumulative_usd[coldkey][day] (null where a coldkey has no point on that day).",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "rewards"
                ],
                "summary": "Reward cumulative-USD series",
                "parameters": [
                    {
                        "type": "integer",
                        "example": 10,
                        "description": "Number of top earners (default 10, max 100)",
                        "name": "top",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/rewards.seriesResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/v1/network/stats": {
            "get": {
                "description": "Miner-program onboarding summary (Epic 8): subnet, scoring method, competition/asset counts and active-miner counts, computed from lb_entry. The marketing \"total rewards distributed\" USD figure is sourced separately (the main Synth API), not here.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "network"
                ],
                "summary": "Network onboarding stats",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/network.statsResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/v1/profiles/{coldkey}": {
            "get": {
                "description": "Aggregated profile for a coldkey: current/historical UIDs, axon IPs, per-competition standings, and earned badges. An unknown coldkey returns 200 with source \"wip\" and empty standings so the frontend can render its \"no profile found\" state.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "profile"
                ],
                "summary": "Miner (coldkey) profile",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Miner coldkey (SS58 wallet address)",
                        "name": "coldkey",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/profile.View"
                        }
                    },
                    "404": {
                        "description": "missing coldkey",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "badges.CatalogEntry": {
            "type": "object",
            "properties": {
                "badge_id": {
                    "type": "integer"
                },
                "class": {
                    "type": "string"
                },
                "competition": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "rule_type": {
                    "type": "string"
                },
                "scope": {
                    "type": "string"
                },
                "slug": {
                    "type": "string"
                }
            }
        },
        "badges.catalogResponse": {
            "type": "object",
            "properties": {
                "badges": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/badges.CatalogEntry"
                    }
                },
                "count": {
                    "type": "integer"
                },
                "source": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "leaderboard.Row": {
            "type": "object",
            "properties": {
                "axon_ip": {
                    "type": "string"
                },
                "coldkey": {
                    "type": "string"
                },
                "miner_id": {
                    "type": "integer"
                },
                "miner_uid": {
                    "type": "integer"
                },
                "rank": {
                    "type": "integer"
                },
                "registration_date": {
                    "type": "string"
                },
                "reward_weight": {
                    "type": "number"
                },
                "smoothed_score": {
                    "type": "number"
                }
            }
        },
        "leaderboard.SeriesEntry": {
            "type": "object",
            "properties": {
                "miner_uid": {
                    "type": "integer"
                },
                "rank": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "reward_weight": {
                    "type": "array",
                    "items": {
                        "type": "number"
                    }
                },
                "smoothed_score": {
                    "type": "array",
                    "items": {
                        "type": "number"
                    }
                }
            }
        },
        "leaderboard.response": {
            "type": "object",
            "properties": {
                "asset": {
                    "type": "string"
                },
                "competition": {
                    "type": "string"
                },
                "page": {
                    "type": "integer"
                },
                "page_size": {
                    "type": "integer"
                },
                "rows": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/leaderboard.Row"
                    }
                },
                "source": {
                    "type": "string"
                },
                "total": {
                    "type": "integer"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "leaderboard.seriesResponse": {
            "type": "object",
            "properties": {
                "competition": {
                    "type": "string"
                },
                "series": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/leaderboard.SeriesEntry"
                    }
                },
                "snapshot_times": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "source": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "network.CompetitionStat": {
            "type": "object",
            "properties": {
                "label": {
                    "type": "string"
                },
                "n_active_miners": {
                    "type": "integer"
                },
                "n_assets": {
                    "type": "integer"
                },
                "slug": {
                    "type": "string"
                }
            }
        },
        "network.statsResponse": {
            "type": "object",
            "properties": {
                "competitions": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/network.CompetitionStat"
                    }
                },
                "n_active_miners": {
                    "type": "integer"
                },
                "n_assets": {
                    "type": "integer"
                },
                "n_competitions": {
                    "type": "integer"
                },
                "scoring_method": {
                    "type": "string"
                },
                "source": {
                    "type": "string"
                },
                "subnet": {
                    "type": "integer"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "performance.kpi": {
            "type": "object",
            "properties": {
                "avg_gap_to_top1": {
                    "type": "number"
                },
                "avg_gap_to_top10": {
                    "type": "number"
                }
            }
        },
        "performance.scoreboardResponse": {
            "type": "object",
            "properties": {
                "asset": {
                    "type": "string"
                },
                "competition": {
                    "type": "string"
                },
                "miner_uid": {
                    "description": "[rankIndex][timeIndex] — who held that rank",
                    "type": "array",
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    }
                },
                "prompt_score": {
                    "description": "[rankIndex][timeIndex]",
                    "type": "array",
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "number",
                            "format": "float64"
                        }
                    }
                },
                "ranks": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "scored_times": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "source": {
                    "type": "string"
                }
            }
        },
        "performance.seriesResponse": {
            "type": "object",
            "properties": {
                "asset": {
                    "type": "string"
                },
                "competition": {
                    "type": "string"
                },
                "crps": {
                    "type": "array",
                    "items": {
                        "type": "number"
                    }
                },
                "gap_to_top1": {
                    "type": "array",
                    "items": {
                        "type": "number"
                    }
                },
                "gap_to_top10": {
                    "type": "array",
                    "items": {
                        "type": "number"
                    }
                },
                "kpi": {
                    "$ref": "#/definitions/performance.kpi"
                },
                "miner_uid": {
                    "type": "integer"
                },
                "missed": {
                    "type": "array",
                    "items": {
                        "type": "boolean"
                    }
                },
                "prompt_score": {
                    "type": "array",
                    "items": {
                        "type": "number"
                    }
                },
                "rank": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "receiving_rewards": {
                    "type": "boolean"
                },
                "registration_date": {
                    "description": "Miner-level metadata (joined from lb_entry), not per-prompt.",
                    "type": "string"
                },
                "scored_times": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "source": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "performance.snapshotResponse": {
            "type": "object",
            "properties": {
                "asset": {
                    "type": "string"
                },
                "competition": {
                    "type": "string"
                },
                "rows": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/performance.snapshotRow"
                    }
                },
                "scored_time": {
                    "type": "string"
                },
                "source": {
                    "type": "string"
                }
            }
        },
        "performance.snapshotRow": {
            "type": "object",
            "properties": {
                "crps": {
                    "type": "number"
                },
                "gap_to_top1": {
                    "type": "number"
                },
                "gap_to_top10": {
                    "type": "number"
                },
                "miner_uid": {
                    "type": "integer"
                },
                "missed": {
                    "type": "boolean"
                },
                "prompt_score": {
                    "type": "number"
                },
                "rank": {
                    "type": "integer"
                },
                "reward_weight": {
                    "type": "number"
                },
                "smoothed_score": {
                    "type": "number"
                }
            }
        },
        "profile.EarnedBadge": {
            "type": "object",
            "properties": {
                "achieved_at": {
                    "type": "string"
                },
                "badge_id": {
                    "type": "integer"
                },
                "class": {
                    "type": "string"
                },
                "competition": {
                    "type": "string"
                },
                "evidence": {
                    "type": "object"
                },
                "name": {
                    "type": "string"
                },
                "slug": {
                    "type": "string"
                }
            }
        },
        "profile.HistoricalUID": {
            "type": "object",
            "properties": {
                "first_seen": {
                    "type": "string"
                },
                "last_seen": {
                    "type": "string"
                },
                "uid": {
                    "type": "integer"
                }
            }
        },
        "profile.Standing": {
            "type": "object",
            "properties": {
                "active_miners": {
                    "type": "integer"
                },
                "best_rank": {
                    "type": "integer"
                },
                "best_score": {
                    "type": "number"
                },
                "combined_weight": {
                    "type": "number"
                },
                "competing": {
                    "type": "boolean"
                },
                "total_miners": {
                    "type": "integer"
                }
            }
        },
        "profile.View": {
            "type": "object",
            "properties": {
                "axon_ips": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "badges": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/profile.EarnedBadge"
                    }
                },
                "coldkey": {
                    "type": "string"
                },
                "current_uids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "historical_uids": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/profile.HistoricalUID"
                    }
                },
                "source": {
                    "type": "string"
                },
                "standings": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/definitions/profile.Standing"
                    }
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "rewards.Row": {
            "type": "object",
            "properties": {
                "coldkey": {
                    "type": "string"
                },
                "daily_usd": {
                    "type": "number"
                },
                "rank": {
                    "type": "integer"
                },
                "total_alpha": {
                    "type": "number"
                },
                "total_tao": {
                    "type": "number"
                },
                "total_usd": {
                    "type": "number"
                }
            }
        },
        "rewards.seriesResponse": {
            "type": "object",
            "properties": {
                "coldkeys": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "cumulative_usd": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "number",
                            "format": "float64"
                        }
                    }
                },
                "days": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "source": {
                    "type": "string"
                }
            }
        },
        "rewards.tableResponse": {
            "type": "object",
            "properties": {
                "rows": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/rewards.Row"
                    }
                },
                "source": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        }
    }
}