RivoMarkets Backtest API
The backtest API from RivoMarkets — 1 operation(s) for backtest.
The backtest API from RivoMarkets — 1 operation(s) for backtest.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/rivo-markets:rivo-markets-backtest-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Rivo Backtest API
version: '2'
description: 'Prediction market data from Kalshi, Polymarket, Polymarket US and Gemini: whale trades, traders and their records, markets, backtests, and paper bots. Every route but the preview needs an API key from an active subscription.'
servers:
- url: https://api.rivo.markets
security:
- bearer: []
tags:
- name: backtest
paths:
/v2/backtest:
post:
operationId: reference_backtest
summary: Backtest
description: 'Scores a signal or one trader on settled history at a sizing you choose. You can add a holdout check, a sweep or a breakdown. Docs: https://rivo.markets/docs/reference/backtest'
tags:
- backtest
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
signal:
type: object
properties:
venue:
type: array
items:
type: string
description: 'Matches buys on these venues: `kalshi`, `polymarket`, `polymarket_us` or `gemini`. You can pass up to 50. Leave it out to match every venue.'
category:
type: array
items:
type: string
description: 'Matches buys in these categories: `sports`, `politics`, `crypto`, `finance`, `culture`. You can pass up to 5. It matches the market''s stored category, as saved signal bots do.'
minUsd:
type: number
description: The smallest trade to match, in USD.
maxUsd:
type: number
description: The largest trade to match, in USD. It must be at least `minUsd`.
priceMin:
type: number
description: The lowest price paid to match, from 0 to 1.
priceMax:
type: number
description: The highest price paid to match, from 0 to 1. It must be at least `priceMin`.
entry:
type: string
description: Which buys to match. `open` matches new positions only, `add` matches buys that add to a position, and `all` matches both.
traders:
type: array
items:
type: string
description: Matches only these traders' buys. Pass 1 to 25 trader refs.
keywords:
type: array
items:
type: string
description: Matches markets whose name contains any of these words. Pass 1 to 10 words, each up to 40 characters.
skipLosingTraders:
type: boolean
description: 'Leaves out traders on a losing 90-day record: net down with at least 10 settled trades. A backtest uses each trader''s record today across its whole window, while a bot checks at the time of each trade. Set `false` to include them.'
endsWithinHours:
type: number
description: 'Matches only markets expected to end within this many hours of the buy, 1 to 8760, so no bet is held longer (24 holds nothing past a day). The end is the venue''s expected end: a game''s end, not the last date the market could settle. Leave it out to match any market. A backtest reads a market settled before November 2026 as ending at its last whale trade, so it can include longer bets than a bot would take.'
maxPerGameUsd:
type: number
description: The most the bot puts into one game across every market on it (the winner, spreads, totals and props), in dollars, up to 1000000. A buy takes only what is left under it, so a trader who ladders one game is copied only up to this. A backtest holds each game to it the same way. Leave it out for no limit.
description: The conditions a whale buy must meet. Send this or `trader`, not both. The API refuses unknown fields.
trader:
type: string
description: Scores one trader's buys instead of a signal. Send exactly one of `signal`, `trader` or `bot`.
bot:
type: string
description: 'A bot id from List bots (https://rivo.markets/docs/reference/list-bots), such as `trader:<uuid>`. Scores that bot as it is set up: its trader or signal, `sizing`, `copy`, `mirrorExits`, `dailyCapUsd` and a live bot''s `slippage`. Any of those you also send overrides the bot''s. A market bot has no backtest.'
sizing:
type: object
properties:
usd:
type: number
description: A fixed stake for each trade in USD, above 0 and up to 1,000,000.
percent:
type: number
description: Stakes this percentage of the source trade's dollars, above 0 and up to 10,000. Send it together with `maxUsd`.
maxUsd:
type: number
description: The most any one trade stakes when you use `percent`, in USD, up to 1,000,000.
description: How much each trade stakes. Send exactly one of the two forms below.
days:
type: integer
description: How many days back from now to score, from 1 to 365. A signal that names no traders reaches back at most 90 days.
holdout:
type: boolean
description: Set to `true` to score the first two thirds of the window and check the result on the last third. It works on signals only.
mirrorExits:
type: boolean
description: Trader backtests only. Set to `true` to sell when the trader sells, at their sell price, as a bot with mirror exits does. On Kalshi the bot sells the same share of its position the trader sold of theirs, and all of it once they keep a tenth or less; a sale under $0.10 is skipped. On Polymarket only a full close sells.
copy:
type: object
description: Trader backtests only. Which of the trader's trades to copy, the same rules a trader bot's `copy` takes. Leave a field out for no limit. With `endsWithinHours`, a market settled before November 2026 is read as ending at its last whale trade, so the backtest can include longer bets than the bot would take.
dailyCapUsd:
type: number
description: Trader backtests only. The bot's daily limit on buys in dollars, counted in your account's own day, as the bot counts it. No limit when left out.
slippage:
type: object
description: 'The slippage `live` is scored at, as a live bot''s: `{ "cents": 5 }` for cents over the trader''s price (0 to 20), or `{ "percent": 2.5 }` for a share of it (0.5 to 20). A live bot buys up to that far over the trader''s price, so more room fills more of the trades whose price ran, at a higher price, and less room misses more of them. 2.5% when left out, as live bots are saved, and never under 2 cents; a setting you choose is used exactly. Live bots set it in the app.'
sweep:
type: object
properties:
field:
type: string
description: 'The field to sweep: `priceMin`, `priceMax`, `minUsd` or `maxUsd`.'
values:
type: array
items:
type: number
description: The values to try, from 2 to 20 of them. Prices run from 0 to 1.
required:
- field
- values
description: Runs the signal once for each value of one field. It works on signals only.
breakdown:
type: string
description: 'How to split the score: `category`, `month` or `price_band`. It works on signals only.'
responses:
'200':
description: 'Success: `{ success: true, data }`.'
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
data:
type: object
properties:
data:
type: object
properties:
days:
type: integer
description: The number of days scored.
sizing:
type: object
description: 'The sizing this result used: `{ usd }` or `{ percent, maxUsd }`.'
trades:
type: integer
description: The number of trades the idea matched in the window, settled or not.
settled:
type: integer
description: The number of matched trades that settled.
wins:
type: integer
description: The number of settled trades that won.
losses:
type: integer
description: The number of settled trades that lost.
open:
type: integer
description: The number of trades still open. Rivo counts them but does not score them.
winRate:
type: number
description: The share of settled trades that won, from 0 to 1. It is `null` until a trade settles.
staked:
type: number
description: The dollars staked on settled trades at the sizing you gave.
profit:
type: number
description: The profit in USD, with each trade held to settlement at the price paid, or sold at the trader's sale with `mirrorExits`.
return:
type: number
description: The profit divided by the dollars staked. It is `null` when nothing was staked.
curve:
type: array
items:
type: object
properties:
week:
type: string
description: The Monday that starts the week, written as `YYYY-MM-DD`.
settled:
type: integer
description: The number of trades that settled that week.
profit:
type: number
description: The profit that week, in USD.
cumulative:
type: number
description: The total profit up to the end of that week, in USD.
description: The profit for each week, oldest first.
holdout:
type: object
properties:
splitAt:
type: string
description: The time where Rivo split the window, in ISO 8601 UTC.
train:
type: object
properties:
trades:
type: integer
description: The number of trades the idea matched in the window, settled or not.
settled:
type: integer
description: The number of matched trades that settled.
wins:
type: integer
description: The number of settled trades that won.
losses:
type: integer
description: The number of settled trades that lost.
open:
type: integer
description: The number of trades still open. Rivo counts them but does not score them.
winRate:
type: number
description: The share of settled trades that won, from 0 to 1. It is `null` until a trade settles.
staked:
type: number
description: The dollars staked on settled trades at the sizing you gave.
profit:
type: number
description: The profit in USD, with each trade held to settlement at the price paid, or sold at the trader's sale with `mirrorExits`.
return:
type: number
description: The profit divided by the dollars staked. It is `null` when nothing was staked.
description: The score for the first two thirds of the window.
test:
type: object
properties:
trades:
type: integer
description: The number of trades the idea matched in the window, settled or not.
settled:
type: integer
description: The number of matched trades that settled.
wins:
type: integer
description: The number of settled trades that won.
losses:
type: integer
description: The number of settled trades that lost.
open:
type: integer
description: The number of trades still open. Rivo counts them but does not score them.
winRate:
type: number
description: The share of settled trades that won, from 0 to 1. It is `null` until a trade settles.
staked:
type: number
description: The dollars staked on settled trades at the sizing you gave.
profit:
type: number
description: The profit in USD, with each trade held to settlement at the price paid, or sold at the trader's sale with `mirrorExits`.
return:
type: number
description: The profit divided by the dollars staked. It is `null` when nothing was staked.
description: The score for the last third of the window.
holds:
type: boolean
description: This is `true` when the last third's return is above zero.
description: 'The holdout check, when you send `holdout: true`.'
sweep:
type: object
properties:
field:
type: string
description: The field that was swept.
results:
type: array
items:
type: object
properties:
value:
type: number
description: The value Rivo tried.
trades:
type: integer
description: The number of trades the idea matched in the window, settled or not.
settled:
type: integer
description: The number of matched trades that settled.
wins:
type: integer
description: The number of settled trades that won.
losses:
type: integer
description: The number of settled trades that lost.
open:
type: integer
description: The number of trades still open. Rivo counts them but does not score them.
winRate:
type: number
description: The share of settled trades that won, from 0 to 1. It is `null` until a trade settles.
staked:
type: number
description: The dollars staked on settled trades at the sizing you gave.
profit:
type: number
description: The profit in USD, with each trade held to settlement at the price paid, or sold at the trader's sale with `mirrorExits`.
return:
type: number
description: The profit divided by the dollars staked. It is `null` when nothing was staked.
description: One score for each value. Each row has `value` next to the score fields.
description: The sweep results, when you send `sweep`.
breakdown:
type: object
properties:
by:
type: string
description: 'How the score is split: `category`, `month` or `price_band`.'
rows:
type: array
items:
type: object
properties:
bucket:
type: string
description: 'The bucket: the venue''s own category name, a month written as `YYYY-MM`, or a price band such as `0.40-0.60`.'
trades:
type: integer
description: The number of trades the idea matched in the window, settled or not.
settled:
type: integer
description: The number of matched trades that settled.
wins:
type: integer
description: The number of settled trades that won.
losses:
type: integer
description: The number of settled trades that lost.
open:
type: integer
description: The number of trades still open. Rivo counts them but does not score them.
winRate:
type: number
description: The share of settled trades that won, from 0 to 1. It is `null` until a trade settles.
staked:
type: number
description: The dollars staked on settled trades at the sizing you gave.
profit:
type: number
description: The profit in USD, with each trade held to settlement at the price paid, or sold at the trader's sale with `mirrorExits`.
return:
type: number
description: The profit divided by the dollars staked. It is `null` when nothing was staked.
description: One score for each bucket. Each row has `bucket` next to the score fields.
description: The breakdown, when you send `breakdown`.
byCategory:
type: array
items:
type: object
properties:
category:
type: string
description: The venue's name for the category.
settled:
type: integer
description: The number of settled trades.
wins:
type: integer
description: The number of wins.
profit:
type: number
description: The profit in USD.
return:
type: number
description: The profit divided by the dollars staked.
description: The record by the venue's own category name. Only trader backtests return it.
live:
type: object
properties:
staked:
type: number
description: The dollars staked, weighted by each trade's chance of filling.
profit:
type: number
description: The profit in USD, after fees.
return:
type: number
description: The profit divided by the dollars staked.
fillRate:
type: number
description: The share of the copied trades expected to fill, from 0 to 1.
copies:
type: integer
description: The number of real-money copies the fill rates rest on.
basis:
type: string
description: '`trader` when this trader has enough real-money copies of their own, else `price_band` for the venue and price.'
curve:
type: array
items:
type: object
description: Trader backtests only. The weekly curve, with the same fields as `curve`.
slippage:
type: array
items:
type: object
properties:
cents:
type: integer
description: The slippage, in cents over the trader's price.
fillRate:
type: number
description: The share of the copied trades expected to fill at this setting, from 0 to 1.
staked:
type: number
description: The dollars staked, weighted by each trade's chance of filling.
profit:
type: number
description: The profit in USD, after fees.
return:
type: number
description: The profit divided by the dollars staked.
maxDrawdown:
type: number
description: The deepest fall in running profit, in USD. `null` with too few settled trades.
copies:
type: integer
description: The number of real-money copies replayed at this setting.
description: Trader backtests only. The same estimate at 2, 3, 5, 10 and 20 cents of slippage over the trader's price. Real-money copies are sent at about 2 cents over, so the 2 cent row is the `live` estimate itself. Each wider row adds the fills that Kalshi's own trades show the extra room would have caught on copies like these, at the higher price paid. A bot's top price still caps every row. Costs nothing extra. `null` where no copies were replayed, which is every venue but Kalshi.
description: The same trades as a real-money bot would have had them. The top-level numbers fill every copy at the trader's price. Paper bots are priced the way this is. Here buys pay what live copies paid over the trader's price, sales get what live sales got under it, the venue's fees come off both, and each settled trade counts by its chance of filling given whether it won. These come from real-money bots' own orders over the last 30 days. Trades a live copy misses are mostly winners. A signal uses its venue and price band's rates and returns no `curve`. `null` where the venue has no live copies to measure from.
description: The score for your idea.
example:
data:
days: 90
sizing:
usd: 100
trades: 1711
settled: 1662
wins: 924
losses: 738
open: 48
winRate: 0.556
staked: 166200
profit: 4164.71
return: 0.0251
curve:
- week: '2026-07-13'
settled: 15
profit: 1014.77
cumulative: 1014.77
- week: '2026-07-20'
settled: 0
profit: 0
cumulative: 1014.77
- week: '2026-07-27'
settled: 7
profit: 338.89
cumulative: 1353.66
holdout:
splitAt: '2026-09-15T02:28:05.331Z'
train:
trades: 733
settled: 717
wins: 425
losses: 292
open: 16
winRate: 0.5927
staked: 71700
profit: 4527.89
return: 0.0632
test:
trades: 978
settled: 945
wins: 499
losses: 446
open: 32
winRate: 0.528
staked: 94500
profit: -363.18
return: -0.0038
holds: false
default:
description: 'An error: `{ success: false, error, code }`. See https://rivo.markets/docs/errors'
x-scope: read
components:
securitySchemes:
bearer:
type: http
scheme: bearer
description: An API key (rivo_live_...) from Settings, Developers.
externalDocs:
url: https://rivo.markets/docs
description: Rivo API docs