Trigger settlement
Settle all positions for an expired round using TWAP prices.
Cancels resting orders on expired instruments and optionally creates
instruments for the next round. Idempotent — settling the same
expiration twice returns success with zero counts. When
next_expiration is provided, twap_prices must include BTC, ETH,
and SOL so rollover creation stays complete and deterministic.
POST
/
v1
/
admin
/
settle
Trigger settlement
curl --request POST \
--url https://joyride.exchange/api/v1/admin/settle \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expiration": 1740729600,
"twap_prices": {
"SOL": 180.25,
"BTC": 97500.5,
"ETH": 3200.75
},
"next_expiration": 1740816000
}
'import requests
url = "https://joyride.exchange/api/v1/admin/settle"
payload = {
"expiration": 1740729600,
"twap_prices": {
"SOL": 180.25,
"BTC": 97500.5,
"ETH": 3200.75
},
"next_expiration": 1740816000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expiration: 1740729600,
twap_prices: {SOL: 180.25, BTC: 97500.5, ETH: 3200.75},
next_expiration: 1740816000
})
};
fetch('https://joyride.exchange/api/v1/admin/settle', 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://joyride.exchange/api/v1/admin/settle",
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([
'expiration' => 1740729600,
'twap_prices' => [
'SOL' => 180.25,
'BTC' => 97500.5,
'ETH' => 3200.75
],
'next_expiration' => 1740816000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://joyride.exchange/api/v1/admin/settle"
payload := strings.NewReader("{\n \"expiration\": 1740729600,\n \"twap_prices\": {\n \"SOL\": 180.25,\n \"BTC\": 97500.5,\n \"ETH\": 3200.75\n },\n \"next_expiration\": 1740816000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://joyride.exchange/api/v1/admin/settle")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expiration\": 1740729600,\n \"twap_prices\": {\n \"SOL\": 180.25,\n \"BTC\": 97500.5,\n \"ETH\": 3200.75\n },\n \"next_expiration\": 1740816000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://joyride.exchange/api/v1/admin/settle")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expiration\": 1740729600,\n \"twap_prices\": {\n \"SOL\": 180.25,\n \"BTC\": 97500.5,\n \"ETH\": 3200.75\n },\n \"next_expiration\": 1740816000\n}"
response = http.request(request)
puts response.read_body{
"settled_instruments": 30,
"settled_positions": 42,
"cancelled_orders": 15,
"created_instruments": 30,
"settlements": [
{
"wallet": "<string>",
"instrument_id": "<string>",
"quantity": 123,
"avg_price": 123,
"settlement_price": 123,
"payout": 123,
"pnl": 123
}
]
}{
"error": "Instrument not found"
}{
"error": "Instrument not found"
}Authorizations
Admin token set via the ADMIN_TOKEN environment variable.
Body
application/json
Expiration to settle (Unix seconds)
Example:
1740729600
TWAP prices per asset in dollars (e.g., {"SOL": 180.25})
Show child attributes
Show child attributes
Example:
{
"SOL": 180.25,
"BTC": 97500.5,
"ETH": 3200.75
}
Optional — if set, creates instruments for the next round and requires BTC, ETH, and SOL entries in twap_prices
Example:
1740816000
⌘I
Trigger settlement
curl --request POST \
--url https://joyride.exchange/api/v1/admin/settle \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expiration": 1740729600,
"twap_prices": {
"SOL": 180.25,
"BTC": 97500.5,
"ETH": 3200.75
},
"next_expiration": 1740816000
}
'import requests
url = "https://joyride.exchange/api/v1/admin/settle"
payload = {
"expiration": 1740729600,
"twap_prices": {
"SOL": 180.25,
"BTC": 97500.5,
"ETH": 3200.75
},
"next_expiration": 1740816000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expiration: 1740729600,
twap_prices: {SOL: 180.25, BTC: 97500.5, ETH: 3200.75},
next_expiration: 1740816000
})
};
fetch('https://joyride.exchange/api/v1/admin/settle', 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://joyride.exchange/api/v1/admin/settle",
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([
'expiration' => 1740729600,
'twap_prices' => [
'SOL' => 180.25,
'BTC' => 97500.5,
'ETH' => 3200.75
],
'next_expiration' => 1740816000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://joyride.exchange/api/v1/admin/settle"
payload := strings.NewReader("{\n \"expiration\": 1740729600,\n \"twap_prices\": {\n \"SOL\": 180.25,\n \"BTC\": 97500.5,\n \"ETH\": 3200.75\n },\n \"next_expiration\": 1740816000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://joyride.exchange/api/v1/admin/settle")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expiration\": 1740729600,\n \"twap_prices\": {\n \"SOL\": 180.25,\n \"BTC\": 97500.5,\n \"ETH\": 3200.75\n },\n \"next_expiration\": 1740816000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://joyride.exchange/api/v1/admin/settle")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expiration\": 1740729600,\n \"twap_prices\": {\n \"SOL\": 180.25,\n \"BTC\": 97500.5,\n \"ETH\": 3200.75\n },\n \"next_expiration\": 1740816000\n}"
response = http.request(request)
puts response.read_body{
"settled_instruments": 30,
"settled_positions": 42,
"cancelled_orders": 15,
"created_instruments": 30,
"settlements": [
{
"wallet": "<string>",
"instrument_id": "<string>",
"quantity": 123,
"avg_price": 123,
"settlement_price": 123,
"payout": 123,
"pnl": 123
}
]
}{
"error": "Instrument not found"
}{
"error": "Instrument not found"
}