{"openapi":"3.1.0","info":{"title":"Refract Funding Trader API","description":"External trading API for funded Refract accounts on Kalshi and Polymarket markets. Request/response quotes (no streaming), idempotent orders, equity and drawdown reads. Money is integer micro-USD (1 USD = 1,000,000). Prices are probabilities in [0,1]. Timestamps are ISO 8601 UTC. Rejected orders are HTTP 200 with status REJECTED and a stable reason code; HTTP errors are reserved for auth, validation, and rate limits.","version":"1.0.0"},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"API key from the Refract dashboard (Settings → API Keys): rf_live_..."}},"schemas":{}},"paths":{"/v1/markets":{"get":{"operationId":"listMarkets","summary":"Search and list tradeable markets","tags":["external"],"parameters":[{"schema":{"type":"string","maxLength":200},"in":"query","name":"q","required":false,"description":"Free-text search; results come back relevance-ranked."},{"schema":{"type":"string","enum":["ALL","KALSHI","POLYMARKET","PERP","UPDOWN"],"default":"ALL"},"in":"query","name":"venue","required":false,"description":"PERP = Kalshi perpetuals (dollar-priced). UPDOWN = rolling Up/Down windows (see /v1/series)."},{"schema":{"type":"string","maxLength":60},"in":"query","name":"category","required":false},{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"markets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"venue":{"type":"string","enum":["KALSHI","POLYMARKET","KALSHI_PERP"]},"venueMarketId":{"type":["null","string"],"description":"Kalshi market ticker / Polymarket YES token id / perp ticker."},"slug":{"type":["null","string"],"description":"Polymarket market slug — usable as 'polymarket:<slug>'. Up/down windows follow '<asset>-updown-<tf>-<unixStartSec>'."},"title":{"type":"string"},"eventTitle":{"type":["null","string"]},"outcomeLabel":{"type":["null","string"]},"outcomeNames":{"type":["null","array"],"items":{"type":"string"},"minItems":2,"maxItems":2},"category":{"type":"string"},"status":{"type":"string"},"yesPrice":{"type":["null","number"],"description":"BINARY: YES probability in [0,1]. PERP: dollar mark per contract."},"volume24hUsd":{"type":["null","number"]},"totalVolumeUsd":{"type":["null","number"]},"closeTime":{"type":["null","string"],"description":"ISO 8601 UTC. Always null for perps (they never expire)."},"tradeable":{"type":"boolean"},"instrument":{"type":"string","enum":["BINARY","PERP"]},"maxLeverage":{"type":["null","number"],"description":"PERP only: highest selectable leverage."},"fundingRate":{"type":["null","number"],"description":"PERP only: current funding rate (display)."},"liveWindow":{"type":["null","object"],"description":"Rolling Up/Down window identity; see GET /v1/series for the roll schedule.","properties":{"asset":{"type":"string"},"timeframe":{"type":"string"},"closeTime":{"type":["null","string"]}}}},"required":["id","venue","title","category","status","tradeable","instrument"]}},"page":{"type":"integer"},"pageSize":{"type":"integer"},"totalMarkets":{"type":"integer"},"hasMore":{"type":"boolean"},"generatedAt":{"type":["null","string"],"description":"ISO 8601 build time of the universe snapshot served."}},"required":["markets","page","pageSize","totalMarkets","hasMore"]}}}}}}},"/v1/markets/{market}":{"get":{"operationId":"getMarket","summary":"One market with top-of-book, per-side buyability, and fee model","tags":["external"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"path","name":"market","required":true,"description":"Market reference: 'kalshi:<market_ticker>', 'kalshi_perp:<perp_ticker>', 'polymarket:<yes_token_id>', 'polymarket:<market_slug>' (up/down windows follow '<asset>-updown-<tf>-<unixStartSec>'), or a market id returned by this API."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"venue":{"type":"string","enum":["KALSHI","POLYMARKET","KALSHI_PERP"]},"venueMarketId":{"type":["null","string"],"description":"Kalshi market ticker / Polymarket YES token id / perp ticker."},"slug":{"type":["null","string"],"description":"Polymarket market slug — usable as 'polymarket:<slug>'. Up/down windows follow '<asset>-updown-<tf>-<unixStartSec>'."},"title":{"type":"string"},"eventTitle":{"type":["null","string"]},"outcomeLabel":{"type":["null","string"]},"outcomeNames":{"type":["null","array"],"items":{"type":"string"},"minItems":2,"maxItems":2},"category":{"type":"string"},"status":{"type":"string"},"yesPrice":{"type":["null","number"],"description":"BINARY: YES probability in [0,1]. PERP: dollar mark per contract."},"volume24hUsd":{"type":["null","number"]},"totalVolumeUsd":{"type":["null","number"]},"closeTime":{"type":["null","string"],"description":"ISO 8601 UTC. Always null for perps (they never expire)."},"tradeable":{"type":"boolean"},"instrument":{"type":"string","enum":["BINARY","PERP"]},"maxLeverage":{"type":["null","number"],"description":"PERP only: highest selectable leverage."},"fundingRate":{"type":["null","number"],"description":"PERP only: current funding rate (display)."},"liveWindow":{"type":["null","object"],"description":"Rolling Up/Down window identity; see GET /v1/series for the roll schedule.","properties":{"asset":{"type":"string"},"timeframe":{"type":"string"},"closeTime":{"type":["null","string"]}}},"outcomes":{"type":"array","items":{"type":"object","properties":{"outcome":{"type":"string","enum":["YES","NO"]},"label":{"type":"string"},"buyable":{"type":"boolean","description":"This side's own book is live and eligible to BUY right now. SELLs of held positions always pass."},"bestBid":{"type":["null","number"]},"bestAsk":{"type":["null","number"]},"mid":{"type":["null","number"]},"bidDepthShares":{"type":"number"},"askDepthShares":{"type":"number"},"lastTradePrice":{"type":["null","number"]}},"required":["outcome","label","buyable","bestBid","bestAsk","mid","bidDepthShares","askDepthShares"]}},"feeModel":{"type":"string"},"minOrderSize":{"type":"number"},"tickSize":{"type":"number"}},"required":["id","venue","title","category","status","tradeable","instrument","outcomes","feeModel","minOrderSize","tickSize"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/series":{"get":{"operationId":"listSeries","summary":"Rolling Up/Down series: the current window and the next few, with venue-native names","tags":["external"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"series":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"venue:asset:timeframe"},"venue":{"type":"string"},"asset":{"type":"string"},"assetName":{"type":["null","string"]},"timeframe":{"type":"string","enum":["5m","15m","1h","4h","1d"]},"current":{"type":"object","properties":{"marketId":{"type":"string","description":"Canonical id — a valid market ref for quote/order once listed."},"venueMarketId":{"type":["null","string"],"description":"Kalshi ticker (usable as kalshi:<ticker>)."},"slug":{"type":["null","string"],"description":"Polymarket slug (usable as polymarket:<slug>); rolling windows follow '<asset>-updown-<tf>-<unixStartSec>'."},"closeTime":{"type":["null","string"],"description":"ISO 8601 — the window rolls exactly here."},"yesPrice":{"type":["null","number"],"description":"Live up-probability (current window only)."},"volumeUsd":{"type":["null","number"]},"listed":{"type":"boolean","description":"True = the venue lists this window now (quotable). False = a synthesized upcoming Kalshi window: the name and close time are exact, but quotes 404 until the venue lists it (usually moments before the window starts)."}},"required":["marketId","closeTime","listed"]},"next":{"type":"array","items":{"type":"object","properties":{"marketId":{"type":"string","description":"Canonical id — a valid market ref for quote/order once listed."},"venueMarketId":{"type":["null","string"],"description":"Kalshi ticker (usable as kalshi:<ticker>)."},"slug":{"type":["null","string"],"description":"Polymarket slug (usable as polymarket:<slug>); rolling windows follow '<asset>-updown-<tf>-<unixStartSec>'."},"closeTime":{"type":["null","string"],"description":"ISO 8601 — the window rolls exactly here."},"yesPrice":{"type":["null","number"],"description":"Live up-probability (current window only)."},"volumeUsd":{"type":["null","number"]},"listed":{"type":"boolean","description":"True = the venue lists this window now (quotable). False = a synthesized upcoming Kalshi window: the name and close time are exact, but quotes 404 until the venue lists it (usually moments before the window starts)."}},"required":["marketId","closeTime","listed"]},"description":"Up to 4 upcoming windows, ascending by closeTime."}},"required":["key","venue","asset","timeframe","current","next"]}}},"required":["series"]}}}}}}},"/v1/quote":{"post":{"operationId":"createQuote","summary":"Request a firm quote (dry run of the exact execution path; no fill)","tags":["external"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"accountId":{"type":"string","minLength":36,"maxLength":36,"description":"Which of your funded accounts this call acts on (accounts.id from GET /v1/accounts). Omit for your default account: the active seat with the lowest number."},"market":{"type":"string","minLength":1,"maxLength":256,"description":"Market reference: 'kalshi:<market_ticker>', 'kalshi_perp:<perp_ticker>', 'polymarket:<yes_token_id>', 'polymarket:<market_slug>' (up/down windows follow '<asset>-updown-<tf>-<unixStartSec>'), or a market id returned by this API."},"outcome":{"type":"string","enum":["YES","NO"],"description":"Perps ignore this (single dollar book; pass YES)."},"side":{"type":"string","enum":["BUY","SELL"]},"sizeShares":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"notionalMicros":{"type":"integer","exclusiveMinimum":0,"maximum":1000000000000000,"description":"Dollar-denominated sizing alternative: integer micro-USD to spend (BUY) or receive (SELL)."},"limitPriceProb":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1,"description":"Binary markets only: price protection in probability [0,1]. A BUY consumes only ask levels ≤ this price; a SELL only bid levels ≥ it. What fits fills immediately (possibly PARTIAL); nothing rests on the book. Best level outside the limit rejects LIMIT_NOT_MARKETABLE; perps reject LIMIT_UNSUPPORTED."},"clientOrderId":{"type":"string","minLength":1,"maxLength":100},"direction":{"type":"string","enum":["LONG","SHORT"],"description":"Perps only. Default LONG. A SHORT opens on SELL and closes (covers) on BUY."},"leverage":{"type":"number","minimum":1,"maximum":100,"description":"Perps only, on OPEN. Clamped to the market's ladder; adds inherit the position's leverage."}},"required":["market","outcome","side"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["FILLED","PARTIAL","REJECTED"]},"reason":{"type":"string","description":"Stable reject/partial reason code (e.g. INSUFFICIENT_FUNDS, NOT_ELIGIBLE, SHARE_CAP)."},"filledShares":{"type":"number"},"vwap":{"type":"number","description":"Volume-weighted fill price, probability in [0,1]."},"costMicros":{"type":"integer","description":"Notional ex-fee in integer micro-USD."},"feeMicros":{"type":"integer"},"totalMicros":{"type":"integer","description":"costMicros + feeMicros."},"slippageBps":{"type":"number"},"limit":{"type":"object","additionalProperties":true,"description":"Structured context for SHARE_CAP / MAX_POSITIONS / PRICE_BAND / MAX_MARGIN rejects."},"clientOrderId":{"type":"string"}},"required":["status","filledShares","vwap","costMicros","feeMicros","totalMicros","slippageBps"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/orders":{"post":{"operationId":"createOrder","summary":"Place an order (immediate execution against live venue depth; optional limitPriceProb price protection, nothing rests)","tags":["external"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"accountId":{"type":"string","minLength":36,"maxLength":36,"description":"Which of your funded accounts this call acts on (accounts.id from GET /v1/accounts). Omit for your default account: the active seat with the lowest number."},"market":{"type":"string","minLength":1,"maxLength":256,"description":"Market reference: 'kalshi:<market_ticker>', 'kalshi_perp:<perp_ticker>', 'polymarket:<yes_token_id>', 'polymarket:<market_slug>' (up/down windows follow '<asset>-updown-<tf>-<unixStartSec>'), or a market id returned by this API."},"outcome":{"type":"string","enum":["YES","NO"],"description":"Perps ignore this (single dollar book; pass YES)."},"side":{"type":"string","enum":["BUY","SELL"]},"sizeShares":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"notionalMicros":{"type":"integer","exclusiveMinimum":0,"maximum":1000000000000000,"description":"Dollar-denominated sizing alternative: integer micro-USD to spend (BUY) or receive (SELL)."},"limitPriceProb":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1,"description":"Binary markets only: price protection in probability [0,1]. A BUY consumes only ask levels ≤ this price; a SELL only bid levels ≥ it. What fits fills immediately (possibly PARTIAL); nothing rests on the book. Best level outside the limit rejects LIMIT_NOT_MARKETABLE; perps reject LIMIT_UNSUPPORTED."},"clientOrderId":{"type":"string","minLength":1,"maxLength":100,"description":"Required idempotency key, unique per order intent. Retrying with the same id replays the original result instead of double-filling."},"direction":{"type":"string","enum":["LONG","SHORT"],"description":"Perps only. Default LONG. A SHORT opens on SELL and closes (covers) on BUY."},"leverage":{"type":"number","minimum":1,"maximum":100,"description":"Perps only, on OPEN. Clamped to the market's ladder; adds inherit the position's leverage."}},"required":["market","outcome","side","clientOrderId"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["FILLED","PARTIAL","REJECTED"]},"reason":{"type":"string","description":"Stable reject/partial reason code (e.g. INSUFFICIENT_FUNDS, NOT_ELIGIBLE, SHARE_CAP)."},"filledShares":{"type":"number"},"vwap":{"type":"number","description":"Volume-weighted fill price, probability in [0,1]."},"costMicros":{"type":"integer","description":"Notional ex-fee in integer micro-USD."},"feeMicros":{"type":"integer"},"totalMicros":{"type":"integer","description":"costMicros + feeMicros."},"slippageBps":{"type":"number"},"limit":{"type":"object","additionalProperties":true,"description":"Structured context for SHARE_CAP / MAX_POSITIONS / PRICE_BAND / MAX_MARGIN rejects."},"clientOrderId":{"type":"string"}},"required":["status","filledShares","vwap","costMicros","feeMicros","totalMicros","slippageBps"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/combo/quote":{"post":{"operationId":"createComboQuote","summary":"Request a live RFQ quote for a multi-leg combo","tags":["external"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"accountId":{"type":"string","minLength":36,"maxLength":36,"description":"Which of your funded accounts this call acts on (accounts.id from GET /v1/accounts). Omit for your default account: the active seat with the lowest number."},"venue":{"type":"string","enum":["KALSHI","POLYMARKET"],"description":"All legs must belong to this venue."},"legs":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"market":{"type":"string","minLength":1,"maxLength":256,"description":"Market reference: 'kalshi:<market_ticker>', 'kalshi_perp:<perp_ticker>', 'polymarket:<yes_token_id>', 'polymarket:<market_slug>' (up/down windows follow '<asset>-updown-<tf>-<unixStartSec>'), or a market id returned by this API."},"side":{"type":"string","enum":["YES","NO"]}},"required":["market","side"]},"minItems":2,"maxItems":10},"contracts":{"type":"integer","minimum":1,"maximum":100000}},"required":["venue","legs","contracts"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["QUOTED","NO_QUOTE","REJECTED"]},"reason":{"type":"string"},"quoteId":{"type":"string","description":"Pass to the accept/confirm call. Also its idempotency key."},"comboRef":{"type":"string"},"combinedPrice":{"type":"number","description":"Combined probability price in [0,1] (sell side on cash-out quotes)."},"payoutIfWinMicros":{"type":"integer"},"costMicros":{"type":"integer"},"feeMicros":{"type":"integer"},"ttlMs":{"type":"integer","description":"Quote validity window; accept within it."},"limit":{"type":"object","additionalProperties":true,"description":"Structured context for SHARE_CAP / MAX_POSITIONS / PRICE_BAND / MAX_MARGIN rejects."}},"required":["status"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/combo/orders":{"post":{"operationId":"createComboOrder","summary":"Accept a combo quote (quoteId is the idempotency key)","tags":["external"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"accountId":{"type":"string","minLength":36,"maxLength":36,"description":"Which of your funded accounts this call acts on (accounts.id from GET /v1/accounts). Omit for your default account: the active seat with the lowest number."},"venue":{"type":"string","enum":["KALSHI","POLYMARKET"]},"quoteId":{"type":"string","minLength":1,"maxLength":200},"comboRef":{"type":"string","minLength":1,"maxLength":200},"contracts":{"type":"integer","minimum":1,"maximum":100000},"combinedPrice":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1,"description":"The quoted price you accept; the server re-validates live and 409s QUOTE_MOVED if it worsened."},"feeMicros":{"type":"integer","minimum":0},"legs":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"market":{"type":"string","minLength":1,"maxLength":256,"description":"Market reference: 'kalshi:<market_ticker>', 'kalshi_perp:<perp_ticker>', 'polymarket:<yes_token_id>', 'polymarket:<market_slug>' (up/down windows follow '<asset>-updown-<tf>-<unixStartSec>'), or a market id returned by this API."},"side":{"type":"string","enum":["YES","NO"]}},"required":["market","side"]},"minItems":2,"maxItems":10}},"required":["venue","quoteId","comboRef","contracts","combinedPrice","legs"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"combo":{"type":"object","properties":{"id":{"type":"string"},"venue":{"type":"string"},"comboRef":{"type":"string"},"side":{"type":"string"},"contracts":{"type":"number"},"combinedEntryPrice":{"type":"number"},"costMicros":{"type":"integer"},"feeMicros":{"type":"integer"},"payoutIfWinMicros":{"type":"integer"},"status":{"type":"string"},"realizedPnlMicros":{"type":["null","integer"]},"markValueMicros":{"type":["null","integer"]},"markPrice":{"type":["null","number"]},"markState":{"type":["null","string"]},"stakedMicros":{"type":["null","integer"]},"maxPayoutMicros":{"type":["null","integer"]},"openedAt":{"type":["null","string"]},"settledAt":{"type":["null","string"]},"markedAt":{"type":["null","string"]},"legs":{"type":"array","items":{"type":"object","additionalProperties":true,"description":"Leg detail: marketId, side, entry/last prices, status."}}},"required":["id","venue","comboRef","contracts","combinedEntryPrice","costMicros","status"],"additionalProperties":true}},"required":["combo"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}},"423":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/combo/cashout/quote":{"post":{"operationId":"createComboCashoutQuote","summary":"Quote the sell-side price for an open combo","tags":["external"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"accountId":{"type":"string","minLength":36,"maxLength":36,"description":"Which of your funded accounts this call acts on (accounts.id from GET /v1/accounts). Omit for your default account: the active seat with the lowest number."},"comboId":{"type":"string","minLength":1,"maxLength":100},"contracts":{"type":"integer","minimum":1,"maximum":100000}},"required":["comboId","contracts"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["QUOTED","NO_QUOTE","REJECTED"]},"reason":{"type":"string"},"quoteId":{"type":"string","description":"Pass to the accept/confirm call. Also its idempotency key."},"comboRef":{"type":"string"},"combinedPrice":{"type":"number","description":"Combined probability price in [0,1] (sell side on cash-out quotes)."},"payoutIfWinMicros":{"type":"integer"},"costMicros":{"type":"integer"},"feeMicros":{"type":"integer"},"ttlMs":{"type":"integer","description":"Quote validity window; accept within it."},"limit":{"type":"object","additionalProperties":true,"description":"Structured context for SHARE_CAP / MAX_POSITIONS / PRICE_BAND / MAX_MARGIN rejects."}},"required":["status"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/combo/cashout":{"post":{"operationId":"createComboCashout","summary":"Cash out an open combo at a quoted sell price","tags":["external"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"accountId":{"type":"string","minLength":36,"maxLength":36,"description":"Which of your funded accounts this call acts on (accounts.id from GET /v1/accounts). Omit for your default account: the active seat with the lowest number."},"comboId":{"type":"string","minLength":1,"maxLength":100},"quoteId":{"type":"string","minLength":1,"maxLength":200},"contracts":{"type":"integer","minimum":1,"maximum":100000},"sellPrice":{"type":"number","minimum":0,"exclusiveMaximum":1,"description":"The quoted sell price; a 1 cent slippage band protects against re-price moves (409 QUOTE_MOVED beyond it)."}},"required":["comboId","quoteId","contracts","sellPrice"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"combo":{"type":"object","properties":{"id":{"type":"string"},"venue":{"type":"string"},"comboRef":{"type":"string"},"side":{"type":"string"},"contracts":{"type":"number"},"combinedEntryPrice":{"type":"number"},"costMicros":{"type":"integer"},"feeMicros":{"type":"integer"},"payoutIfWinMicros":{"type":"integer"},"status":{"type":"string"},"realizedPnlMicros":{"type":["null","integer"]},"markValueMicros":{"type":["null","integer"]},"markPrice":{"type":["null","number"]},"markState":{"type":["null","string"]},"stakedMicros":{"type":["null","integer"]},"maxPayoutMicros":{"type":["null","integer"]},"openedAt":{"type":["null","string"]},"settledAt":{"type":["null","string"]},"markedAt":{"type":["null","string"]},"legs":{"type":"array","items":{"type":"object","additionalProperties":true,"description":"Leg detail: marketId, side, entry/last prices, status."}}},"required":["id","venue","comboRef","contracts","combinedEntryPrice","costMicros","status"],"additionalProperties":true}},"required":["combo"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/combos":{"get":{"operationId":"listCombos","summary":"Open and settled combos with live marks","tags":["external"],"parameters":[{"schema":{"type":"string","minLength":36,"maxLength":36},"in":"query","name":"accountId","required":false,"description":"Which of your funded accounts this call acts on (accounts.id from GET /v1/accounts). Omit for your default account: the active seat with the lowest number."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"combos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"venue":{"type":"string"},"comboRef":{"type":"string"},"side":{"type":"string"},"contracts":{"type":"number"},"combinedEntryPrice":{"type":"number"},"costMicros":{"type":"integer"},"feeMicros":{"type":"integer"},"payoutIfWinMicros":{"type":"integer"},"status":{"type":"string"},"realizedPnlMicros":{"type":["null","integer"]},"markValueMicros":{"type":["null","integer"]},"markPrice":{"type":["null","number"]},"markState":{"type":["null","string"]},"stakedMicros":{"type":["null","integer"]},"maxPayoutMicros":{"type":["null","integer"]},"openedAt":{"type":["null","string"]},"settledAt":{"type":["null","string"]},"markedAt":{"type":["null","string"]},"legs":{"type":"array","items":{"type":"object","additionalProperties":true,"description":"Leg detail: marketId, side, entry/last prices, status."}}},"required":["id","venue","comboRef","contracts","combinedEntryPrice","costMicros","status"],"additionalProperties":true}}},"required":["combos"]}}}}}}},"/v1/account":{"get":{"operationId":"getAccount","summary":"Total equity, cash, P&L, and buying power","tags":["external"],"parameters":[{"schema":{"type":"string","minLength":36,"maxLength":36},"in":"query","name":"accountId","required":false,"description":"Which of your funded accounts this call acts on (accounts.id from GET /v1/accounts). Omit for your default account: the active seat with the lowest number."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":["null","string"]},"accountType":{"type":["null","string"]},"initialBalanceMicros":{"type":"integer"},"balanceMicros":{"type":"integer","description":"Cash."},"equityMicros":{"type":["null","integer"],"description":"Cash + instant-liquidation value of every open position, net of venue fees. The number drawdown is enforced against."},"unrealizedPnlMicros":{"type":["null","integer"]},"pnlMicros":{"type":"integer"},"realizedPnlMicros":{"type":"integer"},"perpPnlMicros":{"type":"integer"},"buyingPowerMicros":{"type":"integer"},"markComplete":{"type":["null","boolean"],"description":"False ⇔ equity is a PARTIAL sum (an open position could not be valued) and drawdown enforcement is suspended."},"markedAt":{"type":["null","string"]},"openPositions":{"type":"integer"}},"required":["initialBalanceMicros","balanceMicros","pnlMicros","buyingPowerMicros","openPositions"]}}}}}}},"/v1/risk":{"get":{"operationId":"getRisk","summary":"Drawdown status: floor, headroom, peak, and withdrawable profit","tags":["external"],"parameters":[{"schema":{"type":"string","minLength":36,"maxLength":36},"in":"query","name":"accountId","required":false,"description":"Which of your funded accounts this call acts on (accounts.id from GET /v1/accounts). Omit for your default account: the active seat with the lowest number."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["active","frozen","closed"]},"tier":{"type":"string"},"nominalMicros":{"type":"integer"},"drawdownMicros":{"type":"integer","description":"Trailing drawdown allowance below peak equity P&L."},"equityPnlMicros":{"type":["null","integer"]},"equityComplete":{"type":"boolean"},"peakEquityMicros":{"type":"integer","description":"High-water mark of equity P&L. Never rebased; ratchets on unrealized highs."},"floorMicros":{"type":"integer","description":"max(0, peak) − drawdown. Equity P&L strictly below this closes the seat."},"headroomMicros":{"type":"integer","description":"Distance between current equity P&L and the floor."},"safetyBufferMicros":{"type":"integer"},"withdrawableMicros":{"type":"integer","description":"Profit withdrawable right now (0 unless the book is flat and the seat is active)."},"closeOutAvailable":{"type":"boolean"},"closeOutMicros":{"type":"integer"},"bookFlat":{"type":"boolean"},"openSharesTotal":{"type":"number"},"perpMarginUsedMicros":{"type":"integer"},"startedAt":{"type":["null","string"]},"endedAt":{"type":["null","string"]},"endReason":{"type":["null","string"]},"breach":{"type":["null","object"],"properties":{"detectedAt":{"type":["null","string"]},"equityPnlMicros":{"type":"integer"},"floorMicros":{"type":"integer"},"peakEquityMicros":{"type":"integer"}}}},"required":["status","tier","drawdownMicros","equityPnlMicros","equityComplete","peakEquityMicros","floorMicros","headroomMicros"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/positions":{"get":{"operationId":"listPositions","summary":"Open positions with live marks and settlement state","tags":["external"],"parameters":[{"schema":{"type":"string","minLength":36,"maxLength":36},"in":"query","name":"accountId","required":false,"description":"Which of your funded accounts this call acts on (accounts.id from GET /v1/accounts). Omit for your default account: the active seat with the lowest number."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"positions":{"type":"array","items":{"type":"object","properties":{"marketId":{"type":"string","description":"Pass back to /v1/quote and /v1/orders as `market`."},"venue":{"type":["null","string"]},"venueMarketId":{"type":["null","string"]},"title":{"type":["null","string"]},"pick":{"type":["null","string"]},"outcome":{"type":"string"},"qty":{"type":"number"},"avgPrice":{"type":"number"},"mark":{"type":["null","number"]},"markState":{"type":["null","string"],"enum":["live","pinned","determined","resolved","closed","stale","expired","incomplete",null]},"markStale":{"type":"boolean"},"uPnlMicros":{"type":["null","integer"]},"feesPaidMicros":{"type":["null","integer"]},"awaitingSettlement":{"type":"boolean"},"resolutionStatus":{"type":["null","string"]},"instrument":{"type":"string"},"direction":{"type":["null","string"]},"leverage":{"type":["null","number"]}},"required":["marketId","outcome","qty","avgPrice","markStale","awaitingSettlement","instrument"]}}},"required":["positions"]}}}}}}},"/v1/fills":{"get":{"operationId":"listFills","summary":"Trade and settlement history (most recent first)","tags":["external"],"parameters":[{"schema":{"type":"string","minLength":36,"maxLength":36},"in":"query","name":"accountId","required":false,"description":"Which of your funded accounts this call acts on (accounts.id from GET /v1/accounts). Omit for your default account: the active seat with the lowest number."},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"fills":{"type":"array","items":{"type":"object","properties":{"ts":{"type":["null","string"]},"kind":{"type":"string"},"marketId":{"type":"string"},"venue":{"type":["null","string"]},"title":{"type":["null","string"]},"pick":{"type":["null","string"]},"outcome":{"type":"string"},"side":{"type":"string"},"filledShares":{"type":"number"},"vwap":{"type":"number"},"costMicros":{"type":"integer"},"feeMicros":{"type":"integer"},"cashDeltaMicros":{"type":"integer"},"realizedDeltaMicros":{"type":["null","integer"]},"balanceAfterMicros":{"type":"integer"},"settlementResult":{"type":["null","string"]}},"required":["ts","kind","marketId","outcome","side","filledShares","vwap","costMicros","feeMicros","cashDeltaMicros","balanceAfterMicros"]}}},"required":["fills"]}}}}}}}},"servers":[{"url":"https://refractfunding.com"}],"security":[{"apiKey":[]}]}