{"openapi":"3.0.0","info":{"title":"Prediction Market API","version":"v1"},"tags":[{"name":"Events"},{"name":"Markets"},{"name":"Execution"},{"name":"Orders"},{"name":"Parlays"},{"name":"Positions"},{"name":"PositionsV2"},{"name":"History"},{"name":"HistoryV2"},{"name":"Trading"},{"name":"Orderbook"},{"name":"Milestones"},{"name":"Vault"}],"components":{"schemas":{"MarketPricing":{"type":"object","properties":{"buyYesPriceUsd":{"type":"number","nullable":true},"buyNoPriceUsd":{"type":"number","nullable":true},"sellYesPriceUsd":{"type":"number","nullable":true},"sellNoPriceUsd":{"type":"number","nullable":true},"volume":{"type":"number"}}},"Market":{"type":"object","properties":{"provider":{"type":"string","enum":["polymarket"],"description":"Market data provider"},"marketId":{"type":"string","description":"Market identifier"},"status":{"type":"string","enum":["open","closed"],"description":"Current market status"},"result":{"type":"string","nullable":true,"enum":["yes","no","draw"],"description":"Current market result"},"marketResultPubkey":{"type":"string","nullable":true,"description":"On-chain MarketResult account pubkey (present when market is settled and claimable)."},"title":{"type":"string","description":"Market title"},"openTime":{"type":"number"},"closeTime":{"type":"number"},"isTeamMarket":{"type":"boolean","description":"Whether this is a team market"},"rulesPrimary":{"type":"string","description":"Primary rules text"},"rulesSecondary":{"type":"string","description":"Secondary rules text"},"resolveAt":{"type":"string","nullable":true,"description":"ISO 8601 timestamp when market was resolved"},"pricing":{"$ref":"#/components/schemas/MarketPricing"},"imageUrl":{"type":"string","nullable":true,"description":"Market-specific image URL"},"team":{"type":"object","nullable":true,"properties":{"name":{"type":"string","description":"Team name (e.g. Los Angeles Lakers)"},"imageUrl":{"type":"string","nullable":true,"description":"Team logo URL"},"color":{"type":"string","nullable":true,"description":"Team color hex code"},"abbreviation":{"type":"string","nullable":true,"description":"Team abbreviation (e.g. LAL, BOS)"}},"required":["name","imageUrl","color","abbreviation"],"description":"Team metadata for team markets"},"outcomes":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Outcome labels (e.g. [\"Yes\", \"No\"])"},"clobTokenIds":{"type":"array","nullable":true,"items":{"type":"string"},"description":"CLOB token IDs for each outcome"},"marketOptions":{"type":"array","nullable":true,"items":{"type":"object","properties":{},"additionalProperties":{"nullable":true}},"description":"Structured options for FE display (e.g. [{ label: \"O 228.5\", buyYes: true }])"},"sportsMarketType":{"type":"string","nullable":true,"description":"Type of sports betting market (e.g. \"moneyline\", \"f1_race_winner\", \"spreads\", \"totals\")"},"sportsLine":{"type":"string","nullable":true,"description":"Sports betting line value (e.g. \"228.5\" for totals, \"-1.5\" for spreads)"}},"required":["provider","marketId","status","result","marketResultPubkey"]},"GXMarket":{"type":"object","properties":{"provider":{"type":"string","enum":["gx"],"description":"Market data provider"},"marketId":{"type":"string","description":"Market identifier"},"status":{"type":"string","enum":["open","closed"],"description":"Current market status"},"result":{"type":"string","nullable":true,"enum":["yes","no","draw"],"description":"Current market result"},"marketResultPubkey":{"type":"string","nullable":true,"description":"On-chain MarketResult account pubkey (present when market is settled and claimable)."},"title":{"type":"string","description":"Market title"},"openTime":{"type":"number"},"closeTime":{"type":"number"},"isTeamMarket":{"type":"boolean","description":"Whether this is a team market"},"rulesPrimary":{"type":"string","description":"Primary rules text"},"resolveAt":{"type":"string","nullable":true,"description":"ISO 8601 timestamp when market was resolved"},"pricing":{"$ref":"#/components/schemas/MarketPricing"},"imageUrl":{"type":"string","nullable":true,"description":"Market-specific image URL"},"gxMarketId":{"type":"string","nullable":true,"description":"GX upstream market identifier"},"gxEventId":{"type":"string","nullable":true,"description":"GX upstream event identifier"},"betType":{"type":"number","nullable":true,"description":"GX bet type code"},"marketOptions":{"type":"array","nullable":true,"items":{"type":"object","properties":{},"additionalProperties":{"nullable":true}},"description":"Structured options for FE display (e.g. [{ label: \"Odd\", buyYes: true }])"},"marketCode":{"type":"string","nullable":true,"description":"GX market code"},"marketStatus":{"type":"string","nullable":true,"description":"GX upstream market status"},"isLive":{"type":"boolean","nullable":true,"description":"Whether the GX market is live"},"category":{"type":"number","nullable":true,"description":"GX market category code"},"showCategory":{"type":"string","nullable":true,"description":"GX display category"},"sort":{"type":"number","nullable":true,"description":"GX display sort order"},"combo":{"type":"number","nullable":true,"description":"GX combo flag"},"sportsMarketType":{"type":"string","nullable":true,"description":"Type of sports betting market (e.g. \"moneyline\", \"spreads\", \"totals\", \"odd/even\")"}},"required":["provider","marketId","status","result","marketResultPubkey"]},"Event":{"type":"object","properties":{"eventId":{"type":"string","description":"Application-level identifier"},"isActive":{"type":"boolean","description":"Whether the event is active (listed on events)"},"isLive":{"type":"boolean","description":"Whether the event is currently live"},"category":{"type":"string","description":"The category for the event, allowed values: all, crypto, sports, politics, esports, culture, economics, tech"},"subcategory":{"type":"string","description":"The subcategory for the event"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for the event, e.g. 15m, 5m"},"metadata":{"type":"object","properties":{"eventId":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":"string"},"imageUrl":{"type":"string","format":"uri"},"isLive":{"type":"boolean"},"status":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"beginAt":{"type":"string","nullable":true},"category":{"type":"string"},"subcategory":{"type":"string"}},"required":["eventId"]},"markets":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/Market"},{"$ref":"#/components/schemas/GXMarket"}],"discriminator":{"propertyName":"provider","mapping":{"polymarket":"#/components/schemas/Market","gx":"#/components/schemas/GXMarket"}}}},"volumeUsd":{"type":"string","description":"Total volume for the event"},"volume24hr":{"type":"string","description":"24-hour trading volume for the event"},"closeCondition":{"type":"string","description":"Close condition for the event"},"beginAt":{"type":"string","nullable":true,"description":"Unix timestamp (seconds) when the event begins"},"rulesPdf":{"type":"string","description":"Document to full rules for the event"}},"required":["eventId","isActive","isLive","category","subcategory","tags","volumeUsd","volume24hr","closeCondition","beginAt","rulesPdf"]},"Pagination":{"type":"object","properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":0},"hasNext":{"type":"boolean"}},"required":["start","end","total","hasNext"]},"ErrorResponse":{"type":"object","properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","idempotency_error","rate_limit_error","api_error"]},"message":{"type":"string"},"code":{"type":"string"},"param":{"type":"string"},"request_id":{"type":"string"},"doc_url":{"type":"string"}},"required":["type","message","request_id"]},"GameScore":{"type":"object","properties":{"eventId":{"type":"string","description":"Application-level identifier"},"gameId":{"type":"string"},"leagueAbbreviation":{"type":"string","nullable":true},"homeTeam":{"type":"string","nullable":true},"awayTeam":{"type":"string","nullable":true},"score":{"type":"string","nullable":true,"description":"Raw score string from the provider (e.g. \"3-2\"); FE splits as needed"},"period":{"type":"string","nullable":true},"elapsed":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"live":{"type":"boolean"},"ended":{"type":"boolean"},"finishedTimestamp":{"type":"string","nullable":true,"description":"ISO 8601 timestamp when the game finished, if ended"},"updatedAt":{"type":"string","description":"ISO 8601 timestamp of the last score update"}},"required":["eventId","gameId","leagueAbbreviation","homeTeam","awayTeam","score","period","elapsed","status","live","ended","finishedTimestamp","updatedAt"]},"MarketWithEvent":{"allOf":[{"$ref":"#/components/schemas/Market"},{"type":"object","properties":{"eventId":{"type":"string","description":"Parent event identifier"}},"required":["eventId"]}]},"ExecuteOrderResponse":{"type":"object","properties":{"status":{"type":"string","enum":["Success","Failed"],"description":"Transaction execution result"},"signature":{"type":"string","nullable":true,"description":"Transaction signature (base58)"},"error":{"type":"string","nullable":true,"description":"Error message if the transaction failed"},"requestId":{"type":"string","description":"Echoed from request if provided"}},"required":["status","signature","error"]},"ExecuteOrderRequest":{"type":"object","properties":{"signedTransaction":{"type":"string","minLength":1,"description":"Base64 encoded transaction signed by the owner"},"requestId":{"type":"string","description":"Optional client correlation ID, echoed back in the response"}},"required":["signedTransaction"]},"EventMetadata":{"type":"object","properties":{"eventId":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":"string"},"imageUrl":{"type":"string","format":"uri"},"isLive":{"type":"boolean"},"status":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"closeTime":{"type":"number"},"beginAt":{"type":"string","nullable":true},"category":{"type":"string"},"subcategory":{"type":"string"}},"required":["eventId"]},"MarketMetadata":{"type":"object","properties":{"marketId":{"type":"string"},"eventId":{"type":"string"},"provider":{"type":"string","enum":["kalshi","polymarket","gx"]},"title":{"type":"string"},"subtitle":{"type":"string"},"description":{"type":"string"},"status":{"type":"string"},"result":{"type":"string","nullable":true,"enum":["yes","no","draw"]},"closeTime":{"type":"number"},"openTime":{"type":"number"},"isTeamMarket":{"type":"boolean"},"marketOptions":{"type":"array","nullable":true,"items":{"type":"object","properties":{},"additionalProperties":{"nullable":true}},"description":"Structured options for FE display (e.g. [{ label: \"O 228.5\", buyYes: true }])"}},"required":["marketId"]},"Order":{"type":"object","properties":{"pubkey":{"type":"string","description":"Order account public key"},"owner":{"type":"string","description":"Order owner public key"},"ownerPubkey":{"type":"string","description":"Order owner public key (alias of owner, use ownerPubkey when available)"},"market":{"type":"string","description":"Associated market public key"},"marketId":{"type":"string","description":"External market identifier used to derive the PDA"},"marketIdHash":{"type":"string","description":"Hashed market identifier used for on-chain PDAs"},"eventId":{"type":"string","description":"External event identifier"},"position":{"type":"string","description":"Associated position public key"},"status":{"type":"string","enum":["pending","filled","failed"],"description":"Current order status"},"isYes":{"type":"boolean","description":"True when order is for the YES side"},"isBuy":{"type":"boolean","description":"True when order is a buy order"},"createdAt":{"type":"integer","description":"Unix timestamp (seconds) when the order was created"},"updatedAt":{"type":"integer","description":"Unix timestamp (seconds) when the order last changed on-chain"},"contracts":{"type":"string","description":"Legacy whole-contract quantity string, floored for compatibility"},"contractsMicro":{"type":"string","description":"Exact contract quantity in micro-contract units (u64 as string, 1000000 = 1)"},"contractsDecimal":{"type":"string","description":"Exact contract quantity as a decimal string"},"maxFillPriceUsd":{"type":"string","description":"Maximum fill price in micro USD (u64 as string)"},"maxBuyPriceUsd":{"type":"string","nullable":true,"description":"Buyer-specified max fill price (micro USD)"},"minSellPriceUsd":{"type":"string","nullable":true,"description":"Seller-specified min fill price (micro USD)"},"filledAt":{"type":"integer","description":"Unix timestamp (seconds) when the order was filled (0 when pending)"},"filledContracts":{"type":"string","description":"Legacy filled whole-contract quantity string, floored for compatibility"},"filledContractsMicro":{"type":"string","description":"Exact filled contract quantity in micro-contract units (u64 as string)"},"filledContractsDecimal":{"type":"string","description":"Exact filled contract quantity as a decimal string"},"avgFillPriceUsd":{"type":"string","description":"Average fill price in micro USD (u64 as string)"},"settled":{"type":"boolean","description":"Whether the order has been settled on-chain"},"orderId":{"type":"string","description":"External order identifier from the venue"},"sizeUsd":{"type":"string","description":"Order notional in micro USD (u128 as string)"},"eventMetadata":{"$ref":"#/components/schemas/EventMetadata"},"marketMetadata":{"$ref":"#/components/schemas/MarketMetadata"},"externalOrderId":{"type":"string","description":"Client-provided order identifier"},"bump":{"type":"integer","minimum":0},"orderType":{"type":"string","enum":["market","limit"],"description":"Order type: market or limit"}},"required":["pubkey","owner","ownerPubkey","market","marketId","marketIdHash","eventId","position","status","isYes","isBuy","createdAt","updatedAt","contracts","contractsMicro","contractsDecimal","maxFillPriceUsd","maxBuyPriceUsd","minSellPriceUsd","filledAt","filledContracts","filledContractsMicro","filledContractsDecimal","avgFillPriceUsd","settled","orderId","sizeUsd","eventMetadata","marketMetadata","externalOrderId","bump","orderType"]},"CreateOrderResponse":{"type":"object","properties":{"transaction":{"type":"string","nullable":true,"description":"Base64 encoded transaction"},"txMeta":{"type":"object","nullable":true,"properties":{"blockhash":{"type":"string"},"lastValidBlockHeight":{"type":"integer","minimum":0}},"required":["blockhash","lastValidBlockHeight"],"description":"Transaction metadata"},"externalOrderId":{"type":"string","nullable":true},"requiredSigners":{"type":"array","items":{"type":"string"},"description":"Public keys that must sign the transaction"},"order":{"type":"object","properties":{"orderPubkey":{"type":"string","nullable":true,"description":"Order account public key"},"orderAtaPubkey":{"type":"string","nullable":true,"description":"Order escrow token account"},"userPubkey":{"type":"string","description":"Order owner public key"},"marketId":{"type":"string","description":"Associated market identifier"},"marketIdHash":{"type":"string","description":"Hashed market identifier used for on-chain PDAs"},"positionPubkey":{"type":"string","description":"Position PDA used for the order"},"isBuy":{"type":"boolean","description":"True when the order increases exposure"},"isYes":{"type":"boolean","description":"True when the order is on the YES side"},"contracts":{"type":"string","description":"Legacy whole-contract quantity string, floored for compatibility"},"contractsMicro":{"type":"string","description":"Exact order quantity in micro-contract units (1000000 = 1)"},"contractsDecimal":{"type":"string","description":"Exact order quantity as a decimal string"},"newContracts":{"type":"string","description":"Legacy position whole-contract quantity after the order, floored"},"newContractsMicro":{"type":"string","description":"Exact position quantity after the order in micro-contract units (1000000 = 1)"},"newContractsDecimal":{"type":"string","description":"Exact position quantity after the order as a decimal string"},"maxBuyPriceUsd":{"type":"string","nullable":true,"description":"Max fill price for buys (micro USD)"},"minSellPriceUsd":{"type":"string","nullable":true,"description":"Min fill price for sells (micro USD)"},"externalOrderId":{"type":"string","nullable":true,"description":"Client provided order identifier"},"orderCostUsd":{"type":"string","description":"Total spend required for this order in micro USD"},"newAvgPriceUsd":{"type":"string","description":"Average position entry price after the order"},"newSizeUsd":{"type":"string","description":"Total position cost basis after the order"},"newPayoutUsd":{"type":"string","description":"Position max payout after the order"},"payoutUsd":{"type":"string","description":"Max payout from this order's contracts alone in micro USD, ignoring any existing position"},"estimatedProtocolFeeUsd":{"type":"string","description":"Estimated protocol fee (micro USD)"},"estimatedVenueFeeUsd":{"type":"string","description":"Estimated venue fee (micro USD)"},"estimatedIntegratorFeeUsd":{"type":"string","description":"Estimated integrator fee (micro USD)"},"estimatedTotalFeeUsd":{"type":"string","description":"Estimated total fees applied (micro USD)"}},"required":["orderPubkey","orderAtaPubkey","userPubkey","marketId","marketIdHash","positionPubkey","isBuy","isYes","contracts","contractsMicro","contractsDecimal","newContracts","newContractsMicro","newContractsDecimal","maxBuyPriceUsd","minSellPriceUsd","externalOrderId","orderCostUsd","newAvgPriceUsd","newSizeUsd","newPayoutUsd","payoutUsd","estimatedProtocolFeeUsd","estimatedVenueFeeUsd","estimatedIntegratorFeeUsd","estimatedTotalFeeUsd"]}},"required":["transaction","txMeta","externalOrderId","requiredSigners","order"]},"CreateOrderRequest":{"type":"object","properties":{"ownerPubkey":{"type":"string","description":"Order owner public key"},"userPubkey":{"type":"string","description":"Order owner public key (deprecated alias; use ownerPubkey)"},"payerPubkey":{"type":"string","description":"Fee payer public key (defaults to ownerPubkey when omitted)"},"integrator":{"type":"string","description":"Integrator public key for fee sharing"},"integratorFeeBps":{"type":"integer","nullable":true,"description":"Integrator fee in basis points (0-10000)"},"marketId":{"type":"string","minLength":1,"description":"Hashed or canonical market ID for buys"},"positionPubkey":{"type":"string","minLength":32,"description":"Required for sells"},"isYes":{"type":"boolean"},"isBuy":{"type":"boolean"},"contracts":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Legacy whole-contract quantity. Use contractsMicro or contractsDecimal for exact fractional quantities."},"contractsMicro":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Exact contract quantity in micro-contract units (1000000 = 1)"},"contractsDecimal":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Exact contract quantity as a decimal string, e.g. 5.777773"},"maxBuyPriceUsd":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Must be between 10000 ($0.01) to 999999 ($0.99)"},"minSellPriceUsd":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Must be between 10000 ($0.01) to 999999 ($0.99)"},"depositAmount":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Amount must conform to the token decimals used by the token mint in `depositMint`"},"depositMint":{"type":"string","default":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","description":"Mint address for the deposit token"},"orderType":{"type":"string","enum":["market","limit"],"default":"market","description":"Order type. Limit orders are temporarily disabled."},"skipSigning":{"type":"boolean","default":false,"description":"When true, returns an unsigned transaction for use with POST /execute. Defaults to false (authority-signed) for backwards compatibility."},"returnQuoteOnInsufficientFunds":{"type":"boolean","default":false,"description":"When true, an order whose owner cannot cover the deposit returns a quote-only response (transaction, txMeta, externalOrderId, orderPubkey, and orderAtaPubkey are null) instead of failing with INSUFFICIENT_FUNDS. Defaults to false."}},"required":["isBuy"]},"CloseOrderResponse":{"type":"object","properties":{"transaction":{"type":"string","description":"Base64 encoded transaction"},"blockhash":{"type":"string"},"lastValidBlockHeight":{"type":"integer","minimum":0},"requiredSigners":{"type":"array","items":{"type":"string"}},"computeUnits":{"type":"integer","minimum":0},"orderPubkey":{"type":"string"},"accounts":{"type":"object","properties":{"owner":{"type":"string"},"authority":{"type":"string"},"vault":{"type":"string"},"marketId":{"type":"string"},"position":{"type":"string"},"order":{"type":"string"},"orderAta":{"type":"string"},"ownerTokenAccount":{"type":"string"},"settlementMint":{"type":"string"}},"required":["owner","authority","vault","marketId","position","order","orderAta","ownerTokenAccount","settlementMint"]}},"required":["transaction","blockhash","lastValidBlockHeight","requiredSigners","computeUnits","orderPubkey","accounts"]},"CloseOrderRequest":{"type":"object","properties":{"ownerPubkey":{"type":"string","minLength":32,"description":"Order owner public key"},"userPubkey":{"type":"string","minLength":32,"description":"Order owner public key (deprecated alias; use ownerPubkey)"},"payerPubkey":{"type":"string","description":"Fee payer public key (defaults to ownerPubkey when omitted)"},"orderPubkey":{"type":"string","minLength":32},"skipSigning":{"type":"boolean","default":false,"description":"When true, returns an unsigned transaction for use with POST /execute."}},"required":["orderPubkey"]},"CloseAllOrdersRequest":{"type":"object","properties":{"ownerPubkey":{"type":"string","minLength":32,"description":"Order owner public key"},"userPubkey":{"type":"string","minLength":32,"description":"Order owner public key (deprecated alias; use ownerPubkey)"},"payerPubkey":{"type":"string","description":"Fee payer public key (defaults to ownerPubkey when omitted)"},"statuses":{"type":"array","items":{"type":"string","enum":["pending","filled","failed"]}}}},"GetParlayStatsResponse":{"type":"object","properties":{"slipCount":{"type":"integer","minimum":0},"uniqueWalletCount":{"type":"integer","minimum":0},"freeSlipCount":{"type":"integer","minimum":0}},"required":["slipCount","uniqueWalletCount","freeSlipCount"]},"ParlaySlipLeg":{"type":"object","properties":{"eventId":{"type":"string"},"marketId":{"type":"string"}},"required":["eventId","marketId"]},"ParlaySlipExecutionStatus":{"type":"string","enum":["pending","success","failed"]},"ParlaySlip":{"type":"object","properties":{"parlayId":{"type":"string","description":"Synthetic parlay id (`PY-` + 29-char hex)"},"positionPubkey":{"type":"string","nullable":true,"description":"On-chain Position PDA address. Null for free parlays."},"legs":{"type":"array","items":{"$ref":"#/components/schemas/ParlaySlipLeg"}},"mode":{"type":"string","enum":["paid","free"]},"stakeUsd":{"type":"string","description":"Decimal USD string. Always \"0\" for free."},"payoutUsd":{"type":"string","description":"Decimal USD string"},"placedAt":{"type":"integer","description":"Unix timestamp in milliseconds"},"claimable":{"type":"boolean"},"isClaimed":{"type":"boolean"},"executionStatus":{"$ref":"#/components/schemas/ParlaySlipExecutionStatus"}},"required":["parlayId","positionPubkey","legs","mode","stakeUsd","payoutUsd","placedAt","claimable","isClaimed","executionStatus"]},"GetParlaySlipsResponse":{"type":"object","properties":{"slips":{"type":"array","items":{"$ref":"#/components/schemas/ParlaySlip"}}},"required":["slips"]},"CreateParlayOk":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"transaction":{"type":"string","description":"Base64-encoded, server partially-signed transaction"},"parlayId":{"type":"string","description":"Derived synthetic parlay id (`PY-` + 29-char hex)"},"nonce":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"Build nonce used to derive parlayId"},"positionPubkey":{"type":"string","description":"On-chain Position PDA address"},"orderPubkey":{"type":"string","description":"On-chain Order PDA address"},"ownerPubkey":{"type":"string"},"legMarketIds":{"type":"array","items":{"type":"string","minLength":1},"description":"Exactly 5 distinct canonical market ids (YES side)."},"stakeUsd":{"type":"string","description":"JUPUSD micro-units encoded as the parlay stake escrow amount"},"txMeta":{"type":"object","properties":{"blockhash":{"type":"string"},"lastValidBlockHeight":{"type":"integer"}},"required":["blockhash","lastValidBlockHeight"]}},"required":["status","transaction","parlayId","nonce","positionPubkey","orderPubkey","ownerPubkey","legMarketIds","stakeUsd","txMeta"]},"CreateParlayItemError":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"code":{"type":"string"},"message":{"type":"string"}},"required":["status","code","message"]},"CreateParlayItemResult":{"oneOf":[{"$ref":"#/components/schemas/CreateParlayOk"},{"$ref":"#/components/schemas/CreateParlayItemError"}],"discriminator":{"propertyName":"status","mapping":{"ok":"#/components/schemas/CreateParlayOk","error":"#/components/schemas/CreateParlayItemError"}}},"CreateParlaysResponse":{"type":"object","properties":{"parlays":{"type":"array","items":{"$ref":"#/components/schemas/CreateParlayItemResult"}}},"required":["parlays"]},"CreateParlayItem":{"type":"object","properties":{"ownerPubkey":{"type":"string","minLength":1,"description":"Parlay owner wallet pubkey"},"payerPubkey":{"type":"string","minLength":1,"description":"Optional fee payer pubkey. When omitted, the configured gasless sponsor may pay; otherwise ownerPubkey pays."},"legMarketIds":{"type":"array","items":{"type":"string","minLength":1},"description":"Exactly 5 distinct canonical market ids (YES side)."},"mint":{"type":"string","enum":["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","JuprjznTrTSp2UFa3ZBUFgwdAmtZCq4MQCwysN55USD"],"description":"Token mint the user pays with. Must be USDC or JUPUSD. The user always pays exactly 10_000_000 micro-units; USDC is Jupiter-swapped (ExactIn) into JUPUSD before the parlay stake is locked. Pass the JUPUSD mint to skip the swap."}},"required":["ownerPubkey","legMarketIds","mint"],"additionalProperties":false},"CreateParlaysBody":{"type":"object","properties":{"parlays":{"type":"array","items":{"$ref":"#/components/schemas/CreateParlayItem"},"minItems":1,"maxItems":10,"description":"1..10 parlays to build in one request."}},"required":["parlays"],"additionalProperties":false},"PrepareFreeParlayResponse":{"type":"object","properties":{"paymentTransaction":{"type":"string","description":"Base64-encoded unsigned Solana transaction containing a request-binding memo and one SOL transfer per parlay. Sign with the owner wallet and POST to /parlays/free/submit."}},"required":["paymentTransaction"]},"CreateFreeParlayItem":{"type":"object","properties":{"legMarketIds":{"type":"array","items":{"type":"string","minLength":1},"description":"Exactly 5 distinct canonical market ids (YES side)."}},"required":["legMarketIds"],"additionalProperties":false},"PrepareFreeParlayBody":{"type":"object","properties":{"ownerPubkey":{"type":"string","minLength":1,"description":"Parlay owner wallet pubkey"},"parlays":{"type":"array","items":{"$ref":"#/components/schemas/CreateFreeParlayItem"},"minItems":1,"maxItems":10,"description":"1..10 free parlays to create in one request."}},"required":["ownerPubkey","parlays"],"additionalProperties":false},"SubmitFreeParlayOk":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"parlayId":{"type":"string","description":"Derived synthetic parlay id (`PY-` + 29-char hex)"},"ownerPubkey":{"type":"string"},"legMarketIds":{"type":"array","items":{"type":"string","minLength":1},"description":"Exactly 5 distinct canonical market ids (YES side)."},"placedAt":{"type":"integer","description":"Unix timestamp in milliseconds"}},"required":["status","parlayId","ownerPubkey","legMarketIds","placedAt"]},"SubmitFreeParlayItemError":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"code":{"type":"string"},"message":{"type":"string"}},"required":["status","code","message"]},"SubmitFreeParlayItemResult":{"oneOf":[{"$ref":"#/components/schemas/SubmitFreeParlayOk"},{"$ref":"#/components/schemas/SubmitFreeParlayItemError"}],"discriminator":{"propertyName":"status","mapping":{"ok":"#/components/schemas/SubmitFreeParlayOk","error":"#/components/schemas/SubmitFreeParlayItemError"}}},"SubmitFreeParlayResponse":{"type":"object","properties":{"txSignature":{"type":"string","description":"Solana transaction signature for the confirmed entry-fee payment."},"parlays":{"type":"array","items":{"$ref":"#/components/schemas/SubmitFreeParlayItemResult"}}},"required":["txSignature","parlays"]},"SubmitFreeParlayBody":{"type":"object","properties":{"ownerPubkey":{"type":"string","minLength":1,"description":"Parlay owner wallet pubkey"},"parlays":{"type":"array","items":{"$ref":"#/components/schemas/CreateFreeParlayItem"},"minItems":1,"maxItems":10,"description":"1..10 free parlays to create in one request."},"signedTransaction":{"type":"string","minLength":1,"description":"Base64-encoded signed Solana transaction returned by /parlays/free. The transaction memo must match ownerPubkey, parlays, fee recipient, and fee amount."}},"required":["ownerPubkey","parlays","signedTransaction"],"additionalProperties":false},"ExecuteParlayOk":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"parlayId":{"type":"string"},"txSignature":{"type":"string","description":"On-chain transaction signature"}},"required":["status","parlayId","txSignature"]},"ExecuteParlayItemError":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"parlayId":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["status","parlayId","code","message"]},"ExecuteParlayItemResult":{"oneOf":[{"$ref":"#/components/schemas/ExecuteParlayOk"},{"$ref":"#/components/schemas/ExecuteParlayItemError"}],"discriminator":{"propertyName":"status","mapping":{"ok":"#/components/schemas/ExecuteParlayOk","error":"#/components/schemas/ExecuteParlayItemError"}}},"ExecuteParlaysResponse":{"type":"object","properties":{"parlays":{"type":"array","items":{"$ref":"#/components/schemas/ExecuteParlayItemResult"}}},"required":["parlays"]},"ExecuteParlayItem":{"type":"object","properties":{"signedTransaction":{"type":"string","minLength":1,"description":"Fully signed base64-encoded transaction returned by /parlays"},"parlayId":{"type":"string","minLength":1},"nonce":{"type":"integer","minimum":0,"exclusiveMinimum":true},"ownerPubkey":{"type":"string","minLength":1},"positionPubkey":{"type":"string","minLength":1},"legMarketIds":{"type":"array","items":{"type":"string","minLength":1},"description":"Exactly 5 distinct canonical market ids (YES side)."}},"required":["signedTransaction","parlayId","nonce","ownerPubkey","positionPubkey","legMarketIds"],"additionalProperties":false},"ExecuteParlaysBody":{"type":"object","properties":{"parlays":{"type":"array","items":{"$ref":"#/components/schemas/ExecuteParlayItem"},"minItems":1,"maxItems":10,"description":"1..10 parlays to execute in one request."}},"required":["parlays"],"additionalProperties":false},"Position":{"type":"object","properties":{"pubkey":{"type":"string","description":"Position account public key"},"owner":{"type":"string","description":"Position owner public key"},"ownerPubkey":{"type":"string","description":"Position owner public key (alias of owner, prefer ownerPubkey going forward)"},"market":{"type":"string","description":"Deterministic market PDA derived from marketId"},"marketId":{"type":"string","description":"External market identifier (ticker)"},"marketIdHash":{"type":"string","description":"Hashed market identifier used for on-chain PDAs"},"isYes":{"type":"boolean","description":"True if this is a YES position"},"contracts":{"type":"string","description":"Legacy whole-contract quantity string, floored for compatibility"},"contractsMicro":{"type":"string","description":"Exact contracts held in micro-contract units (u64 as string, 1000000 = 1)"},"contractsDecimal":{"type":"string","description":"Exact contracts held as a decimal string"},"totalCostUsd":{"type":"string","description":"Total cost basis in micro USD (u128 as string)"},"sizeUsd":{"type":"string","description":"Alias of total cost basis in micro USD (u128 as string)"},"valueUsd":{"type":"string","nullable":true,"description":"Mark-to-market value in micro USD (u128 as string); null once market is closed"},"avgPriceUsd":{"type":"string","description":"Average entry price per contract in micro USD (u64 as string)"},"markPriceUsd":{"type":"string","nullable":true,"description":"Current mark price per contract in micro USD (u64 as string); null once market is closed"},"sellPriceUsd":{"type":"string","nullable":true,"description":"Current best exit price for this side (micro USD string), or null when unavailable"},"pnlUsd":{"type":"string","nullable":true,"description":"Unrealized PnL in micro USD (i128 as string); null once market is closed"},"pnlUsdPercent":{"type":"number","nullable":true,"description":"Unrealized PnL percentage relative to size; null once market is closed"},"pnlUsdAfterFees":{"type":"string","nullable":true,"description":"Unrealized PnL after fees in micro USD (i128 as string); null once market is closed"},"pnlUsdAfterFeesPercent":{"type":"number","nullable":true,"description":"Unrealized PnL after fees percentage relative to size; null once market is closed"},"openOrders":{"type":"integer","minimum":0,"description":"Number of open orders"},"feesPaidUsd":{"type":"string","description":"Total fees paid in micro USD (u64 as string)"},"integratorFeeUsd":{"type":"string","description":"Total integrator fees in micro USD (u64 as string)"},"realizedPnlUsd":{"type":"number","description":"Realized PnL in micro USD (i64 as number)"},"claimed":{"type":"boolean","description":"Whether payout has been claimed"},"claimedUsd":{"type":"string","description":"Amount claimed in micro USD (u64 as string)"},"openedAt":{"type":"integer","description":"Unix timestamp when the position was opened"},"updatedAt":{"type":"integer","description":"Unix timestamp of the last position update"},"claimableAt":{"type":"integer","nullable":true,"description":"Unix timestamp (seconds) when the position becomes claimable; null when unavailable"},"payoutUsd":{"type":"string","description":"Expected payout in micro USD based on the current settlement state"},"bump":{"type":"integer","minimum":0},"eventId":{"type":"string","description":"External event identifier if available"},"eventMetadata":{"$ref":"#/components/schemas/EventMetadata"},"marketMetadata":{"$ref":"#/components/schemas/MarketMetadata"},"settlementDate":{"type":"integer","nullable":true,"description":"Unix timestamp (seconds) when the market settles; null when unavailable"},"claimable":{"type":"boolean","description":"True when the position qualifies for payout claim"}},"required":["pubkey","owner","ownerPubkey","market","marketId","marketIdHash","isYes","contracts","contractsMicro","contractsDecimal","totalCostUsd","sizeUsd","valueUsd","avgPriceUsd","markPriceUsd","sellPriceUsd","pnlUsd","pnlUsdPercent","pnlUsdAfterFees","pnlUsdAfterFeesPercent","openOrders","feesPaidUsd","integratorFeeUsd","realizedPnlUsd","claimed","claimedUsd","openedAt","updatedAt","claimableAt","payoutUsd","bump","eventId","eventMetadata","marketMetadata","settlementDate","claimable"]},"ClosePositionRequest":{"type":"object","properties":{"ownerPubkey":{"type":"string","minLength":32,"description":"Position owner public key"},"userPubkey":{"type":"string","minLength":32,"description":"Position owner public key (deprecated alias; use ownerPubkey)"},"payerPubkey":{"type":"string","description":"Fee payer public key (defaults to ownerPubkey when omitted)"}}},"ClaimPositionResponse":{"type":"object","properties":{"transaction":{"type":"string","description":"Base64 encoded transaction"},"txMeta":{"type":"object","properties":{"blockhash":{"type":"string"},"lastValidBlockHeight":{"type":"integer","minimum":0}},"required":["blockhash","lastValidBlockHeight"]},"requiredSigners":{"type":"array","items":{"type":"string"},"description":"Public keys that must sign the transaction"},"position":{"type":"object","properties":{"positionPubkey":{"type":"string","description":"Position account public key"},"marketPubkey":{"type":"string","description":"Market account public key"},"userPubkey":{"type":"string","description":"User public key requesting claim"},"ownerPubkey":{"type":"string","description":"Position owner public key"},"isYes":{"type":"boolean"},"contracts":{"type":"string","description":"Legacy settled whole-contract quantity string, floored for compatibility"},"contractsMicro":{"type":"string","description":"Exact settled contract quantity in micro-contract units (u64 as string)"},"contractsDecimal":{"type":"string","description":"Exact settled contract quantity as a decimal string"},"payoutAmountUsd":{"type":"string","description":"Payout amount in micro USD (u64 as string)"}},"required":["positionPubkey","marketPubkey","userPubkey","ownerPubkey","isYes","contracts","contractsMicro","contractsDecimal","payoutAmountUsd"]}},"required":["transaction","txMeta","requiredSigners","position"]},"CloseAllPositionsRequest":{"type":"object","properties":{"ownerPubkey":{"type":"string","minLength":32,"description":"Position owner public key"},"userPubkey":{"type":"string","minLength":32,"description":"Position owner public key (deprecated alias; use ownerPubkey)"},"payerPubkey":{"type":"string","description":"Fee payer public key (defaults to ownerPubkey when omitted)"},"minSellPriceSlippageBps":{"type":"integer","nullable":true,"minimum":0,"maximum":10000}},"required":["minSellPriceSlippageBps"]},"ClaimPositionRequest":{"type":"object","properties":{"ownerPubkey":{"type":"string","minLength":32,"description":"Position owner public key"},"userPubkey":{"type":"string","minLength":32,"description":"Position owner public key (deprecated alias; use ownerPubkey)"},"payerPubkey":{"type":"string","description":"Fee payer public key (defaults to ownerPubkey when omitted)"}}},"HistoryEvent":{"type":"object","properties":{"id":{"type":"integer"},"eventType":{"type":"string","enum":["order_created","order_closed","order_filled","order_failed","payout_claimed","position_updated","position_lost"]},"signature":{"type":"string"},"slot":{"type":"string"},"timestamp":{"type":"integer"},"orderPubkey":{"type":"string"},"positionPubkey":{"type":"string"},"marketId":{"type":"string"},"ownerPubkey":{"type":"string"},"keeperPubkey":{"type":"string"},"externalOrderId":{"type":"string"},"orderId":{"type":"string"},"isBuy":{"type":"boolean"},"isYes":{"type":"boolean"},"contracts":{"type":"string"},"contractsMicro":{"type":"string"},"contractsDecimal":{"type":"string"},"filledContracts":{"type":"string"},"filledContractsMicro":{"type":"string"},"filledContractsDecimal":{"type":"string"},"contractsSettled":{"type":"string"},"contractsSettledMicro":{"type":"string"},"contractsSettledDecimal":{"type":"string"},"maxFillPriceUsd":{"type":"string"},"avgFillPriceUsd":{"type":"string"},"maxBuyPriceUsd":{"type":"string","nullable":true},"minSellPriceUsd":{"type":"string","nullable":true},"depositAmountUsd":{"type":"string"},"totalCostUsd":{"type":"string"},"feeUsd":{"type":"string","nullable":true},"grossProceedsUsd":{"type":"string"},"netProceedsUsd":{"type":"string"},"transferAmountToken":{"type":"string","nullable":true},"realizedPnl":{"type":"string","nullable":true},"realizedPnlBeforeFees":{"type":"string","nullable":true},"payoutAmountUsd":{"type":"string"},"eventId":{"type":"string"},"marketMetadata":{"$ref":"#/components/schemas/MarketMetadata"},"eventMetadata":{"$ref":"#/components/schemas/EventMetadata"}},"required":["id","eventType","signature","slot","timestamp","orderPubkey","positionPubkey","marketId","ownerPubkey","keeperPubkey","externalOrderId","orderId","isBuy","isYes","contracts","contractsMicro","contractsDecimal","filledContracts","filledContractsMicro","filledContractsDecimal","contractsSettled","contractsSettledMicro","contractsSettledDecimal","maxFillPriceUsd","avgFillPriceUsd","maxBuyPriceUsd","minSellPriceUsd","depositAmountUsd","totalCostUsd","feeUsd","grossProceedsUsd","netProceedsUsd","transferAmountToken","realizedPnl","realizedPnlBeforeFees","payoutAmountUsd","eventId","marketMetadata","eventMetadata"]},"TradingStatusResponse":{"type":"object","properties":{"trading_active":{"type":"boolean"}},"required":["trading_active"]},"Trades":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"ownerPubkey":{"type":"string"},"marketId":{"type":"string"},"message":{"type":"string"},"timestamp":{"type":"number"},"action":{"type":"string","enum":["buy","sell"]},"side":{"type":"string","enum":["yes","no"]},"eventTitle":{"type":"string"},"marketTitle":{"type":"string"},"amountUsd":{"type":"string"},"priceUsd":{"type":"string"},"eventImageUrl":{"type":"string"},"eventId":{"type":"string"},"isTeamMarket":{"type":"boolean"},"marketOptions":{"type":"array","nullable":true,"items":{"type":"object","properties":{},"additionalProperties":{"nullable":true}},"description":"Structured options for FE display (e.g. [{ label: \"O 228.5\", buyYes: true }])"}},"required":["id","ownerPubkey","marketId","message","timestamp","action","side","eventTitle","marketTitle","amountUsd","priceUsd","eventImageUrl","eventId","isTeamMarket","marketOptions"]}}},"required":["data"]},"HistoryEventV2Child":{"type":"object","properties":{"id":{"type":"integer"},"eventType":{"type":"string","enum":["order_created","order_closed","order_filled","order_failed","payout_claimed","position_updated","position_lost"]},"signature":{"type":"string"},"slot":{"type":"string"},"timestamp":{"type":"integer"},"orderPubkey":{"type":"string"},"positionPubkey":{"type":"string"},"marketId":{"type":"string"},"ownerPubkey":{"type":"string"},"keeperPubkey":{"type":"string"},"externalOrderId":{"type":"string"},"orderId":{"type":"string"},"isBuy":{"type":"boolean"},"isYes":{"type":"boolean"},"contracts":{"type":"string"},"contractsMicro":{"type":"string"},"contractsDecimal":{"type":"string"},"filledContracts":{"type":"string"},"filledContractsMicro":{"type":"string"},"filledContractsDecimal":{"type":"string"},"contractsSettled":{"type":"string"},"contractsSettledMicro":{"type":"string"},"contractsSettledDecimal":{"type":"string"},"maxFillPriceUsd":{"type":"string"},"avgFillPriceUsd":{"type":"string"},"maxBuyPriceUsd":{"type":"string","nullable":true},"minSellPriceUsd":{"type":"string","nullable":true},"depositAmountUsd":{"type":"string"},"totalCostUsd":{"type":"string"},"feeUsd":{"type":"string","nullable":true},"grossProceedsUsd":{"type":"string"},"netProceedsUsd":{"type":"string"},"transferAmountToken":{"type":"string","nullable":true},"realizedPnl":{"type":"string","nullable":true},"realizedPnlBeforeFees":{"type":"string","nullable":true},"payoutAmountUsd":{"type":"string"},"eventId":{"type":"string"},"marketMetadata":{"$ref":"#/components/schemas/MarketMetadata"},"eventMetadata":{"$ref":"#/components/schemas/EventMetadata"}},"required":["id","eventType","signature","slot","timestamp","orderPubkey","positionPubkey","marketId","ownerPubkey","keeperPubkey","externalOrderId","orderId","isBuy","isYes","contracts","contractsMicro","contractsDecimal","filledContracts","filledContractsMicro","filledContractsDecimal","contractsSettled","contractsSettledMicro","contractsSettledDecimal","maxFillPriceUsd","avgFillPriceUsd","maxBuyPriceUsd","minSellPriceUsd","depositAmountUsd","totalCostUsd","feeUsd","grossProceedsUsd","netProceedsUsd","transferAmountToken","realizedPnl","realizedPnlBeforeFees","payoutAmountUsd","eventId","marketMetadata","eventMetadata"]},"PositionHistory":{"type":"object","properties":{"positionPubkey":{"type":"string"},"ownerPubkey":{"type":"string"},"marketId":{"type":"string"},"isYes":{"type":"boolean"},"status":{"type":"string","enum":["claimed","lost","sold","open","failed"]},"entryPriceUsd":{"type":"string","nullable":true},"exitPriceUsd":{"type":"string","nullable":true},"totalContracts":{"type":"string"},"totalContractsMicro":{"type":"string"},"totalContractsDecimal":{"type":"string"},"realizedPnlUsd":{"type":"string","nullable":true},"feesPaidUsd":{"type":"string"},"openedAt":{"type":"integer"},"closedAt":{"type":"integer","nullable":true},"marketMetadata":{"$ref":"#/components/schemas/MarketMetadata"},"eventMetadata":{"$ref":"#/components/schemas/EventMetadata"},"events":{"type":"array","items":{"$ref":"#/components/schemas/HistoryEventV2Child"}}},"required":["positionPubkey","ownerPubkey","marketId","isYes","status","entryPriceUsd","exitPriceUsd","totalContracts","totalContractsMicro","totalContractsDecimal","realizedPnlUsd","feesPaidUsd","openedAt","closedAt","marketMetadata","eventMetadata","events"]},"PositionsV2Response":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/Position"}},"description":"Positions grouped by owner public key. Every requested pubkey is present as a key, with an empty array when the owner has no matching positions."}},"required":["data"]}},"parameters":{}},"paths":{"/api/v1/events/tags":{"get":{"tags":["Events"],"parameters":[{"schema":{"type":"string","enum":["all","crypto","sports","politics","esports","culture","economics","tech","finance","climate & science","weather","mentions"],"description":"Category to get tags for"},"required":true,"description":"Category to get tags for","name":"category","in":"query"},{"schema":{"type":"string","enum":["kalshi","polymarket"],"default":"polymarket"},"required":false,"name":"provider","in":"query"}],"responses":{"200":{"description":"Available tags for the given category with event counts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Display label for the UI"},"tag":{"type":"string","description":"Tag identifier"},"eventCount":{"type":"number","description":"Number of active events with this tag"}},"required":["label","tag","eventCount"]}}},"required":["data"]}}}}}}},"/api/v1/events/suggested":{"get":{"tags":["Events"],"parameters":[{"schema":{"type":"string","enum":["kalshi","polymarket"],"default":"polymarket","description":"Data provider for events (defaults to polymarket)"},"required":false,"description":"Data provider for events (defaults to polymarket)","name":"provider","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Event ID to exclude from the results"},"required":false,"description":"Event ID to exclude from the results","name":"excludedEventId","in":"query"},{"schema":{"type":"string","enum":["crypto","sports","politics","esports","culture","economics","tech","finance","climate & science","weather","mentions"],"description":"Event category to get suggestions for"},"required":false,"description":"Event category to get suggestions for","name":"category","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":50,"description":"Maximum number of events to return (default 5, max 50)"},"required":false,"description":"Maximum number of events to return (default 5, max 50)","name":"limit","in":"query"}],"responses":{"200":{"description":"Suggested events for the given category","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}},"required":["data"]}}}}}}},"/api/v1/events/suggested/{pubkey}":{"get":{"tags":["Events"],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Order public key to base suggested events on"},"required":true,"description":"Order public key to base suggested events on","name":"pubkey","in":"path"},{"schema":{"type":"string","enum":["kalshi","polymarket"],"default":"polymarket","description":"Data provider for events (defaults to polymarket)"},"required":false,"description":"Data provider for events (defaults to polymarket)","name":"provider","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":50,"description":"Maximum number of events to return (default 10, max 50)"},"required":false,"description":"Maximum number of events to return (default 10, max 50)","name":"limit","in":"query"}],"responses":{"200":{"description":"Suggested events derived from the user's order activity","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}},"required":["data"]}}}}}}},"/api/v1/events/degen":{"get":{"tags":["Events"],"responses":{"200":{"description":"Live crypto degen events (5m and 15m intervals) with markets included","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]}}}}}}},"/api/v1/events/degen/{symbol}":{"get":{"tags":["Events"],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Asset symbol, e.g. btc, eth, sol, doge"},"required":true,"description":"Asset symbol, e.g. btc, eth, sol, doge","name":"symbol","in":"path"}],"responses":{"200":{"description":"Current live degen event and market IDs for the given asset symbol","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}},"required":["data"]}}}},"404":{"description":"No live degen event found for the given symbol","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/events/crypto/timed":{"get":{"tags":["Events"],"parameters":[{"schema":{"type":"string","enum":["kalshi","polymarket"],"default":"polymarket","description":"Data provider for events (defaults to polymarket)"},"required":false,"description":"Data provider for events (defaults to polymarket)","name":"provider","in":"query"},{"schema":{"type":"string","enum":["btc","eth","xrp","sol","hype","doge","bnb"],"description":"Crypto subcategory"},"required":true,"description":"Crypto subcategory","name":"subcategory","in":"query"},{"schema":{"type":"string","enum":["5m","15m"],"description":"Timed event interval tag"},"required":true,"description":"Timed event interval tag","name":"tags","in":"query"}],"responses":{"200":{"description":"Timed crypto events for the given subcategory and interval, including events from the past 5 hours and all future events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}},"required":["data"]}}}}}}},"/api/v1/events/search":{"get":{"tags":["Events"],"parameters":[{"schema":{"type":"string","enum":["kalshi","polymarket"],"default":"polymarket","description":"Data provider for events (defaults to polymarket)"},"required":false,"description":"Data provider for events (defaults to polymarket)","name":"provider","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search term matched against event titles"},"required":true,"description":"Search term matched against event titles","name":"query","in":"query"},{"schema":{"type":"string","description":"Include markets in the response (defaults to false)"},"required":false,"description":"Include markets in the response (defaults to false)","name":"includeMarkets","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"start","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"end","in":"query"}],"responses":{"200":{"description":"Events matching the search query","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]}}}}}}},"/api/v1/events/closed":{"get":{"tags":["Events"],"parameters":[{"schema":{"type":"string","enum":["kalshi","polymarket"],"default":"polymarket","description":"Data provider for events (defaults to polymarket)"},"required":false,"description":"Data provider for events (defaults to polymarket)","name":"provider","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"Unix timestamp (seconds) to fetch events updated after this time (defaults to 24 hours ago)"},"required":false,"description":"Unix timestamp (seconds) to fetch events updated after this time (defaults to 24 hours ago)","name":"since","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"start","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"end","in":"query"}],"responses":{"200":{"description":"Recently closed events with all their markets (both open and closed). An event is included if it has been updated recently or has recently closed markets.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"timestamp":{"type":"string","description":"ISO 8601 timestamp of when this response was generated"}},"required":["data","pagination","timestamp"]}}}}}}},"/api/v1/events":{"get":{"tags":["Events"],"parameters":[{"schema":{"type":"string","enum":["kalshi","polymarket"],"default":"polymarket","description":"Data provider for events (defaults to polymarket)"},"required":false,"description":"Data provider for events (defaults to polymarket)","name":"provider","in":"query"},{"schema":{"type":"string"},"required":false,"name":"includeMarkets","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"start","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"end","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"description":"Page size (max 100). Convenience alternative to `end`; ignored when `end` is provided."},"required":false,"description":"Page size (max 100). Convenience alternative to `end`; ignored when `end` is provided.","name":"limit","in":"query"},{"schema":{"type":"string","enum":["all","crypto","sports","politics","esports","culture","economics","tech","finance","climate & science","weather","mentions"]},"required":false,"name":"category","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"string"}]},"required":false,"name":"subcategory","in":"query"},{"schema":{"type":"string","description":"Comma-separated subcategories filter, e.g. sol,btc"},"required":false,"description":"Comma-separated subcategories filter, e.g. sol,btc","name":"subcategories","in":"query"},{"schema":{"type":"string","description":"Filter by tag, e.g. 15m, 5m"},"required":false,"description":"Filter by tag, e.g. 15m, 5m","name":"tag","in":"query"},{"schema":{"type":"string","description":"Filter by multiple tags (comma-separated), e.g. ?tags=5m,15m"},"required":false,"description":"Filter by multiple tags (comma-separated), e.g. ?tags=5m,15m","name":"tags","in":"query"},{"schema":{"type":"string","enum":["volume","volume24hr","beginAt"],"description":"Sort field for events. Defaults to volume24hr (24-hour trading volume). Use volume for all-time volume, or beginAt for event start time."},"required":false,"description":"Sort field for events. Defaults to volume24hr (24-hour trading volume). Use volume for all-time volume, or beginAt for event start time.","name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"description":"Direction for the chosen sort field. Defaults to desc for volume and asc for beginAt."},"required":false,"description":"Direction for the chosen sort field. Defaults to desc for volume and asc for beginAt.","name":"sortDirection","in":"query"},{"schema":{"type":"string","enum":["new","live","trending","upcoming"],"description":"Apply named filters. Use `new` for events created in the last 24 hours, `live` for events that have begun, `trending` for events with recent trade activity, and `upcoming` for events beginning within the next 3 days."},"required":false,"description":"Apply named filters. Use `new` for events created in the last 24 hours, `live` for events that have begun, `trending` for events with recent trade activity, and `upcoming` for events beginning within the next 3 days.","name":"filter","in":"query"},{"schema":{"type":"string","description":"Include all allowed sports market types (moneyline, spread, totals) and extra (e.g. Saba) markets mapped onto Polymarket events. Defaults to false (moneyline only). F1 events always include every sportsMarketType."},"required":false,"description":"Include all allowed sports market types (moneyline, spread, totals) and extra (e.g. Saba) markets mapped onto Polymarket events. Defaults to false (moneyline only). F1 events always include every sportsMarketType.","name":"includeAllMarkets","in":"query"}],"responses":{"200":{"description":"List of active events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]}}}}}}},"/api/v1/events/scores":{"get":{"tags":["Events"],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Comma-separated event IDs to fetch live scores for (max 100)"},"required":true,"description":"Comma-separated event IDs to fetch live scores for (max 100)","name":"eventIds","in":"query"}],"responses":{"200":{"description":"Latest live scores for the given event IDs. Events without a score row are omitted from the response.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GameScore"}}},"required":["data"]}}}}}}},"/api/v1/events/{eventId}/score":{"get":{"tags":["Events"],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Event identifier"},"required":true,"description":"Event identifier","name":"eventId","in":"path"}],"responses":{"200":{"description":"Latest live score for the event. Returns null if no score row exists.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/GameScore"},{"nullable":true}]}}}}}}},"/api/v1/events/{eventId}":{"get":{"tags":["Events"],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Event identifier"},"required":true,"description":"Event identifier","name":"eventId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"includeMarkets","in":"query"},{"schema":{"type":"string","description":"Include all allowed sports market types (moneyline, spread, totals) and extra (e.g. Saba) markets mapped onto Polymarket events. Defaults to false (moneyline only). F1 events always include every sportsMarketType."},"required":false,"description":"Include all allowed sports market types (moneyline, spread, totals) and extra (e.g. Saba) markets mapped onto Polymarket events. Defaults to false (moneyline only). F1 events always include every sportsMarketType.","name":"includeAllMarkets","in":"query"}],"responses":{"200":{"description":"Event data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"404":{"description":"Event not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/events/{eventId}/markets":{"get":{"tags":["Markets"],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Event identifier"},"required":true,"description":"Event identifier","name":"eventId","in":"path"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"start","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"end","in":"query"}],"responses":{"200":{"description":"List of markets for the given event","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Market"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]}}}}}}},"/api/v1/events/{eventId}/markets/{marketId}":{"get":{"tags":["Markets"],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Event identifier"},"required":true,"description":"Event identifier","name":"eventId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Market identifier"},"required":true,"description":"Market identifier","name":"marketId","in":"path"}],"responses":{"200":{"description":"Market data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"404":{"description":"Market not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/markets/{marketId}":{"get":{"tags":["Markets"],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Market identifier"},"required":true,"description":"Market identifier","name":"marketId","in":"path"}],"responses":{"200":{"description":"Market data with parent event ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketWithEvent"}}}},"404":{"description":"Market not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/execute":{"post":{"tags":["Execution"],"description":"Canonical executor endpoint. Cosigns and/or submits a signed transaction returned by transaction-building endpoints such as POST /orders, DELETE /orders, or POST /positions/{positionPubkey}/claim.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteOrderRequest"}}}},"responses":{"200":{"description":"Transaction execution result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteOrderResponse"}}}},"400":{"description":"Invalid transaction or missing signatures","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/orders":{"get":{"tags":["Orders"],"parameters":[{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"start","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"end","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"ownerPubkey","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Order owner public key (deprecated alias; use ownerPubkey)"},"required":false,"description":"Order owner public key (deprecated alias; use ownerPubkey)","name":"userPubkey","in":"query"}],"responses":{"200":{"description":"List of all orders registered on-chain","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"pagination":{"type":"object","properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":0},"hasNext":{"type":"boolean"}},"required":["start","end","total","hasNext"]}},"required":["data","pagination"]}}}},"400":{"description":"Failed to fetch orders","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Orders"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"200":{"description":"Transaction for creating an order (signed by authority unless skipSigning is true)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderResponse"}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Orders"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseOrderRequest"}}}},"responses":{"200":{"description":"Transaction for closing an order (signed by authority unless skipSigning is true)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseOrderResponse"}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/orders/{orderPubkey}":{"get":{"tags":["Orders"],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Order account public key"},"required":true,"description":"Order account public key","name":"orderPubkey","in":"path"}],"responses":{"200":{"description":"Order data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Failed to fetch order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/orders/status/{orderPubkey}":{"get":{"tags":["Orders"],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Order account public key"},"required":true,"description":"Order account public key","name":"orderPubkey","in":"path"}],"responses":{"200":{"description":"Latest status for an order with event history","content":{"application/json":{"schema":{"type":"object","properties":{"orderPubkey":{"type":"string"},"status":{"type":"string"},"latestEventType":{"type":"string"},"latestSignature":{"type":"string"},"externalOrderId":{"type":"string"},"orderId":{"type":"string"},"history":{"type":"array","items":{"type":"object","properties":{"eventType":{"type":"string"},"status":{"type":"string"},"rawStatus":{"type":"string"},"timestamp":{"type":"integer"},"signature":{"type":"string"},"externalOrderId":{"type":"string"},"orderId":{"type":"string"}},"required":["eventType","status","rawStatus","timestamp","signature","externalOrderId","orderId"]}}},"required":["orderPubkey","status","latestEventType","latestSignature","externalOrderId","orderId","history"]}}}},"400":{"description":"Failed to fetch order status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Order history not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/orders/execute":{"post":{"tags":["Orders"],"deprecated":true,"description":"Deprecated compatibility alias for POST /execute. The caller must sign the transaction before sending it here.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteOrderRequest"}}}},"responses":{"200":{"description":"Transaction execution result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteOrderResponse"}}}},"400":{"description":"Invalid transaction or missing signatures","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/orders/close-all":{"delete":{"tags":["Orders"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseAllOrdersRequest"}}}},"responses":{"200":{"description":"Unsigned transactions to close all pending orders","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CloseOrderResponse"}}},"required":["data"]}}}},"400":{"description":"Unable to build close order transactions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/parlays/stats":{"get":{"tags":["Parlays"],"responses":{"200":{"description":"Aggregate paid parlay stats and total free slips.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetParlayStatsResponse"}}}}}}},"/api/v1/parlays":{"get":{"tags":["Parlays"],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Parlay owner wallet pubkey"},"required":true,"description":"Parlay owner wallet pubkey","name":"walletAddress","in":"query"}],"responses":{"200":{"description":"Parlay slips for an owner wallet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetParlaySlipsResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Parlays"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateParlaysBody"}}}},"responses":{"200":{"description":"Per-item build results. Each entry is either a partially-signed transaction or a per-item error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateParlaysResponse"}}}},"400":{"description":"Invalid request (request-level validation failure)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/parlays/free":{"post":{"tags":["Parlays"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrepareFreeParlayBody"}}}},"responses":{"200":{"description":"Unsigned entry-fee payment transaction. The owner wallet should sign it and POST the result to /parlays/free/submit. The transaction includes a memo bound to the exact free-parlay request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrepareFreeParlayResponse"}}}},"400":{"description":"Invalid request (bad input, leg validation, or quota exceeded).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/parlays/free/submit":{"post":{"tags":["Parlays"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitFreeParlayBody"}}}},"responses":{"200":{"description":"Free parlays created. Entry-fee payment transaction was submitted and confirmed on-chain, and its request memo matched the submitted parlays.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitFreeParlayResponse"}}}},"400":{"description":"Invalid request (bad payment transaction, quota exceeded, or malformed input).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/parlays/execute":{"post":{"tags":["Parlays"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteParlaysBody"}}}},"responses":{"200":{"description":"Per-item execution results. Each entry is either an on-chain signature or a per-item error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteParlaysResponse"}}}},"400":{"description":"Invalid request (request-level validation failure)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/positions":{"get":{"tags":["Positions"],"parameters":[{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"start","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"end","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Position owner public key. Accepts a single value or a comma-separated list of up to 50 pubkeys."},"required":false,"description":"Position owner public key. Accepts a single value or a comma-separated list of up to 50 pubkeys.","name":"ownerPubkey","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Position owner public key (deprecated alias; use ownerPubkey). Accepts a single value or a comma-separated list of up to 50 pubkeys."},"required":false,"description":"Position owner public key (deprecated alias; use ownerPubkey). Accepts a single value or a comma-separated list of up to 50 pubkeys.","name":"userPubkey","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"marketPubkey","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"marketId","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Filter by position side (true = YES, false = NO)"},"required":false,"description":"Filter by position side (true = YES, false = NO)","name":"isYes","in":"query"}],"responses":{"200":{"description":"List of on-chain positions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Position"}},"pagination":{"type":"object","properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":0},"hasNext":{"type":"boolean"}},"required":["start","end","total","hasNext"]}},"required":["data","pagination"]}}}},"400":{"description":"Failed to fetch positions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Positions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseAllPositionsRequest"}}}},"responses":{"200":{"description":"Unsigned transactions that sell all contracts across every open position for the user","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/CreateOrderResponse"},{"$ref":"#/components/schemas/ClaimPositionResponse"}]}}},"required":["data"]}}}},"400":{"description":"Unable to build close positions transactions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/positions/{positionPubkey}":{"get":{"tags":["Positions"],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Position account public key"},"required":true,"description":"Position account public key","name":"positionPubkey","in":"path"}],"responses":{"200":{"description":"Position data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Position"}}}},"400":{"description":"Failed to fetch position","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Position not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Positions"],"parameters":[{"schema":{"type":"string","minLength":32,"description":"Position account public key"},"required":true,"description":"Position account public key","name":"positionPubkey","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClosePositionRequest"}}}},"responses":{"200":{"description":"Unsigned transaction that sells all contracts for a position","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderResponse"}}}},"400":{"description":"Unable to build close position transaction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Position not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/positions/{positionPubkey}/claim":{"post":{"tags":["Positions"],"parameters":[{"schema":{"type":"string","minLength":32,"description":"Position account public key"},"required":true,"description":"Position account public key","name":"positionPubkey","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimPositionRequest"}}}},"responses":{"200":{"description":"Unsigned transaction to claim payout for a winning position","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimPositionResponse"}}}},"400":{"description":"Unable to build claim payout transaction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Position not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/history":{"get":{"tags":["History"],"parameters":[{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"start","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"end","in":"query"},{"schema":{"type":"string","minLength":32,"description":"History owner public key"},"required":false,"description":"History owner public key","name":"ownerPubkey","in":"query"},{"schema":{"type":"string","minLength":32,"description":"History owner public key (deprecated alias; use ownerPubkey)"},"required":false,"description":"History owner public key (deprecated alias; use ownerPubkey)","name":"userPubkey","in":"query"},{"schema":{"type":"integer","minimum":1,"description":"History event ID"},"required":false,"description":"History event ID","name":"id","in":"query"},{"schema":{"type":"string","minLength":32,"description":"Filter by position public key"},"required":false,"description":"Filter by position public key","name":"positionPubkey","in":"query"}],"responses":{"200":{"description":"Paginated event history, or single event when id is provided","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/HistoryEvent"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]}}}}}}},"/api/v1/forecast":{"get":{"tags":["Forecast"],"responses":{"200":{"description":"Forecast data from price service","content":{"application/json":{"schema":{"nullable":true,"description":"Forecast response payload"}}}},"502":{"description":"Failed to fetch forecast data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/trading-status":{"get":{"tags":["Trading"],"responses":{"200":{"description":"Current Kalshi exchange trading status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradingStatusResponse"}}}}}}},"/api/v1/orderbook/{marketId}":{"get":{"tags":["Orderbook"],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Kalshi market identifier","example":"KXF1-25-LN"},"required":true,"description":"Kalshi market identifier","name":"marketId","in":"path"}],"responses":{"200":{"description":"Orderbook data from price service","content":{"application/json":{"schema":{"nullable":true,"description":"Forecast response payload"}}}},"502":{"description":"Failed to fetch forecast data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/profiles/batch":{"get":{"tags":["Profile"],"parameters":[{"schema":{"type":"string","description":"Comma-separated Solana public keys (max 100)"},"required":true,"description":"Comma-separated Solana public keys (max 100)","name":"wallets","in":"query"}],"responses":{"200":{"description":"Batch profile stats by period","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"type":"object","properties":{"weekly":{"type":"object","properties":{"ownerPubkey":{"type":"string"},"realizedPnlUsd":{"type":"string"},"totalVolumeUsd":{"type":"string"},"predictionsCount":{"type":"string"},"correctPredictions":{"type":"string"},"wrongPredictions":{"type":"string"}},"required":["ownerPubkey","realizedPnlUsd","totalVolumeUsd","predictionsCount","correctPredictions","wrongPredictions"]},"monthly":{"type":"object","properties":{"ownerPubkey":{"type":"string"},"realizedPnlUsd":{"type":"string"},"totalVolumeUsd":{"type":"string"},"predictionsCount":{"type":"string"},"correctPredictions":{"type":"string"},"wrongPredictions":{"type":"string"}},"required":["ownerPubkey","realizedPnlUsd","totalVolumeUsd","predictionsCount","correctPredictions","wrongPredictions"]},"all_time":{"type":"object","properties":{"ownerPubkey":{"type":"string"},"realizedPnlUsd":{"type":"string"},"totalVolumeUsd":{"type":"string"},"predictionsCount":{"type":"string"},"correctPredictions":{"type":"string"},"wrongPredictions":{"type":"string"}},"required":["ownerPubkey","realizedPnlUsd","totalVolumeUsd","predictionsCount","correctPredictions","wrongPredictions"]},"totalActiveContracts":{"type":"string","description":"Legacy active whole-contract quantity string, floored"},"totalActiveContractsMicro":{"type":"string","description":"Exact active contracts in micro-contract units (1000000 = 1)"},"totalActiveContractsDecimal":{"type":"string","description":"Exact active contracts as a decimal string"}},"required":["weekly","monthly","all_time","totalActiveContracts","totalActiveContractsMicro","totalActiveContractsDecimal"]},"description":"Profile stats per wallet, keyed by public key"}},"required":["data"]}}}},"400":{"description":"Invalid Solana public key or empty wallets param","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/profiles/{ownerPubkey}":{"get":{"tags":["Profile"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"ownerPubkey","in":"path"}],"responses":{"200":{"description":"Profile stats","content":{"application/json":{"schema":{"type":"object","properties":{"ownerPubkey":{"type":"string"},"realizedPnlUsd":{"type":"string"},"totalVolumeUsd":{"type":"string"},"predictionsCount":{"type":"string"},"correctPredictions":{"type":"string"},"wrongPredictions":{"type":"string"},"totalActiveContracts":{"type":"string","description":"Legacy active whole-contract quantity string, floored"},"totalActiveContractsMicro":{"type":"string","description":"Exact active contracts in micro-contract units (1000000 = 1)"},"totalActiveContractsDecimal":{"type":"string","description":"Exact active contracts as a decimal string"},"totalPositionsValueUsd":{"type":"string"}},"required":["ownerPubkey","realizedPnlUsd","totalVolumeUsd","predictionsCount","correctPredictions","wrongPredictions","totalActiveContracts","totalActiveContractsMicro","totalActiveContractsDecimal","totalPositionsValueUsd"]}}}},"404":{"description":"Profile not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/profiles/{ownerPubkey}/pnl-history":{"get":{"tags":["Profile"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"ownerPubkey","in":"path"},{"schema":{"type":"string","enum":["24h","1w","1m"],"default":"1w"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":1000,"default":10},"required":false,"name":"count","in":"query"}],"responses":{"200":{"description":"PnL history for charting","content":{"application/json":{"schema":{"type":"object","properties":{"ownerPubkey":{"type":"string"},"history":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"integer"},"realizedPnlUsd":{"type":"string"}},"required":["timestamp","realizedPnlUsd"]}}},"required":["ownerPubkey","history"]}}}}}}},"/api/v1/follow/{ownerPubkey}":{"post":{"tags":["Following"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"ownerPubkey","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"followerPubkey":{"type":"string"}},"required":["followerPubkey"]}}}},"responses":{"201":{"description":"Successfully followed user","content":{"application/json":{"schema":{"type":"object","properties":{"followerPubkey":{"type":"string"},"followingPubkey":{"type":"string"},"createdAt":{"type":"string"}},"required":["followerPubkey","followingPubkey","createdAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Already following","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/unfollow/{ownerPubkey}":{"delete":{"tags":["Following"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"ownerPubkey","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"followerPubkey":{"type":"string"}},"required":["followerPubkey"]}}}},"responses":{"200":{"description":"Successfully unfollowed user","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"404":{"description":"Follow relationship not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/followers/{ownerPubkey}":{"get":{"tags":["Following"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"ownerPubkey","in":"path"}],"responses":{"200":{"description":"List of followers","content":{"application/json":{"schema":{"type":"object","properties":{"followers":{"type":"array","items":{"type":"object","properties":{"pubkey":{"type":"string"},"createdAt":{"type":"string"}},"required":["pubkey","createdAt"]}},"count":{"type":"number"}},"required":["followers","count"]}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/following/{ownerPubkey}":{"get":{"tags":["Following"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"ownerPubkey","in":"path"}],"responses":{"200":{"description":"List of users being followed","content":{"application/json":{"schema":{"type":"object","properties":{"following":{"type":"array","items":{"type":"object","properties":{"pubkey":{"type":"string"},"createdAt":{"type":"string"}},"required":["pubkey","createdAt"]}},"count":{"type":"number"}},"required":["following","count"]}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/trades":{"get":{"tags":["Trades"],"responses":{"200":{"description":"Recent order_filled events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trades"}}}}}}},"/api/v1/leaderboards":{"get":{"tags":["Leaderboards"],"parameters":[{"schema":{"type":"string","enum":["all_time","weekly","monthly"],"default":"all_time"},"required":false,"name":"period","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["pnl","volume","win_rate"],"default":"pnl"},"required":false,"name":"metric","in":"query"}],"responses":{"200":{"description":"Leaderboard entries","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"ownerPubkey":{"type":"string"},"realizedPnlUsd":{"type":"string"},"totalVolumeUsd":{"type":"string"},"predictionsCount":{"type":"number"},"correctPredictions":{"type":"number"},"wrongPredictions":{"type":"number"},"winRatePct":{"type":"string"},"period":{"type":"string"},"periodStart":{"type":"string","nullable":true},"periodEnd":{"type":"string","nullable":true}},"required":["ownerPubkey","realizedPnlUsd","totalVolumeUsd","predictionsCount","correctPredictions","wrongPredictions","winRatePct","period","periodStart","periodEnd"]}},"summary":{"type":"object","properties":{"all_time":{"type":"object","properties":{"totalVolumeUsd":{"type":"string"},"predictionsCount":{"type":"number"}},"required":["totalVolumeUsd","predictionsCount"]},"weekly":{"type":"object","properties":{"totalVolumeUsd":{"type":"string"},"predictionsCount":{"type":"number"}},"required":["totalVolumeUsd","predictionsCount"]},"monthly":{"type":"object","properties":{"totalVolumeUsd":{"type":"string"},"predictionsCount":{"type":"number"}},"required":["totalVolumeUsd","predictionsCount"]}},"required":["all_time","weekly","monthly"]}},"required":["data","summary"]}}}}}}},"/api/v1/vault-info":{"get":{"tags":["Vault"],"parameters":[{"schema":{"type":"string","enum":["usdc","jupusd"],"default":"usdc","description":"Settlement mint to query the vault for","example":"usdc"},"required":false,"description":"Settlement mint to query the vault for","name":"mint","in":"query"}],"responses":{"200":{"description":"Vault account data","content":{"application/json":{"schema":{"type":"object","properties":{"pubkey":{"type":"string"},"data":{"type":"object","additionalProperties":{"type":"string"}},"vaultBalance":{"type":"string"}},"required":["pubkey","data","vaultBalance"]}}}},"404":{"description":"Vault account not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v2/history":{"get":{"tags":["HistoryV2"],"parameters":[{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"start","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"end","in":"query"},{"schema":{"type":"string","minLength":32,"description":"Position owner public key"},"required":false,"description":"Position owner public key","name":"ownerPubkey","in":"query"},{"schema":{"type":"string","minLength":32,"description":"Position owner public key (deprecated alias; use ownerPubkey)"},"required":false,"description":"Position owner public key (deprecated alias; use ownerPubkey)","name":"userPubkey","in":"query"},{"schema":{"type":"string","minLength":32,"description":"Filter by position public key"},"required":false,"description":"Filter by position public key","name":"positionPubkey","in":"query"}],"responses":{"200":{"description":"Paginated positions for the owner with child events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PositionHistory"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]}}}}}}},"/api/v2/positions":{"get":{"tags":["PositionsV2"],"parameters":[{"schema":{"type":"string","description":"Position owner public key (required). Accepts a single value or a comma-separated list of up to 50 pubkeys."},"required":false,"description":"Position owner public key (required). Accepts a single value or a comma-separated list of up to 50 pubkeys.","name":"ownerPubkey","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"marketPubkey","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"marketId","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Filter by position side (true = YES, false = NO)"},"required":false,"description":"Filter by position side (true = YES, false = NO)","name":"isYes","in":"query"}],"responses":{"200":{"description":"On-chain positions grouped by owner public key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PositionsV2Response"}}}},"400":{"description":"Failed to fetch positions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}