Create instruments
Create option instruments for a given asset and expiration.
If the target round is already paused (any existing instrument at
the same expiration has paused = true), newly created strikes
inherit the pause flag in BOTH the durable record and the in-memory
engine. This prevents
/v1/admin/instruments/pause-by-expiration from being silently
bypassed by a subsequent create-instruments call for the same
round.
POST
/
v1
/
admin
/
create-instruments
Create instruments
curl --request POST \
--url https://joyride.exchange/api/v1/admin/create-instruments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"asset": "SOL",
"expiration": 1740816000,
"spot_price": 180.25
}
'import requests
url = "https://joyride.exchange/api/v1/admin/create-instruments"
payload = {
"asset": "SOL",
"expiration": 1740816000,
"spot_price": 180.25
}
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({asset: 'SOL', expiration: 1740816000, spot_price: 180.25})
};
fetch('https://joyride.exchange/api/v1/admin/create-instruments', 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/create-instruments",
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([
'asset' => 'SOL',
'expiration' => 1740816000,
'spot_price' => 180.25
]),
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/create-instruments"
payload := strings.NewReader("{\n \"asset\": \"SOL\",\n \"expiration\": 1740816000,\n \"spot_price\": 180.25\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/create-instruments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"asset\": \"SOL\",\n \"expiration\": 1740816000,\n \"spot_price\": 180.25\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://joyride.exchange/api/v1/admin/create-instruments")
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 \"asset\": \"SOL\",\n \"expiration\": 1740816000,\n \"spot_price\": 180.25\n}"
response = http.request(request)
puts response.read_body{
"asset": "SOL",
"expiration": 1740816000,
"created": 10
}{
"error": "Instrument not found"
}Authorizations
Admin token set via the ADMIN_TOKEN environment variable.
Body
application/json
⌘I
Create instruments
curl --request POST \
--url https://joyride.exchange/api/v1/admin/create-instruments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"asset": "SOL",
"expiration": 1740816000,
"spot_price": 180.25
}
'import requests
url = "https://joyride.exchange/api/v1/admin/create-instruments"
payload = {
"asset": "SOL",
"expiration": 1740816000,
"spot_price": 180.25
}
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({asset: 'SOL', expiration: 1740816000, spot_price: 180.25})
};
fetch('https://joyride.exchange/api/v1/admin/create-instruments', 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/create-instruments",
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([
'asset' => 'SOL',
'expiration' => 1740816000,
'spot_price' => 180.25
]),
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/create-instruments"
payload := strings.NewReader("{\n \"asset\": \"SOL\",\n \"expiration\": 1740816000,\n \"spot_price\": 180.25\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/create-instruments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"asset\": \"SOL\",\n \"expiration\": 1740816000,\n \"spot_price\": 180.25\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://joyride.exchange/api/v1/admin/create-instruments")
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 \"asset\": \"SOL\",\n \"expiration\": 1740816000,\n \"spot_price\": 180.25\n}"
response = http.request(request)
puts response.read_body{
"asset": "SOL",
"expiration": 1740816000,
"created": 10
}{
"error": "Instrument not found"
}