Funding Rates
curl --request GET \
--url https://api.example.com/api/funding-ratesimport requests
url = "https://api.example.com/api/funding-rates"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/funding-rates', 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.example.com/api/funding-rates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/funding-rates"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/funding-rates")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/funding-rates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"symbol": "BTC",
"rawTicker": "BTCUSDT",
"exchange": "binance",
"rate": 0.0001,
"fundingTime": "2024-01-15T08:00:00.000Z",
"intervalHours": 8,
"markPrice": 42500.5,
"indexPrice": 42498.25
},
{
"symbol": "BTC",
"rawTicker": "BTCUSDT",
"exchange": "bybit",
"rate": 0.00012,
"fundingTime": "2024-01-15T08:00:00.000Z",
"intervalHours": 8,
"markPrice": 42501.2,
"indexPrice": 42499.0
}
]
}
Endpoints
Funding Rates
Endpoints pour acceder aux funding rates des contrats perpetuels
GET
/
api
/
funding-rates
Funding Rates
curl --request GET \
--url https://api.example.com/api/funding-ratesimport requests
url = "https://api.example.com/api/funding-rates"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/funding-rates', 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.example.com/api/funding-rates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/funding-rates"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/funding-rates")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/funding-rates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"symbol": "BTC",
"rawTicker": "BTCUSDT",
"exchange": "binance",
"rate": 0.0001,
"fundingTime": "2024-01-15T08:00:00.000Z",
"intervalHours": 8,
"markPrice": 42500.5,
"indexPrice": 42498.25
},
{
"symbol": "BTC",
"rawTicker": "BTCUSDT",
"exchange": "bybit",
"rate": 0.00012,
"fundingTime": "2024-01-15T08:00:00.000Z",
"intervalHours": 8,
"markPrice": 42501.2,
"indexPrice": 42499.0
}
]
}
GET /api/funding-rates
Recupere les funding rates actuels pour un symbole, agreges depuis plusieurs exchanges.Parametres
string
required
Symbole de l’actif (ex:
BTC, ETH, SOL). Case insensitive.string
Filtre par exchange :
binance, bybit, okx, deribit, hyperliquidstring
Filtre par devise de cotation (
USDT, USDC, USD).Reponse
FundingRate[]
Tableau des funding rates par exchange
Show FundingRate
Show FundingRate
string
Symbole normalise (
BTC, ETH, etc.)string
Ticker original de l’exchange (
BTCUSDT, BTC-PERPETUAL)string
Nom de l’exchange
number
Taux de funding (0.0001 = 0.01%)
string
Timestamp du funding (ISO 8601)
number
Intervalle de funding en heures (1, 4, ou 8)
number | null
Prix mark du contrat
number | null
Prix index (spot)
{
"data": [
{
"symbol": "BTC",
"rawTicker": "BTCUSDT",
"exchange": "binance",
"rate": 0.0001,
"fundingTime": "2024-01-15T08:00:00.000Z",
"intervalHours": 8,
"markPrice": 42500.5,
"indexPrice": 42498.25
},
{
"symbol": "BTC",
"rawTicker": "BTCUSDT",
"exchange": "bybit",
"rate": 0.00012,
"fundingTime": "2024-01-15T08:00:00.000Z",
"intervalHours": 8,
"markPrice": 42501.2,
"indexPrice": 42499.0
}
]
}
Exemples
curl "https://api.nefariouslabs.dev/api/funding-rates?symbol=BTC"
curl "https://api.nefariouslabs.dev/api/funding-rates?symbol=ETH&exchange=binance"
const response = await fetch(
"https://api.nefariouslabs.dev/api/funding-rates?symbol=BTC"
);
const { data } = await response.json();
// Trouver le taux le plus eleve
const maxRate = data.reduce((max, item) =>
item.rate > max.rate ? item : max
);
console.log(`Taux max: ${maxRate.rate} sur ${maxRate.exchange}`);
import requests
response = requests.get(
"https://api.nefariouslabs.dev/api/funding-rates",
params={"symbol": "BTC"}
)
data = response.json()["data"]
# Calculer le taux moyen
avg_rate = sum(item["rate"] for item in data) / len(data)
print(f"Taux moyen: {avg_rate:.6f}")
GET /api/funding-rates/history
Recupere l’historique des funding rates pour un symbole.Parametres
string
required
Symbole de l’actif (ex:
BTC, ETH, SOL). Case insensitive.string
Filtre par exchange :
binance, bybit, okx, deribit, hyperliquidstring
Date de debut (ISO 8601). Ex:
2024-01-01T00:00:00Zstring
Date de fin (ISO 8601). Ex:
2024-01-31T23:59:59Zinteger
default:"100"
Nombre de resultats (max: 1000)
Reponse
FundingRate[]
Tableau des funding rates historiques, tries par date decroissante
{
"data": [
{
"symbol": "ETH",
"rawTicker": "ETHUSDT",
"exchange": "binance",
"rate": 0.00015,
"fundingTime": "2024-01-15T16:00:00.000Z",
"intervalHours": 8,
"markPrice": 2450.75,
"indexPrice": 2449.5
},
{
"symbol": "ETH",
"rawTicker": "ETHUSDT",
"exchange": "binance",
"rate": 0.00012,
"fundingTime": "2024-01-15T08:00:00.000Z",
"intervalHours": 8,
"markPrice": 2445.25,
"indexPrice": 2444.0
}
]
}
Exemples
curl "https://api.nefariouslabs.dev/api/funding-rates/history?symbol=ETH&limit=50"
curl "https://api.nefariouslabs.dev/api/funding-rates/history?symbol=BTC&exchange=binance&from=2024-01-01T00:00:00Z&to=2024-01-31T23:59:59Z"
const response = await fetch(
"https://api.nefariouslabs.dev/api/funding-rates/history?" +
new URLSearchParams({
symbol: "BTC",
exchange: "binance",
from: "2024-01-01T00:00:00Z",
limit: "100"
})
);
const { data } = await response.json();
// Analyser l'evolution des taux
const rates = data.map(item => item.rate);
const avgRate = rates.reduce((a, b) => a + b, 0) / rates.length;
import requests
from datetime import datetime, timedelta
# Historique des 7 derniers jours
from_date = (datetime.utcnow() - timedelta(days=7)).isoformat() + "Z"
response = requests.get(
"https://api.nefariouslabs.dev/api/funding-rates/history",
params={
"symbol": "BTC",
"exchange": "binance",
"from": from_date,
"limit": 100
}
)
data = response.json()["data"]
GET /api/exchanges
Liste les exchanges disponibles avec leur statut.Reponse
Exchange[]
{
"data": [
{
"id": "binance",
"name": "Binance",
"defaultIntervalHours": 8,
"symbolCount": 245,
"isActive": true
},
{
"id": "bybit",
"name": "Bybit",
"defaultIntervalHours": 8,
"symbolCount": 198,
"isActive": true
},
{
"id": "hyperliquid",
"name": "Hyperliquid",
"defaultIntervalHours": 1,
"symbolCount": 142,
"isActive": true
}
]
}
Exemple
curl "https://api.nefariouslabs.dev/api/exchanges"
GET /health
Verifie la disponibilite du service.Reponse
string
Statut du service :
healthy, degraded, ou unhealthystring
Timestamp du check (ISO 8601)
ExchangeHealth[]
{
"status": "healthy",
"timestamp": "2024-01-15T16:10:00.000Z",
"exchanges": [
{
"exchange": "binance",
"status": "healthy",
"ageMinutes": 5
},
{
"exchange": "bybit",
"status": "healthy",
"ageMinutes": 5
}
]
}
Exemple
curl "https://api.nefariouslabs.dev/health"
⌘I