Backtest
curl --request POST \
--url https://api.bendbasis.com/v1/funding/arbitrage/backtest \
--header 'Content-Type: application/json' \
--data '
{
"long_market_id": 15036,
"short_market_id": 125,
"from": "2026-09-01",
"to": "2026-09-02",
"notional_per_leg": 10000,
"execution_cost_pct": 0.4
}
'import requests
url = "https://api.bendbasis.com/v1/funding/arbitrage/backtest"
payload = {
"long_market_id": 15036,
"short_market_id": 125,
"from": "2026-09-01",
"to": "2026-09-02",
"notional_per_leg": 10000,
"execution_cost_pct": 0.4
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
long_market_id: 15036,
short_market_id: 125,
from: '2026-09-01',
to: '2026-09-02',
notional_per_leg: 10000,
execution_cost_pct: 0.4
})
};
fetch('https://api.bendbasis.com/v1/funding/arbitrage/backtest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bendbasis.com/v1/funding/arbitrage/backtest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'long_market_id' => 15036,
'short_market_id' => 125,
'from' => '2026-09-01',
'to' => '2026-09-02',
'notional_per_leg' => 10000,
'execution_cost_pct' => 0.4
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bendbasis.com/v1/funding/arbitrage/backtest"
payload := strings.NewReader("{\n \"long_market_id\": 15036,\n \"short_market_id\": 125,\n \"from\": \"2026-09-01\",\n \"to\": \"2026-09-02\",\n \"notional_per_leg\": 10000,\n \"execution_cost_pct\": 0.4\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bendbasis.com/v1/funding/arbitrage/backtest")
.header("Content-Type", "application/json")
.body("{\n \"long_market_id\": 15036,\n \"short_market_id\": 125,\n \"from\": \"2026-09-01\",\n \"to\": \"2026-09-02\",\n \"notional_per_leg\": 10000,\n \"execution_cost_pct\": 0.4\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bendbasis.com/v1/funding/arbitrage/backtest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"long_market_id\": 15036,\n \"short_market_id\": 125,\n \"from\": \"2026-09-01\",\n \"to\": \"2026-09-02\",\n \"notional_per_leg\": 10000,\n \"execution_cost_pct\": 0.4\n}"
response = http.request(request)
puts response.read_body{
"data": {
"from": "2026-09-01",
"to": "2026-09-02",
"notional_per_leg": 10000,
"execution_cost_pct": 0.4,
"summary": {
"funding_pnl": -0.7729115921,
"execution_cost": 40,
"net_pnl": -40.7729115921,
"net_return_pct": -0.4077291159,
"net_apr": -148.8211273112
},
"series": [
{
"timestamp": "2026-09-01T00:00:00.000Z",
"funding_pnl": -0.6303,
"execution_cost": 20,
"net_pnl": -20.6303,
"cumulative_net_pnl": -20.6303
},
{
"timestamp": "2026-09-01T08:00:00.000Z",
"funding_pnl": 0,
"execution_cost": 0,
"net_pnl": 0,
"cumulative_net_pnl": -20.6303
},
{
"timestamp": "2026-09-01T16:00:00.000Z",
"funding_pnl": -0.1426115921,
"execution_cost": 20,
"net_pnl": -20.1426115921,
"cumulative_net_pnl": -40.7729115921
}
]
}
}{
"code": "VALIDATION_ERROR",
"message": "Invalid parameter"
}Funding
Backtest
Backtest a funding arbitrage pair
POST
/
v1
/
funding
/
arbitrage
/
backtest
Backtest
curl --request POST \
--url https://api.bendbasis.com/v1/funding/arbitrage/backtest \
--header 'Content-Type: application/json' \
--data '
{
"long_market_id": 15036,
"short_market_id": 125,
"from": "2026-09-01",
"to": "2026-09-02",
"notional_per_leg": 10000,
"execution_cost_pct": 0.4
}
'import requests
url = "https://api.bendbasis.com/v1/funding/arbitrage/backtest"
payload = {
"long_market_id": 15036,
"short_market_id": 125,
"from": "2026-09-01",
"to": "2026-09-02",
"notional_per_leg": 10000,
"execution_cost_pct": 0.4
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
long_market_id: 15036,
short_market_id: 125,
from: '2026-09-01',
to: '2026-09-02',
notional_per_leg: 10000,
execution_cost_pct: 0.4
})
};
fetch('https://api.bendbasis.com/v1/funding/arbitrage/backtest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bendbasis.com/v1/funding/arbitrage/backtest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'long_market_id' => 15036,
'short_market_id' => 125,
'from' => '2026-09-01',
'to' => '2026-09-02',
'notional_per_leg' => 10000,
'execution_cost_pct' => 0.4
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bendbasis.com/v1/funding/arbitrage/backtest"
payload := strings.NewReader("{\n \"long_market_id\": 15036,\n \"short_market_id\": 125,\n \"from\": \"2026-09-01\",\n \"to\": \"2026-09-02\",\n \"notional_per_leg\": 10000,\n \"execution_cost_pct\": 0.4\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bendbasis.com/v1/funding/arbitrage/backtest")
.header("Content-Type", "application/json")
.body("{\n \"long_market_id\": 15036,\n \"short_market_id\": 125,\n \"from\": \"2026-09-01\",\n \"to\": \"2026-09-02\",\n \"notional_per_leg\": 10000,\n \"execution_cost_pct\": 0.4\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bendbasis.com/v1/funding/arbitrage/backtest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"long_market_id\": 15036,\n \"short_market_id\": 125,\n \"from\": \"2026-09-01\",\n \"to\": \"2026-09-02\",\n \"notional_per_leg\": 10000,\n \"execution_cost_pct\": 0.4\n}"
response = http.request(request)
puts response.read_body{
"data": {
"from": "2026-09-01",
"to": "2026-09-02",
"notional_per_leg": 10000,
"execution_cost_pct": 0.4,
"summary": {
"funding_pnl": -0.7729115921,
"execution_cost": 40,
"net_pnl": -40.7729115921,
"net_return_pct": -0.4077291159,
"net_apr": -148.8211273112
},
"series": [
{
"timestamp": "2026-09-01T00:00:00.000Z",
"funding_pnl": -0.6303,
"execution_cost": 20,
"net_pnl": -20.6303,
"cumulative_net_pnl": -20.6303
},
{
"timestamp": "2026-09-01T08:00:00.000Z",
"funding_pnl": 0,
"execution_cost": 0,
"net_pnl": 0,
"cumulative_net_pnl": -20.6303
},
{
"timestamp": "2026-09-01T16:00:00.000Z",
"funding_pnl": -0.1426115921,
"execution_cost": 20,
"net_pnl": -20.1426115921,
"cumulative_net_pnl": -40.7729115921
}
]
}
}{
"code": "VALIDATION_ERROR",
"message": "Invalid parameter"
}Uses settled funding rates for the latest 30 days and daily aggregates for earlier dates.
curl -X POST "https://api.bendbasis.com/v1/funding/arbitrage/backtest" \
-H "Content-Type: application/json" \
-d '{"long_market_id":15036,"short_market_id":125}'
Body
application/json
Required range:
x >= 1Required range:
x >= 1Inclusive start.
Exclusive end.
USD notional allocated to each leg.
Required range:
x <= 1000000000000Total opening and closing cost as a percentage of per-leg notional.
Required range:
0 <= x <= 100Response
Backtest result
Show child attributes
Show child attributes
Was this page helpful?