Simulators
Query errors
The listed GET routes reproduce the exchange’s query-binding errors for the listed fields, in the listed order, so a client’s handling of a malformed query is tested against the real wire format. A malformed or empty integer or boolean value, an integer overflow or a repeated field returns 400 with a flat msg body.
export RYSTIC_URL=$(rystic run kalshi-twin -d --port 0 --name queryerr --scenario empty_book --json | jq -r .data.url)
curl -s "$RYSTIC_URL/trade-api/v2/markets?limit=abc"
# -> {"msg":"Invalid format for parameter limit: error binding string parameter: strconv.ParseInt: parsing \"abc\": invalid syntax"}
curl -s -o /dev/null -w '%{http_code}\n' "$RYSTIC_URL/trade-api/v2/markets?limit=abc"
# -> 400
Route, after /trade-api/v2 | Fields in error priority order |
|---|---|
/events | limit, cursor, with_nested_markets, with_milestones, status, series_ticker, tickers, min_close_ts, min_updated_ts |
/events/{event_ticker} | with_nested_markets |
/events/multivariate | limit |
/historical/fills | ticker, max_ts |
/historical/orders | ticker, max_ts |
/historical/trades | ticker, min_ts |
/markets | limit, cursor, event_ticker, series_ticker, min_created_ts, max_created_ts, min_updated_ts |
/markets/trades | limit, cursor, ticker, min_ts |
/portfolio/deposits | limit |
/portfolio/fills | ticker, order_id, min_ts |
/portfolio/order_groups | subaccount |
/portfolio/orders | ticker, event_ticker, min_ts |
/portfolio/orders/queue_positions | market_tickers, event_ticker, subaccount |
/portfolio/settlements | limit, cursor, ticker, event_ticker, min_ts |
/series | category, tags, include_product_metadata, include_volume, min_updated_ts |
/series/fee_changes | series_ticker, show_historical |
- String fields only reject repeated values. Empty and single values continue to application validation. Repeated values are rejected before that field is parsed, and the order of the query string does not change which field fails first.
- Binding errors precede missing credentials.
- Integer fields use signed 64-bit parsing. Booleans accept Go boolean spellings such as
true,Falseand1.
What the coverage stops at
The coverage stops at the listed fields. Other query fields, enum and range checks, cursor and UUID validation and the separate narrowing behavior of /portfolio/positions?limit= have known gaps. Event-detail parsing runs before the resource lookup, as it does on the exchange.
Differs from Kalshi: the simulator rejects /events/multivariate?limit=5000, which the exchange’s demo accepts.
Last updated on