Get Holding Rates
curl --request GET \
--url https://backend-global.gains.trade/api/holding-rates/{collateralIndex}/{pairIndex}import requests
url = "https://backend-global.gains.trade/api/holding-rates/{collateralIndex}/{pairIndex}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://backend-global.gains.trade/api/holding-rates/{collateralIndex}/{pairIndex}', 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://backend-global.gains.trade/api/holding-rates/{collateralIndex}/{pairIndex}",
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://backend-global.gains.trade/api/holding-rates/{collateralIndex}/{pairIndex}"
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://backend-global.gains.trade/api/holding-rates/{collateralIndex}/{pairIndex}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend-global.gains.trade/api/holding-rates/{collateralIndex}/{pairIndex}")
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{
"holdingRates": [
{}
]
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}Trading Data
Get Holding Rates
Returns historical borrowing and funding rates for a collateral and pair.
GET
/
api
/
holding-rates
/
{collateralIndex}
/
{pairIndex}
Get Holding Rates
curl --request GET \
--url https://backend-global.gains.trade/api/holding-rates/{collateralIndex}/{pairIndex}import requests
url = "https://backend-global.gains.trade/api/holding-rates/{collateralIndex}/{pairIndex}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://backend-global.gains.trade/api/holding-rates/{collateralIndex}/{pairIndex}', 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://backend-global.gains.trade/api/holding-rates/{collateralIndex}/{pairIndex}",
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://backend-global.gains.trade/api/holding-rates/{collateralIndex}/{pairIndex}"
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://backend-global.gains.trade/api/holding-rates/{collateralIndex}/{pairIndex}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend-global.gains.trade/api/holding-rates/{collateralIndex}/{pairIndex}")
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{
"holdingRates": [
{}
]
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}Endpoint
GET /api/holding-rates/{collateralIndex}/{pairIndex}
Returns historical borrowing and funding rates for a collateral and pair.
Parameters
| Parameter | Location | Required | Type | Description |
|---|---|---|---|---|
collateralIndex | path | Yes | integer | Collateral index. |
pairIndex | path | Yes | integer | Trading pair index. |
chainId | query | Yes | integer | Blockchain chain ID. Common values: 42161 Arbitrum, 8453 Base, 137 Polygon. |
Usage Example
curl -X GET "https://backend-global.gains.trade/api/holding-rates/1/0?chainId=42161"
Response Structure
The generated API panel lists the response schema for status codes: 200, 400, 503, 500. Error responses generally return anerror or message field.Path Parameters
Collateral index.
Example:
1
Trading pair index.
Example:
0
Query Parameters
Blockchain chain ID. Common values: 42161 Arbitrum, 8453 Base, 137 Polygon.
Example:
42161
Response
Successful response
