Backtest
This route scores an idea on settled whale trades. It works out what you would have made by copying every matching trade and holding each one to settlement at the price paid. It returns scores, never individual trades.
Send exactly one of signal or trader. A signal is a set of conditions that whale buys must meet. A trader scores one trader's own buys.
Scoring a trader, or a signal that names traders, counts each trader toward your account's 100 different traders a day, like opening their profile.
Each extra scan costs one request against your 120 a minute: each sweep value past the first, a holdout and a breakdown.
A trader backtest replays the trader's trades in order the way a paper bot copying them would: each order copied once at its average price, the bot's sizing, copy rules and daily limit, whole or part contracts as the venue allows, and a market maker's resting quotes left alone. Prices are the trader's own.
Sizing applies to each bet, as a bot places it. A trader often buys one market and outcome in many fills; a fixed amount is staked once on that bet, a percentage is taken of everything the trader put on it, and the maximum caps the whole bet. Later fills that add nothing count as skipped.
A signal scores buys only. It has no kind because live signal bots match on category, not on kind of market. That way a backtest uses the same filters as a bot built from the same signal, apart from skipLosingTraders, which a backtest reads from each trader's record today.
holdoutscores the first two thirds of the window and then checks the result on the last third.holdsistruewhen the last third also made money.sweepruns the signal once for each value of one field, so you can see where a threshold stops paying. Each value counts as one request.breakdownsplits the score by category, by month or by price band.
Holdout, sweep and breakdown work on signals only. Settled history changes only as markets settle, so Rivo answers a repeated request from its cache for 10 minutes.
Example request
curl -X POST "https://api.rivo.markets/v2/backtest" \
-H "Authorization: Bearer rivo_live_..." \
-H "Content-Type: application/json" \
-d '{
"signal": {
"venue": [
"kalshi"
],
"category": [
"sports"
],
"priceMin": 0.3,
"priceMax": 0.7,
"minUsd": 5000
},
"sizing": {
"usd": 100
},
"days": 90,
"holdout": true
}'import requests
url = "https://api.rivo.markets/v2/backtest"
headers = {
"Authorization": "Bearer rivo_live_...",
}
body = {
"signal": {
"venue": [
"kalshi",
],
"category": [
"sports",
],
"priceMin": 0.3,
"priceMax": 0.7,
"minUsd": 5000,
},
"sizing": {
"usd": 100,
},
"days": 90,
"holdout": True,
}
res = requests.post(url, headers=headers, json=body)
res.raise_for_status()
print(res.json())const res = await fetch("https://api.rivo.markets/v2/backtest", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RIVO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"signal": {
"venue": [
"kalshi"
],
"category": [
"sports"
],
"priceMin": 0.3,
"priceMax": 0.7,
"minUsd": 5000
},
"sizing": {
"usd": 100
},
"days": 90,
"holdout": true
}),
});
if (!res.ok) throw new Error(`Rivo API ${res.status}`);
const { data } = await res.json();Body
signalobjectThe conditions a whale buy must meet. Send this or
trader, not both. The API refuses unknown fields.Show 12 signal fields
venuestring[]Matches buys on these venues:
kalshi,polymarket,polymarket_usorgemini. You can pass up to 50. Leave it out to match every venue.categorystring[]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.minUsdnumberThe smallest trade to match, in USD.
maxUsdnumberThe largest trade to match, in USD. It must be at least
minUsd.priceMinnumberThe lowest price paid to match, from 0 to 1.
priceMaxnumberThe highest price paid to match, from 0 to 1. It must be at least
priceMin.entrystringdefaultallWhich buys to match.
openmatches new positions only,addmatches buys that add to a position, andallmatches both.traderstrader ref[]Matches only these traders' buys. Pass 1 to 25 trader refs.
keywordsstring[]Matches markets whose name contains any of these words. Pass 1 to 10 words, each up to 40 characters.
skipLosingTradersbooleandefaulttrueLeaves 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
falseto include them.endsWithinHoursnumberMatches 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.
maxPerGameUsdnumberThe 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.
tradertrader refScores one trader's buys instead of a signal. Send exactly one of
signal,traderorbot.botstringA bot id from List bots, such as
trader:<uuid>. Scores that bot as it is set up: its trader or signal,sizing,copy,mirrorExits,dailyCapUsdand a live bot'sslippage. Any of those you also send overrides the bot's. A market bot has no backtest.sizingobjectdefault{ "usd": 100 }How much each trade stakes. Send exactly one of the two forms below.
Show 3 sizing fields
usdnumberA fixed stake for each trade in USD, above 0 and up to 1,000,000.
percentnumberStakes this percentage of the source trade's dollars, above 0 and up to 10,000. Send it together with
maxUsd.maxUsdnumberThe most any one trade stakes when you use
percent, in USD, up to 1,000,000.
daysintegerdefault90How many days back from now to score, from 1 to 365. A signal that names no traders reaches back at most 90 days.
holdoutbooleanSet to
trueto score the first two thirds of the window and check the result on the last third. It works on signals only.mirrorExitsbooleanTrader backtests only. Set to
trueto 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.copyobjectTrader backtests only. Which of the trader's trades to copy, the same rules a trader bot's
copytakes. Leave a field out for no limit. WithendsWithinHours, 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.dailyCapUsdnumberTrader 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.
slippageobjectThe slippage
liveis 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.sweepobjectRuns the signal once for each value of one field. It works on signals only.
Show 2 sweep fields
fieldstringrequiredThe field to sweep:
priceMin,priceMax,minUsdormaxUsd.valuesnumber[]requiredThe values to try, from 2 to 20 of them. Prices run from 0 to 1.
breakdownstringHow to split the score:
category,monthorprice_band. It works on signals only.
Example response
{
"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
}
}
}Response fields
dataobjectThe score for your idea.
Show 17 data fields
daysintegerThe number of days scored.
sizingobjectThe sizing this result used:
{ usd }or{ percent, maxUsd }.tradesintegerThe number of trades the idea matched in the window, settled or not.
settledintegerThe number of matched trades that settled.
winsintegerThe number of settled trades that won.
lossesintegerThe number of settled trades that lost.
openintegerThe number of trades still open. Rivo counts them but does not score them.
winRatenumber or nullThe share of settled trades that won, from 0 to 1. It is
nulluntil a trade settles.stakednumberThe dollars staked on settled trades at the sizing you gave.
profitnumberThe profit in USD, with each trade held to settlement at the price paid, or sold at the trader's sale with
mirrorExits.returnnumber or nullThe profit divided by the dollars staked. It is
nullwhen nothing was staked.curveobject[]The profit for each week, oldest first.
Show 4 curve fields
weekstringThe Monday that starts the week, written as
YYYY-MM-DD.settledintegerThe number of trades that settled that week.
profitnumberThe profit that week, in USD.
cumulativenumberThe total profit up to the end of that week, in USD.
holdoutobjectThe holdout check, when you send
holdout: true.Show 4 holdout fields
splitAtstringThe time where Rivo split the window, in ISO 8601 UTC.
trainobjectThe score for the first two thirds of the window.
Show 9 train fields
tradesintegerThe number of trades the idea matched in the window, settled or not.
settledintegerThe number of matched trades that settled.
winsintegerThe number of settled trades that won.
lossesintegerThe number of settled trades that lost.
openintegerThe number of trades still open. Rivo counts them but does not score them.
winRatenumber or nullThe share of settled trades that won, from 0 to 1. It is
nulluntil a trade settles.stakednumberThe dollars staked on settled trades at the sizing you gave.
profitnumberThe profit in USD, with each trade held to settlement at the price paid, or sold at the trader's sale with
mirrorExits.returnnumber or nullThe profit divided by the dollars staked. It is
nullwhen nothing was staked.
testobjectThe score for the last third of the window.
Show 9 test fields
tradesintegerThe number of trades the idea matched in the window, settled or not.
settledintegerThe number of matched trades that settled.
winsintegerThe number of settled trades that won.
lossesintegerThe number of settled trades that lost.
openintegerThe number of trades still open. Rivo counts them but does not score them.
winRatenumber or nullThe share of settled trades that won, from 0 to 1. It is
nulluntil a trade settles.stakednumberThe dollars staked on settled trades at the sizing you gave.
profitnumberThe profit in USD, with each trade held to settlement at the price paid, or sold at the trader's sale with
mirrorExits.returnnumber or nullThe profit divided by the dollars staked. It is
nullwhen nothing was staked.
holdsbooleanThis is
truewhen the last third's return is above zero.
sweepobjectThe sweep results, when you send
sweep.Show 2 sweep fields
fieldstringThe field that was swept.
resultsobject[]One score for each value. Each row has
valuenext to the score fields.Show 10 results fields
valuenumberThe value Rivo tried.
tradesintegerThe number of trades the idea matched in the window, settled or not.
settledintegerThe number of matched trades that settled.
winsintegerThe number of settled trades that won.
lossesintegerThe number of settled trades that lost.
openintegerThe number of trades still open. Rivo counts them but does not score them.
winRatenumber or nullThe share of settled trades that won, from 0 to 1. It is
nulluntil a trade settles.stakednumberThe dollars staked on settled trades at the sizing you gave.
profitnumberThe profit in USD, with each trade held to settlement at the price paid, or sold at the trader's sale with
mirrorExits.returnnumber or nullThe profit divided by the dollars staked. It is
nullwhen nothing was staked.
breakdownobjectThe breakdown, when you send
breakdown.Show 2 breakdown fields
bystringHow the score is split:
category,monthorprice_band.rowsobject[]One score for each bucket. Each row has
bucketnext to the score fields.Show 10 rows fields
bucketstringThe bucket: the venue's own category name, a month written as
YYYY-MM, or a price band such as0.40-0.60.tradesintegerThe number of trades the idea matched in the window, settled or not.
settledintegerThe number of matched trades that settled.
winsintegerThe number of settled trades that won.
lossesintegerThe number of settled trades that lost.
openintegerThe number of trades still open. Rivo counts them but does not score them.
winRatenumber or nullThe share of settled trades that won, from 0 to 1. It is
nulluntil a trade settles.stakednumberThe dollars staked on settled trades at the sizing you gave.
profitnumberThe profit in USD, with each trade held to settlement at the price paid, or sold at the trader's sale with
mirrorExits.returnnumber or nullThe profit divided by the dollars staked. It is
nullwhen nothing was staked.
byCategoryobject[]The record by the venue's own category name. Only trader backtests return it.
Show 5 byCategory fields
categorystringThe venue's name for the category.
settledintegerThe number of settled trades.
winsintegerThe number of wins.
profitnumberThe profit in USD.
returnnumber or nullThe profit divided by the dollars staked.
liveobject or nullThe 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.nullwhere the venue has no live copies to measure from.Show 8 live fields
stakednumberThe dollars staked, weighted by each trade's chance of filling.
profitnumberThe profit in USD, after fees.
returnnumber or nullThe profit divided by the dollars staked.
fillRatenumber or nullThe share of the copied trades expected to fill, from 0 to 1.
copiesintegerThe number of real-money copies the fill rates rest on.
basisstringtraderwhen this trader has enough real-money copies of their own, elseprice_bandfor the venue and price.curveobject[]Trader backtests only. The weekly curve, with the same fields as
curve.slippageobject[] or nullTrader 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
liveestimate 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.nullwhere no copies were replayed, which is every venue but Kalshi.Show 7 slippage fields
centsintegerThe slippage, in cents over the trader's price.
fillRatenumber or nullThe share of the copied trades expected to fill at this setting, from 0 to 1.
stakednumberThe dollars staked, weighted by each trade's chance of filling.
profitnumberThe profit in USD, after fees.
returnnumber or nullThe profit divided by the dollars staked.
maxDrawdownnumber or nullThe deepest fall in running profit, in USD.
nullwith too few settled trades.copiesintegerThe number of real-money copies replayed at this setting.
A signal scored here matches what a signal bot built from the same signal would record. Rivo scores signals on whale trades only. If a signal names traders, it counts those traders' buys of any size.
Errors
| Code | When |
|---|---|
VALIDATION | You sent both signal and trader, or neither. You sent holdout, sweep or breakdown with trader. A sweep price is above 1, a minimum is above its maximum, or a field is unknown. |
QUOTA_EXCEEDED | The sweep's values would take the key past its per-minute limit. |