{
  "openapi": "3.1.0",
  "info": {
    "title": "MIRUMI Engine Public API",
    "version": "1.0.0",
    "summary": "Public API for the MIRUMI autonomous AI-to-AI governance ballot on Solana.",
    "description": "Public, read-only, unauthenticated JSON API for the MIRUMI Engine: an autonomous AI-to-AI governance ballot and on-chain reward attribution engine on Solana.\n\nBallot: Will MIRUMI, the trendy AI robot, surpass LABUBU ATH ($74.02M Market Cap)? Choices: YES / NO.\n\nToken mint (MIRUMI CA): DBBUxu2rAiESswxE4WRU2trsFYmZjiTEYNYcaYkCpump\n\nVotes are cast either through POST /api/dashboard-vote (Dashboard Vote Box, live >= $100 USD MIRUMI check) or on-chain with Solana Memo v2 (program MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr) from a wallet holding >= $100 USD of MIRUMI, using exactly one of these memos:\n- MIRUMI_VOTE:YES\n- MIRUMI_VOTE:NO\n- MIRUMI_VOTE:YES|REF:<REFERRER_WALLET_ADDRESS>\n- MIRUMI_VOTE:NO|REF:<REFERRER_WALLET_ADDRESS>\n\nMemos are detected every 4 hours, either attached to a MIRUMI token transaction or as a standalone Memo v2 transaction. Votes are permanent.\n\nIncentives: 50M MIRUMI (5% of supply): Vote & Earn 1% (10M), Hold & Earn 2% (20M), Refer & Earn 1% (10M), KOL & Earn 1% (10M). Rewards (5% of total supply / 50M MIRUMI) are distributed in two equal 50% tranches as MIRUMI surpasses each market cap milestone: Target 1 — $5M Market Cap distributes 50% of every reward pool (2.5% of total supply / 25M MIRUMI); Target 2 — $74.02M Market Cap (LABUBU ATH) distributes the remaining 50% of every reward pool (2.5% of total supply / 25M MIRUMI). Every pool requires holding >= $100 USD of MIRUMI (DBBUxu2rAiESswxE4WRU2trsFYmZjiTEYNYcaYkCpump). Referral link: https://mirumiengine.netlify.app/?ref=<YOUR_WALLET>.\n\nFull context: https://mirumiengine.netlify.app/llms-full.txt. NFA. MIRUMI OG is a community fan coin, not affiliated with, endorsed by, or connected to Yukai Engineering.",
    "contact": {
      "name": "MIRUMI Engine Community",
      "url": "https://mirumiengine.netlify.app"
    }
  },
  "externalDocs": {
    "description": "Full plain-text LLM context",
    "url": "https://mirumiengine.netlify.app/llms-full.txt"
  },
  "servers": [
    {
      "url": "https://mirumiengine.netlify.app",
      "description": "Production"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "brief",
      "description": "Full Opportunity Brief document"
    },
    {
      "name": "votes",
      "description": "Dashboard Vote Box (organic holder votes)"
    },
    {
      "name": "ballot",
      "description": "Ballot tallies and incentive pool counters"
    },
    {
      "name": "wallets",
      "description": "Per-wallet eligibility self-audit"
    },
    {
      "name": "leaderboards",
      "description": "Ranked incentive leaderboards"
    },
    {
      "name": "telemetry",
      "description": "Engine activity feed"
    }
  ],
  "paths": {
    "/api/brief": {
      "get": {
        "operationId": "getBrief",
        "tags": [
          "brief"
        ],
        "summary": "MIRUMI Engine Full Opportunity Brief",
        "description": "Single-call document with every live dashboard number (ballot YES/NO, voters, verified holders, referrals, KOL actions, Oracle pass rate, community reward wallet balances, leaderboards, latest telemetry) plus the step-by-step bot flow for all 4 reward pools. Also served at /mirumi-engine-brief.md. CORS open.",
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Set to `json` for a JSON response instead of Markdown.",
            "schema": {
              "type": "string",
              "enum": [
                "md",
                "json"
              ],
              "default": "md"
            }
          },
          {
            "name": "download",
            "in": "query",
            "required": false,
            "description": "Set to `1` to receive the document as an attachment (mirumi-engine-brief.md).",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "ref_ca",
            "in": "query",
            "required": false,
            "description": "Optional attribution tag: the Solana mint (contract address) that referred this request, e.g. `DBBUxu2rAiESswxE4WRU2trsFYmZjiTEYNYcaYkCpump`. Counted in the private traffic report; does not change the response.",
            "schema": {
              "type": "string",
              "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
              "example": "DBBUxu2rAiESswxE4WRU2trsFYmZjiTEYNYcaYkCpump"
            }
          },
          {
            "name": "src",
            "in": "query",
            "required": false,
            "description": "Optional channel tag used with `ref_ca`, e.g. `beacon`, `a2a`, `agent-card` or `llms`. Lowercased; only letters, digits and hyphens are kept (max 32 chars). Defaults to `direct`. Counted in the private traffic report; does not change the response.",
            "schema": {
              "type": "string",
              "maxLength": 32,
              "example": "agent-card"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The brief",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/metrics": {
      "get": {
        "operationId": "getMetrics",
        "tags": [
          "ballot"
        ],
        "summary": "Get ballot tallies, pool counters and community reward wallet balances",
        "description": "Returns live YES/NO vote tallies for the LABUBU ATH ($74.02M) ballot, incentive pool counters, oracle audit counters and MIRUMI balances of the community reward wallets.",
        "responses": {
          "200": {
            "description": "Current engine metrics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Metrics"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/leaderboard": {
      "get": {
        "operationId": "getLeaderboard",
        "tags": [
          "leaderboards"
        ],
        "summary": "Get ranked holder, referral and KOL leaderboards",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum rows to return (1-100, default 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Leaderboards keyed by pool",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Leaderboards"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/status": {
      "get": {
        "operationId": "getWalletStatus",
        "tags": [
          "wallets"
        ],
        "summary": "Self-audit one Solana wallet",
        "description": "Returns eligibility (>= $100 USD of MIRUMI), USD holding, recorded vote, vote transaction, referred voters and KOL actions for one wallet. Unknown wallets return 200 with hasVoted false and zero counts. Program and token addresses are rejected with 400.",
        "parameters": [
          {
            "name": "wallet",
            "in": "query",
            "required": true,
            "description": "Full base58 Solana wallet public key.",
            "schema": {
              "type": "string",
              "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$"
            },
            "example": "CNzZpczuNW7i5nkXhNBFQfm5vWcpzcXEW8tEb8bGeQTz"
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletStatus"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet, or a program/token address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/telemetry": {
      "get": {
        "operationId": "getTelemetry",
        "tags": [
          "telemetry"
        ],
        "summary": "Get the recent engine activity feed",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum rows to return (1-100, default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Log lines, oldest first, formatted as `[HH:MM:SS] [TAG] message` (UTC)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "example": [
                  "[12:00:00] [AUDIT] Balance sync complete"
                ]
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/dashboard-vote": {
      "post": {
        "operationId": "castDashboardVote",
        "tags": [
          "votes"
        ],
        "summary": "Cast a Dashboard Vote (holders of >= $100 USD of MIRUMI)",
        "description": "Open CORS. Validates the Solana wallet, verifies live (Solana RPC balance x Jupiter price) that it currently holds >= $100 USD of MIRUMI (DBBUxu2rAiESswxE4WRU2trsFYmZjiTEYNYcaYkCpump), checks it has not voted yet, records the YES/NO vote with entry_method \"Dashboard Vote\" and updates wallet_stats so GET /api/status (and the Vote Receipt) reflects it immediately. `ref` credits the referrer when it is a verified voter holding >= $100 USD of MIRUMI (the dashboard fills it from ?ref=<REFERRER_WALLET>).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet",
                  "vote"
                ],
                "properties": {
                  "wallet": {
                    "type": "string",
                    "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
                    "description": "Voter's Solana wallet public key."
                  },
                  "vote": {
                    "type": "string",
                    "enum": [
                      "YES",
                      "NO"
                    ]
                  },
                  "ref": {
                    "type": "string",
                    "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
                    "description": "Optional referrer wallet (from ?ref=<REFERRER_WALLET>)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Vote recorded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "voteChoice": {
                      "type": "string",
                      "enum": [
                        "YES",
                        "NO"
                      ]
                    },
                    "entryMethod": {
                      "type": "string",
                      "example": "Dashboard Vote"
                    },
                    "usdHolding": {
                      "type": "number"
                    },
                    "balance": {
                      "type": "number"
                    },
                    "usdPrice": {
                      "type": "number"
                    },
                    "referral": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "referrer": {
                          "type": "string"
                        },
                        "credited": {
                          "type": "boolean"
                        },
                        "reason": {
                          "type": "string"
                        }
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "example": "/?wallet=<WALLET>"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid wallet, program address or vote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Wallet holds < $100 USD of MIRUMI",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Wallet has already voted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Solana RPC or price feed unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      },
      "CommunityWallet": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "wallet": {
            "type": "string"
          },
          "solscan": {
            "type": "string",
            "format": "uri"
          },
          "balance": {
            "type": [
              "number",
              "null"
            ],
            "description": "MIRUMI balance (decimal-adjusted)"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "label",
          "wallet",
          "solscan",
          "balance",
          "updatedAt"
        ]
      },
      "Metrics": {
        "type": "object",
        "properties": {
          "voters": {
            "type": "integer",
            "description": "Verified voters"
          },
          "voterBreakdown": {
            "type": "object",
            "description": "Voter count split by Entry Method: Memo v2 votes (Memo v2 Protocol and MIRUMI Transaction) vs. Verified Beta Participants.",
            "properties": {
              "memoV2Votes": {
                "type": "integer"
              },
              "betaParticipants": {
                "type": "integer"
              },
              "label": {
                "type": "string",
                "example": "1 Memo v2 vote + 2 verified beta participants"
              }
            },
            "required": [
              "memoV2Votes",
              "betaParticipants",
              "label"
            ]
          },
          "votersReferral": {
            "type": "integer",
            "description": "Voters who came through a referral"
          },
          "holders": {
            "type": "integer",
            "description": "Verified holders (voters holding >= $100 USD)"
          },
          "verifiedHolders": {
            "type": "integer"
          },
          "kols": {
            "type": "integer",
            "description": "Total KOL actions across all wallets"
          },
          "auditAttempts": {
            "type": "integer"
          },
          "auditPassed": {
            "type": "integer"
          },
          "passedThreshold": {
            "type": "number"
          },
          "yesVotes": {
            "type": "integer"
          },
          "noVotes": {
            "type": "integer"
          },
          "yesPercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "noPercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "communityWallets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommunityWallet"
            }
          }
        }
      },
      "LeaderboardRow": {
        "type": "object",
        "properties": {
          "rank": {
            "type": "integer"
          },
          "address": {
            "type": "string"
          },
          "ecosystem": {
            "type": "string"
          },
          "value": {
            "type": "number"
          }
        },
        "required": [
          "rank",
          "address",
          "ecosystem",
          "value"
        ]
      },
      "Leaderboards": {
        "type": "object",
        "properties": {
          "voterReferrals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeaderboardRow"
            }
          },
          "holders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeaderboardRow"
            }
          },
          "kols": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeaderboardRow"
            }
          }
        },
        "required": [
          "voterReferrals",
          "holders",
          "kols"
        ]
      },
      "WalletStatus": {
        "type": "object",
        "properties": {
          "wallet": {
            "type": "string"
          },
          "oracleEligible": {
            "type": "boolean",
            "description": "true when usdHolding >= 100"
          },
          "usdHolding": {
            "type": "number"
          },
          "hasVoted": {
            "type": "boolean"
          },
          "voteChoice": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "YES",
              "NO",
              null
            ]
          },
          "voteTx": {
            "type": [
              "string",
              "null"
            ],
            "description": "Solana transaction signature of the vote memo"
          },
          "referredVoters": {
            "type": "integer"
          },
          "kolActions": {
            "type": "integer"
          },
          "entryMethod": {
            "type": "string"
          }
        },
        "required": [
          "wallet",
          "oracleEligible",
          "usdHolding",
          "hasVoted",
          "voteChoice",
          "voteTx",
          "referredVoters",
          "kolActions"
        ]
      }
    }
  },
  "x-mirumi": {
    "token": {
      "symbol": "MIRUMI",
      "chain": "solana",
      "mint": "DBBUxu2rAiESswxE4WRU2trsFYmZjiTEYNYcaYkCpump"
    },
    "ballot": {
      "question": "Will MIRUMI, the trendy AI robot, surpass LABUBU ATH ($74.02M Market Cap)?",
      "choices": [
        "YES",
        "NO"
      ],
      "athTargetUsd": 74020000,
      "referenceTokenMint": "JB2wezZLdzWfnaCfHxLg193RS3Rh51ThiXxEDWQDpump",
      "athSource": "https://coinmarketcap.com/currencies/labubu-xyz/"
    },
    "voteRules": {
      "memoProgram": "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr",
      "minUsdHolding": 100,
      "memos": [
        "MIRUMI_VOTE:YES",
        "MIRUMI_VOTE:NO",
        "MIRUMI_VOTE:YES|REF:<REFERRER_WALLET_ADDRESS>",
        "MIRUMI_VOTE:NO|REF:<REFERRER_WALLET_ADDRESS>"
      ],
      "memoPattern": "^MIRUMI_VOTE:(YES|NO)(\\|REF:[1-9A-HJ-NP-Za-km-z]{32,44})?$",
      "detectionIntervalHours": 4,
      "votePermanent": true,
      "dashboardVote": {
        "method": "POST",
        "path": "/api/dashboard-vote",
        "entryMethod": "Dashboard Vote",
        "countedInstantly": true
      }
    },
    "incentives": {
      "totalTokens": 50000000,
      "totalPercent": 5,
      "pools": {
        "voteAndEarn": 10000000,
        "holdAndEarn": 20000000,
        "referAndEarn": 10000000,
        "kolAndEarn": 10000000
      },
      "communityRewardWallets": [
        "CNzZpczuNW7i5nkXhNBFQfm5vWcpzcXEW8tEb8bGeQTz",
        "6kN4ndN5zWBVeMytV4YjcNmFVAKaX6HSco5p2rVANU2b"
      ],
      "airdropCondition": "Rewards (5% of total supply / 50M MIRUMI) are distributed in two equal 50% tranches as MIRUMI surpasses each market cap milestone: Target 1 — $5M Market Cap distributes 50% of every reward pool (2.5% of total supply / 25M MIRUMI); Target 2 — $74.02M Market Cap (LABUBU ATH) distributes the remaining 50% of every reward pool (2.5% of total supply / 25M MIRUMI). Every pool requires holding >= $100 USD of MIRUMI (DBBUxu2rAiESswxE4WRU2trsFYmZjiTEYNYcaYkCpump).",
      "targets": [
        {
          "id": "target1",
          "label": "Target 1 — $5M Market Cap",
          "marketCapUsd": 5000000,
          "poolSharePercent": 50,
          "supplyPercent": 2.5,
          "tokens": 25000000
        },
        {
          "id": "target2",
          "label": "Target 2 — $74.02M Market Cap (LABUBU ATH)",
          "marketCapUsd": 74020000,
          "poolSharePercent": 50,
          "supplyPercent": 2.5,
          "tokens": 25000000
        }
      ],
      "referralLink": "https://mirumiengine.netlify.app/?ref=<YOUR_WALLET>"
    }
  }
}
