curl --request GET \
--url https://www.sharpe.ai/api/v1/arbitrage/funding-spread-history \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.sharpe.ai/api/v1/arbitrage/funding-spread-history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.sharpe.ai/api/v1/arbitrage/funding-spread-history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"mode": "spot-perp",
"coin": "<string>",
"direction": "short",
"days": 123,
"legs": [
{
"role": "perp",
"venue": "<string>",
"contract": "<string>",
"contractSource": "given",
"side": "long",
"intervalHours": 123,
"settlements": 123,
"firstSettledAt": "2023-11-07T05:31:56Z",
"lastSettledAt": "2023-11-07T05:31:56Z",
"takerFee": 123
}
],
"spot": {
"venue": "<string>",
"takerFee": 123
},
"roundTripFees": 123,
"requiresBorrow": true,
"borrowCostIncluded": true,
"borrowApr": 123,
"windowEnd": "2023-11-07T05:31:56Z",
"series": [
{
"at": "2023-11-07T05:31:56Z",
"spreadApr": 123,
"legAprs": [
123
],
"cashflow": 123,
"cumulativeCarry": 123,
"estimated": true
}
],
"backtests": [
{
"days": 123,
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"coveredDays": 123,
"complete": true,
"coverageRatio": 0.5,
"estimatedSettlements": 1,
"fundingCollected": 123,
"fees": 123,
"netReturn": 123,
"grossApr": 123,
"netApr": 123,
"negativeCarryDays": 123,
"daysObserved": 123,
"maxDrawdown": 1,
"breakEvenDays": 123
}
]
},
"meta": {
"request_id": "req_a1b2c3d4e5f6g7h8i9j0",
"timestamp": "2023-11-07T05:31:56Z",
"elapsed_ms": 1,
"dataset_id": "funding_rates_current",
"as_of": "2023-11-07T05:31:56Z",
"stale_after": "2023-11-07T05:31:56Z",
"freshness_sla_seconds": 123,
"freshness_status": "fresh",
"runtime_status": "ok",
"served_from": "snapshot",
"generated_at": "2023-11-07T05:31:56Z",
"source": [
"<string>"
],
"coverage": {
"expected": 123,
"used": 123,
"dropped": {},
"missing": [
"<string>"
]
},
"warnings": [
"<string>"
],
"truncated": true
}
}Funding spread history and carry backtest
Returns a pair’s historical funding spread and a carry backtest from stored settlements: a spot-perp carry on one venue (spot pays no funding) or a cross-exchange carry (long one perp, short another). The legs are aligned by settlement time (a 1h leg against an 8h leg reads the 8h settlement for each hour it covers), intervals come from the settlements themselves, never an assumed 8h. Backtests over 1-90 days sum the settlements in the window, charge each venue’s entry and exit taker fees once, and report net return, annualized net APR, days with negative carry, max drawdown of cumulative carry and coverage. A short-spot leg (spot-perp long) is charged the venue’s current borrow APR pro rata where the venue publishes one (borrowApr, borrowCostIncluded).
curl --request GET \
--url https://www.sharpe.ai/api/v1/arbitrage/funding-spread-history \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.sharpe.ai/api/v1/arbitrage/funding-spread-history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.sharpe.ai/api/v1/arbitrage/funding-spread-history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"mode": "spot-perp",
"coin": "<string>",
"direction": "short",
"days": 123,
"legs": [
{
"role": "perp",
"venue": "<string>",
"contract": "<string>",
"contractSource": "given",
"side": "long",
"intervalHours": 123,
"settlements": 123,
"firstSettledAt": "2023-11-07T05:31:56Z",
"lastSettledAt": "2023-11-07T05:31:56Z",
"takerFee": 123
}
],
"spot": {
"venue": "<string>",
"takerFee": 123
},
"roundTripFees": 123,
"requiresBorrow": true,
"borrowCostIncluded": true,
"borrowApr": 123,
"windowEnd": "2023-11-07T05:31:56Z",
"series": [
{
"at": "2023-11-07T05:31:56Z",
"spreadApr": 123,
"legAprs": [
123
],
"cashflow": 123,
"cumulativeCarry": 123,
"estimated": true
}
],
"backtests": [
{
"days": 123,
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"coveredDays": 123,
"complete": true,
"coverageRatio": 0.5,
"estimatedSettlements": 1,
"fundingCollected": 123,
"fees": 123,
"netReturn": 123,
"grossApr": 123,
"netApr": 123,
"negativeCarryDays": 123,
"daysObserved": 123,
"maxDrawdown": 1,
"breakEvenDays": 123
}
]
},
"meta": {
"request_id": "req_a1b2c3d4e5f6g7h8i9j0",
"timestamp": "2023-11-07T05:31:56Z",
"elapsed_ms": 1,
"dataset_id": "funding_rates_current",
"as_of": "2023-11-07T05:31:56Z",
"stale_after": "2023-11-07T05:31:56Z",
"freshness_sla_seconds": 123,
"freshness_status": "fresh",
"runtime_status": "ok",
"served_from": "snapshot",
"generated_at": "2023-11-07T05:31:56Z",
"source": [
"<string>"
],
"coverage": {
"expected": 123,
"used": 123,
"dropped": {},
"missing": [
"<string>"
]
},
"warnings": [
"<string>"
],
"truncated": true
}
}
