Perp Basis Convergence
When a perp trades far above its index, sell the perp and hold spot; the basis has to close, and funding pays you while it does.
- SignalBasis ≥ 40 bp
- EntryBuy spot · short perp
- ExitBasis ≤ 5 bp
How it works
Two legs, one spread · holds hours – days- index_price12/hIndex the perp should converge to
- ticker12/hPerp price and volume
- funding_rate_latest4/hFunding must not work against the short
- cex_fees1/hTaker fees on both legs
- SignalBasis ≥ 40 bpPerp price minus index price, every 5 minutes
- EntryBuy spot · short perpHeld 15 min, funding ≥ 0, perp volume ≥ $10M
- ExitBasis ≤ 5 bpOr 5 days in the trade
- RiskRebalance at 2% driftMargin ≥ 3× maintenance; fees inside the threshold
The signal
SUI · OKX perp − index · bp · sample| Hour (UTC) | Basis |
|---|---|
| Nov 14, 00:00 | 8.87 bp |
| Nov 14, 01:00 | 8.23 bp |
| Nov 14, 02:00 | 4.03 bp |
| Nov 14, 03:00 | 1.22 bp |
| Nov 14, 04:00 | 3.06 bp |
| Nov 14, 05:00 | 4.07 bp |
| Nov 14, 06:00 | 2.32 bp |
| Nov 14, 07:00 | 3.31 bp |
| Nov 14, 08:00 | 6.79 bp |
| Nov 14, 09:00 | 6.5 bp |
| Nov 14, 10:00 | 3.6 bp |
| Nov 14, 11:00 | 3.65 bp |
| Nov 14, 12:00 | 4.08 bp |
| Nov 14, 13:00 | 0.41 bp |
| Nov 14, 14:00 | -2.92 bp |
| Nov 14, 15:00 | -1.7 bp |
| Nov 14, 16:00 | -0.7 bp |
| Nov 14, 17:00 | -2.37 bp |
| Nov 14, 18:00 | -1.2 bp |
| Nov 14, 19:00 | 3.54 bp |
| Nov 14, 20:00 | 5.49 bp |
| Nov 14, 21:00 | 4.73 bp |
| Nov 14, 22:00 | 52.74 bp |
| Nov 14, 23:00 | 52.21 bp |
| Nov 15, 00:00 | 47.36 bp |
| Nov 15, 01:00 | 41.78 bp |
| Nov 15, 02:00 | 40.29 bp |
| Nov 15, 03:00 | 38.78 bp |
| Nov 15, 04:00 | 34.3 bp |
| Nov 15, 05:00 | 32.32 bp |
| Nov 15, 06:00 | 34.71 bp |
| Nov 15, 07:00 | 35.39 bp |
| Nov 15, 08:00 | 33.55 bp |
| Nov 15, 09:00 | 34.68 bp |
| Nov 15, 10:00 | 37.27 bp |
| Nov 15, 11:00 | 35.45 bp |
| Nov 15, 12:00 | 31.73 bp |
| Nov 15, 13:00 | 31.25 bp |
| Nov 15, 14:00 | 30.5 bp |
| Nov 15, 15:00 | 25.89 bp |
| Nov 15, 16:00 | 22.69 bp |
| Nov 15, 17:00 | 23.91 bp |
| Nov 15, 18:00 | 24.04 bp |
| Nov 15, 19:00 | 21.68 bp |
| Nov 15, 20:00 | 22.43 bp |
| Nov 15, 21:00 | 25.65 bp |
| Nov 15, 22:00 | 25.09 bp |
| Nov 15, 23:00 | 22.16 bp |
| Nov 16, 00:00 | 22.14 bp |
| Nov 16, 01:00 | 21.94 bp |
| Nov 16, 02:00 | 17.25 bp |
| Nov 16, 03:00 | 12.77 bp |
| Nov 16, 04:00 | 12.42 bp |
| Nov 16, 05:00 | 11.34 bp |
| Nov 16, 06:00 | 7.62 bp |
| Nov 16, 07:00 | 7.02 bp |
| Nov 16, 08:00 | 10 bp |
| Nov 16, 09:00 | 10.29 bp |
| Nov 16, 10:00 | 8.33 bp |
| Nov 16, 11:00 | 9.48 bp |
| Nov 16, 12:00 | 11.13 bp |
| Nov 16, 13:00 | 8.14 bp |
| Nov 16, 14:00 | 4.32 bp |
| Nov 16, 15:00 | 4.16 bp |
| Nov 16, 16:00 | 3.34 bp |
| Nov 16, 17:00 | -0.66 bp |
| Nov 16, 18:00 | -2.05 bp |
| Nov 16, 19:00 | 0.8 bp |
| Nov 16, 20:00 | 1.93 bp |
| Nov 16, 21:00 | 1.04 bp |
| Nov 16, 22:00 | 41.61 bp |
| Nov 16, 23:00 | 41.91 bp |
| Nov 17, 00:00 | 38.28 bp |
| Nov 17, 01:00 | 33.43 bp |
| Nov 17, 02:00 | 32.1 bp |
| Nov 17, 03:00 | 30.32 bp |
| Nov 17, 04:00 | 24.76 bp |
| Nov 17, 05:00 | 20.9 bp |
| Nov 17, 06:00 | 21.44 bp |
| Nov 17, 07:00 | 20.87 bp |
| Nov 17, 08:00 | 18.29 bp |
| Nov 17, 09:00 | 19.44 bp |
| Nov 17, 10:00 | 23.29 bp |
| Nov 17, 11:00 | 23.64 bp |
| Nov 17, 12:00 | 22.19 bp |
| Nov 17, 13:00 | 23.87 bp |
| Nov 17, 14:00 | 25.1 bp |
| Nov 17, 15:00 | 21.66 bp |
| Nov 17, 16:00 | 18.42 bp |
| Nov 17, 17:00 | 18.93 bp |
| Nov 17, 18:00 | 18.19 bp |
| Nov 17, 19:00 | 14.74 bp |
| Nov 17, 20:00 | 14.58 bp |
| Nov 17, 21:00 | 17.88 bp |
| Nov 17, 22:00 | 18.46 bp |
| Nov 17, 23:00 | 17.21 bp |
Sample backtest
Sample · illustrative 120D · not real performance| Date (UTC) | Equity |
|---|---|
| Jul 21 | 0.05% |
| Jul 22 | 0.08% |
| Jul 23 | 0.08% |
| Jul 24 | 0.11% |
| Jul 25 | 0.16% |
| Jul 26 | 0.2% |
| Jul 27 | 0.26% |
| Jul 28 | 0.28% |
| Jul 29 | 0.28% |
| Jul 30 | 0.29% |
| Jul 31 | 0.29% |
| Aug 1 | 0.33% |
| Aug 2 | 0.4% |
| Aug 3 | 0.44% |
| Aug 4 | 0.49% |
| Aug 5 | 0.51% |
| Aug 6 | 0.52% |
| Aug 7 | 0.58% |
| Aug 8 | 0.63% |
| Aug 9 | 0.71% |
| Aug 10 | 0.81% |
| Aug 11 | 0.86% |
| Aug 12 | 0.91% |
| Aug 13 | 0.96% |
| Aug 14 | 1% |
| Aug 15 | 1.09% |
| Aug 16 | 1.17% |
| Aug 17 | 1.24% |
| Aug 18 | 1.31% |
| Aug 19 | 1.33% |
| Aug 20 | 1.35% |
| Aug 21 | 1.4% |
| Aug 22 | 1.43% |
| Aug 23 | 1.5% |
| Aug 24 | 1.56% |
| Aug 25 | 1.57% |
| Aug 26 | 1.59% |
| Aug 27 | 1.58% |
| Aug 28 | 1.59% |
| Aug 29 | 1.64% |
| Aug 30 | 1.68% |
| Aug 31 | 1.73% |
| Sep 1 | 1.77% |
| Sep 2 | 1.77% |
| Sep 3 | 1.79% |
| Sep 4 | 1.83% |
| Sep 5 | 1.87% |
| Sep 6 | 1.96% |
| Sep 7 | 2.03% |
| Sep 8 | 2.08% |
| Sep 9 | 2.14% |
| Sep 10 | 2.17% |
| Sep 11 | 2.22% |
| Sep 12 | 2.31% |
| Sep 13 | 2.39% |
| Sep 14 | 2.48% |
| Sep 15 | 2.54% |
| Sep 16 | 2.57% |
| Sep 17 | 2.61% |
| Sep 18 | 2.65% |
| Sep 19 | 2.7% |
| Sep 20 | 2.79% |
| Sep 21 | 2.83% |
| Sep 22 | 2.86% |
| Sep 23 | 2.88% |
| Sep 24 | 2.87% |
| Sep 25 | 2.9% |
| Sep 26 | 2.94% |
| Sep 27 | 2.97% |
| Sep 28 | 3.03% |
| Sep 29 | 3.04% |
| Sep 30 | 3.05% |
| Oct 1 | 3.07% |
| Oct 2 | 3.08% |
| Oct 3 | 3.14% |
| Oct 4 | 3.22% |
| Oct 5 | 3.27% |
| Oct 6 | 3.33% |
| Oct 7 | 3.36% |
| Oct 8 | 3.39% |
| Oct 9 | 3.46% |
| Oct 10 | 3.52% |
| Oct 11 | 3.61% |
| Oct 12 | 3.71% |
| Oct 13 | 3.75% |
| Oct 14 | 3.81% |
| Oct 15 | 3.85% |
| Oct 16 | 3.88% |
| Oct 17 | 3.97% |
| Oct 18 | 4.04% |
| Oct 19 | 4.1% |
| Oct 20 | 4.15% |
| Oct 21 | 4.15% |
| Oct 22 | 4.17% |
| Oct 23 | 4.2% |
| Oct 24 | 4.22% |
| Oct 25 | 4.29% |
| Oct 26 | 4.33% |
| Oct 27 | 4.34% |
| Oct 28 | 4.35% |
| Oct 29 | 4.35% |
| Oct 30 | 4.37% |
| Oct 31 | 4.43% |
| Nov 1 | 4.47% |
| Nov 2 | 4.53% |
| Nov 3 | 4.58% |
| Nov 4 | 4.59% |
| Nov 5 | 4.63% |
| Nov 6 | 4.68% |
| Nov 7 | 4.75% |
| Nov 8 | 4.85% |
| Nov 9 | 4.92% |
| Nov 10 | 4.98% |
| Nov 11 | 5.03% |
| Nov 12 | 5.06% |
| Nov 13 | 5.13% |
| Nov 14 | 5.21% |
| Nov 15 | 5.28% |
| Nov 16 | 5.36% |
| Nov 17 | 5.4% |
Generated to show the shape of the strategy, not measured on real fills. Ask your agent to backtest on DataMaxi+ history before trading.
Backtest this strategy
One prompt: your agent pulls the history below, tests these rules with fees and slippage, and charts the equity curve and drawdown. Run it before you trust the sample above.
- Period
- The last 30 days at 5 minutes (one index_price call per coin)
- History calls
- 55
- Credits
- 350
- Cost per run
- ≈ $0.035
Backtest the "Perp Basis Convergence" strategy on DataMaxi+ history. Thesis: When a perp trades far above its index, sell the perp and hold spot; the basis has to close, and funding pays you while it does. Use the DataMaxi+ MCP server at https://mcp.datamaxiplus.com/mcp. Pull the history once, cache it, and run the backtest in your own code sandbox (Python is fine). ## History to pull (split the period with from/to; never refetch a range you have) 1. index_price(asset="SUI", interval="5m") — index price per asset, a month of 5-minute prints per call; about 5 calls 2. cex_candle(exchange="okx", market="futures", symbol="SUI-USDT", interval="5m") — OHLCV, up to 1,000 candles per call, history from Jan 2024; about 45 calls 3. funding_rate_history(exchange="okx", symbol="SUI-USDT", limit="100") — every funding print, 100 per call; about 5 calls Universe: SUI, SOL, DOGE, AVAX and LINK on OKX: spot and USDT perp Period: the last 30 days at 5 minutes (one index_price call per coin) ## Rules to test Signal: Perp last price minus the index price, in basis points, per symbol and venue, every 5 minutes. Entry: Basis ≥ 40 bp for 15 minutes with funding ≥ 0 and perp 24h volume ≥ $10M: buy spot, short the perp for the same size. Exit: Basis ≤ 5 bp, or 5 days. Risk: Rebalance when legs drift > 2% apart. Perp margin ≥ 3× maintenance. Count both taker fees in the entry threshold. ## Assumptions Costs: 0.1% spot and 0.05% perp taker per leg, 0.02% slippage per leg Data: Basis is the perp's 5-minute close against the index print at the same time, coarser than live ticks. Fee tiers keep no history; use today's and say so. Use only data stamped before each decision (no look-ahead). Say plainly where the data cannot test a rule. ## Report Net return, annualised return, Sharpe, max drawdown, number of trades, win rate and average hold, next to buy-and-hold over the same period. Chart the equity curve and the drawdown, and list the 5 worst trades. ## Budget About 55 history calls ≈ 350 credits ≈ $0.035 from my prepaid DataMaxi+ balance. Tell me how many calls you made. If DataMaxi+ is not connected, ask me to [connect DataMaxi+](https://claude.ai/customize/connectors?modal=add-custom-connector) using https://mcp.datamaxiplus.com/mcp before continuing.
Estimate from the call counts in the prompt. Your agent may pull less or more; it reports the calls it made.
Rules
| Signal | Perp last price minus the index price, in basis points, per symbol and venue, every 5 minutes. |
|---|---|
| Entry | Basis ≥ 40 bp for 15 minutes with funding ≥ 0 and perp 24h volume ≥ $10M: buy spot, short the perp for the same size. |
| Exit | Basis ≤ 5 bp, or 5 days. |
| Risk | Rebalance when legs drift > 2% apart. Perp margin ≥ 3× maintenance. Count both taker fees in the entry threshold. |
Data used
≈ $0.6168 / day| MCP tool · REST route | Dataset | Tier | Calls / h | Credits / day | USD / day |
|---|---|---|---|---|---|
index_price GET /index-price | Index price · forex | Aggregated · 20 cr | 12 | 5,760 | $0.576 |
ticker GET /ticker | Candle · ticker | Latest · 1 cr | 12 | 288 | $0.0288 |
funding_rate_latest GET /funding-rate/latest | Funding rate | Latest · 1 cr | 4 | 96 | $0.0096 |
cex_fees GET /cex/fees | Margin · fees | Latest · 1 cr | 1 | 24 | $0.0024 |
| Total | 29 | 6,168 | $0.6168 |
1 credit = $0.0001. Only successful calls are billed, from one balance shared by the API and MCP. Calls per hour are the suggested cadence; scale them to the symbols you watch.
Build it with your agent
Connect the MCP server →Open it in Claude with one click (it asks you to add the DataMaxi+ connector first if you haven't), or paste it into Cursor or any MCP client. It backtests first, then runs in paper mode and never places orders on its own.
Build the "Perp Basis Convergence" strategy for me with DataMaxi+ data. Thesis: When a perp trades far above its index, sell the perp and hold spot; the basis has to close, and funding pays you while it does. Connect to the DataMaxi+ MCP server at https://mcp.datamaxiplus.com/mcp (header X-DTMX-APIKEY, read from env DATAMAXI_API_KEY). ## Data (call these tools; arguments are examples — loop over the symbols and venues you need) 1. index_price(asset="SUI", interval="5m") — Index the perp should converge to; about 12×/hour 2. ticker(exchange="okx", symbol="SUI-USDT", market="futures") — Perp price and volume; about 12×/hour 3. funding_rate_latest(exchange="okx", symbol="SUI-USDT") — Funding must not work against the short; about 4×/hour 4. cex_fees(exchange="okx", symbol="SUI-USDT") — Taker fees on both legs; about 1×/hour ## Rules Signal: Perp last price minus the index price, in basis points, per symbol and venue, every 5 minutes. Entry: Basis ≥ 40 bp for 15 minutes with funding ≥ 0 and perp 24h volume ≥ $10M: buy spot, short the perp for the same size. Exit: Basis ≤ 5 bp, or 5 days. Risk: Rebalance when legs drift > 2% apart. Perp margin ≥ 3× maintenance. Count both taker fees in the entry threshold. ## What to do 1. Build the signal from the tools above and backtest the rules on the history you can pull; report trades, win rate, average trade and max drawdown. 2. Then run it live in paper mode and show me symbols with basis ≥ 40 bp, funding, volume and net capture after fees, refreshed on the cadence above. 3. Never place real orders. Propose trades and wait for my confirmation. ## Budget Every call is billed from my prepaid DataMaxi+ balance. Expected load: ~29 calls/hour ≈ 6,168 credits/day (≈ $0.62/day). Cache results, never repeat a call inside its refresh window, and print the number of calls each refresh made. If DataMaxi+ is not connected, ask me to [connect DataMaxi+](https://claude.ai/customize/connectors?modal=add-custom-connector) using https://mcp.datamaxiplus.com/mcp before continuing.
Risk notes
- Basis can keep widening in a squeeze; the trade is hedged on price but the short leg still needs margin.
- Both legs sit on one venue, so venue risk is concentrated.
- Captures are small; fees and slippage decide whether this is worth running.
Educational example, not investment advice. Sample charts and figures are illustrative.
Keep exploring
Live screens, dashboards and the data behind this strategy.