Referrals
public/get_referral_performance
Returns broker-program referral performance for a referral code, identified either by the code itself or by the referrer’s wallet, over a requested time window (start_ms to end_ms, capped at 28 days). The response includes total notional volume, referred fees, fee rewards, builder fees collected, the applicable fee-share percentage, and a per-role/currency/instrument-type breakdown, all as decimal strings.
POST
/
public
/
get_referral_performance
public/get_referral_performance
curl --request POST \
--url https://api.derive.xyz/v3/public/get_referral_performance \
--header 'Content-Type: application/json' \
--data '
{
"end_ms": 123,
"start_ms": 123,
"referral_code": null,
"wallet": null
}
'import requests
url = "https://api.derive.xyz/v3/public/get_referral_performance"
payload = {
"end_ms": 123,
"start_ms": 123,
"referral_code": None,
"wallet": None
}
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({end_ms: 123, start_ms: 123, referral_code: null, wallet: null})
};
fetch('https://api.derive.xyz/v3/public/get_referral_performance', 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.derive.xyz/v3/public/get_referral_performance",
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([
'end_ms' => 123,
'start_ms' => 123,
'referral_code' => null,
'wallet' => null
]),
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.derive.xyz/v3/public/get_referral_performance"
payload := strings.NewReader("{\n \"end_ms\": 123,\n \"start_ms\": 123,\n \"referral_code\": null,\n \"wallet\": null\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.derive.xyz/v3/public/get_referral_performance")
.header("Content-Type", "application/json")
.body("{\n \"end_ms\": 123,\n \"start_ms\": 123,\n \"referral_code\": null,\n \"wallet\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/public/get_referral_performance")
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 \"end_ms\": 123,\n \"start_ms\": 123,\n \"referral_code\": null,\n \"wallet\": null\n}"
response = http.request(request)
puts response.read_body{
"fee_share_percentage": "<string>",
"referral_code": "<string>",
"rewards": {},
"stdrv_balance": "<string>",
"total_builder_fee_collected": "<string>",
"total_fee_rewards": "<string>",
"total_notional_volume": "<string>",
"total_referred_fees": "<string>"
}{
"error": {
"code": 123,
"message": "<string>",
"data": "<string>"
}
}Body
application/json
Response
Success
Performance by liquidity role / currency / instrument type.
Show child attributes
Show child attributes
public/get_referral_performance
curl --request POST \
--url https://api.derive.xyz/v3/public/get_referral_performance \
--header 'Content-Type: application/json' \
--data '
{
"end_ms": 123,
"start_ms": 123,
"referral_code": null,
"wallet": null
}
'import requests
url = "https://api.derive.xyz/v3/public/get_referral_performance"
payload = {
"end_ms": 123,
"start_ms": 123,
"referral_code": None,
"wallet": None
}
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({end_ms: 123, start_ms: 123, referral_code: null, wallet: null})
};
fetch('https://api.derive.xyz/v3/public/get_referral_performance', 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.derive.xyz/v3/public/get_referral_performance",
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([
'end_ms' => 123,
'start_ms' => 123,
'referral_code' => null,
'wallet' => null
]),
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.derive.xyz/v3/public/get_referral_performance"
payload := strings.NewReader("{\n \"end_ms\": 123,\n \"start_ms\": 123,\n \"referral_code\": null,\n \"wallet\": null\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.derive.xyz/v3/public/get_referral_performance")
.header("Content-Type", "application/json")
.body("{\n \"end_ms\": 123,\n \"start_ms\": 123,\n \"referral_code\": null,\n \"wallet\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/public/get_referral_performance")
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 \"end_ms\": 123,\n \"start_ms\": 123,\n \"referral_code\": null,\n \"wallet\": null\n}"
response = http.request(request)
puts response.read_body{
"fee_share_percentage": "<string>",
"referral_code": "<string>",
"rewards": {},
"stdrv_balance": "<string>",
"total_builder_fee_collected": "<string>",
"total_fee_rewards": "<string>",
"total_notional_volume": "<string>",
"total_referred_fees": "<string>"
}{
"error": {
"code": 123,
"message": "<string>",
"data": "<string>"
}
}