Create Instrument
curl --request POST \
--url https://api.{your-broker}.slate-labs.com/instruments \
--header 'Content-Type: application/json' \
--data '
{
"symbol": "<string>",
"display_name": "<string>",
"category": "<string>",
"base_currency": "<string>",
"quote_currency": "<string>",
"pip_size": 123,
"margin_rate": 123,
"unit_currency": "USD",
"digits": 5,
"contract_size": 100000,
"min_lot": 0.01,
"max_lot": 100,
"lot_step": 0.01,
"spread": 0,
"swap_type": "pips",
"swap_long": 0,
"swap_short": 0,
"stale_threshold_ms": 1001,
"is_active": true,
"asset_class": "other",
"provider": "binance",
"provider_symbol": "<string>"
}
'import requests
url = "https://api.{your-broker}.slate-labs.com/instruments"
payload = {
"symbol": "<string>",
"display_name": "<string>",
"category": "<string>",
"base_currency": "<string>",
"quote_currency": "<string>",
"pip_size": 123,
"margin_rate": 123,
"unit_currency": "USD",
"digits": 5,
"contract_size": 100000,
"min_lot": 0.01,
"max_lot": 100,
"lot_step": 0.01,
"spread": 0,
"swap_type": "pips",
"swap_long": 0,
"swap_short": 0,
"stale_threshold_ms": 1001,
"is_active": True,
"asset_class": "other",
"provider": "binance",
"provider_symbol": "<string>"
}
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({
symbol: '<string>',
display_name: '<string>',
category: '<string>',
base_currency: '<string>',
quote_currency: '<string>',
pip_size: 123,
margin_rate: 123,
unit_currency: 'USD',
digits: 5,
contract_size: 100000,
min_lot: 0.01,
max_lot: 100,
lot_step: 0.01,
spread: 0,
swap_type: 'pips',
swap_long: 0,
swap_short: 0,
stale_threshold_ms: 1001,
is_active: true,
asset_class: 'other',
provider: 'binance',
provider_symbol: '<string>'
})
};
fetch('https://api.{your-broker}.slate-labs.com/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://api.{your-broker}.slate-labs.com/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([
'symbol' => '<string>',
'display_name' => '<string>',
'category' => '<string>',
'base_currency' => '<string>',
'quote_currency' => '<string>',
'pip_size' => 123,
'margin_rate' => 123,
'unit_currency' => 'USD',
'digits' => 5,
'contract_size' => 100000,
'min_lot' => 0.01,
'max_lot' => 100,
'lot_step' => 0.01,
'spread' => 0,
'swap_type' => 'pips',
'swap_long' => 0,
'swap_short' => 0,
'stale_threshold_ms' => 1001,
'is_active' => true,
'asset_class' => 'other',
'provider' => 'binance',
'provider_symbol' => '<string>'
]),
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.{your-broker}.slate-labs.com/instruments"
payload := strings.NewReader("{\n \"symbol\": \"<string>\",\n \"display_name\": \"<string>\",\n \"category\": \"<string>\",\n \"base_currency\": \"<string>\",\n \"quote_currency\": \"<string>\",\n \"pip_size\": 123,\n \"margin_rate\": 123,\n \"unit_currency\": \"USD\",\n \"digits\": 5,\n \"contract_size\": 100000,\n \"min_lot\": 0.01,\n \"max_lot\": 100,\n \"lot_step\": 0.01,\n \"spread\": 0,\n \"swap_type\": \"pips\",\n \"swap_long\": 0,\n \"swap_short\": 0,\n \"stale_threshold_ms\": 1001,\n \"is_active\": true,\n \"asset_class\": \"other\",\n \"provider\": \"binance\",\n \"provider_symbol\": \"<string>\"\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.{your-broker}.slate-labs.com/instruments")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"<string>\",\n \"display_name\": \"<string>\",\n \"category\": \"<string>\",\n \"base_currency\": \"<string>\",\n \"quote_currency\": \"<string>\",\n \"pip_size\": 123,\n \"margin_rate\": 123,\n \"unit_currency\": \"USD\",\n \"digits\": 5,\n \"contract_size\": 100000,\n \"min_lot\": 0.01,\n \"max_lot\": 100,\n \"lot_step\": 0.01,\n \"spread\": 0,\n \"swap_type\": \"pips\",\n \"swap_long\": 0,\n \"swap_short\": 0,\n \"stale_threshold_ms\": 1001,\n \"is_active\": true,\n \"asset_class\": \"other\",\n \"provider\": \"binance\",\n \"provider_symbol\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{your-broker}.slate-labs.com/instruments")
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 \"symbol\": \"<string>\",\n \"display_name\": \"<string>\",\n \"category\": \"<string>\",\n \"base_currency\": \"<string>\",\n \"quote_currency\": \"<string>\",\n \"pip_size\": 123,\n \"margin_rate\": 123,\n \"unit_currency\": \"USD\",\n \"digits\": 5,\n \"contract_size\": 100000,\n \"min_lot\": 0.01,\n \"max_lot\": 100,\n \"lot_step\": 0.01,\n \"spread\": 0,\n \"swap_type\": \"pips\",\n \"swap_long\": 0,\n \"swap_short\": 0,\n \"stale_threshold_ms\": 1001,\n \"is_active\": true,\n \"asset_class\": \"other\",\n \"provider\": \"binance\",\n \"provider_symbol\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"symbol": "<string>",
"display_name": "<string>",
"category": "<string>",
"base_currency": "<string>",
"quote_currency": "<string>",
"unit_currency": "USD",
"digits": 5,
"pip_size": 123,
"contract_size": 100000,
"min_lot": 0.01,
"max_lot": 100,
"lot_step": 0.01,
"margin_rate": 123,
"spread": 0,
"swap_type": "pips",
"swap_long": 0,
"swap_short": 0,
"stale_threshold_ms": 123,
"is_active": true,
"is_enabled": true,
"asset_class": "other",
"exchange": "<string>",
"provider": "<string>",
"provider_symbol": "<string>",
"last_bid": 123,
"last_ask": 123,
"last_tick_at": "2023-11-07T05:31:56Z",
"logo_base_url": "<string>",
"logo_quote_url": "<string>",
"localized_description": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Instruments & Groups
Create Instrument
Add a new broker instrument. Creates a backing Instrument row (for FK integrity) and a BrokerInstrument with all properties. The BrokerInstrument is the authoritative record returned to the caller.
POST
/
instruments
Create Instrument
curl --request POST \
--url https://api.{your-broker}.slate-labs.com/instruments \
--header 'Content-Type: application/json' \
--data '
{
"symbol": "<string>",
"display_name": "<string>",
"category": "<string>",
"base_currency": "<string>",
"quote_currency": "<string>",
"pip_size": 123,
"margin_rate": 123,
"unit_currency": "USD",
"digits": 5,
"contract_size": 100000,
"min_lot": 0.01,
"max_lot": 100,
"lot_step": 0.01,
"spread": 0,
"swap_type": "pips",
"swap_long": 0,
"swap_short": 0,
"stale_threshold_ms": 1001,
"is_active": true,
"asset_class": "other",
"provider": "binance",
"provider_symbol": "<string>"
}
'import requests
url = "https://api.{your-broker}.slate-labs.com/instruments"
payload = {
"symbol": "<string>",
"display_name": "<string>",
"category": "<string>",
"base_currency": "<string>",
"quote_currency": "<string>",
"pip_size": 123,
"margin_rate": 123,
"unit_currency": "USD",
"digits": 5,
"contract_size": 100000,
"min_lot": 0.01,
"max_lot": 100,
"lot_step": 0.01,
"spread": 0,
"swap_type": "pips",
"swap_long": 0,
"swap_short": 0,
"stale_threshold_ms": 1001,
"is_active": True,
"asset_class": "other",
"provider": "binance",
"provider_symbol": "<string>"
}
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({
symbol: '<string>',
display_name: '<string>',
category: '<string>',
base_currency: '<string>',
quote_currency: '<string>',
pip_size: 123,
margin_rate: 123,
unit_currency: 'USD',
digits: 5,
contract_size: 100000,
min_lot: 0.01,
max_lot: 100,
lot_step: 0.01,
spread: 0,
swap_type: 'pips',
swap_long: 0,
swap_short: 0,
stale_threshold_ms: 1001,
is_active: true,
asset_class: 'other',
provider: 'binance',
provider_symbol: '<string>'
})
};
fetch('https://api.{your-broker}.slate-labs.com/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://api.{your-broker}.slate-labs.com/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([
'symbol' => '<string>',
'display_name' => '<string>',
'category' => '<string>',
'base_currency' => '<string>',
'quote_currency' => '<string>',
'pip_size' => 123,
'margin_rate' => 123,
'unit_currency' => 'USD',
'digits' => 5,
'contract_size' => 100000,
'min_lot' => 0.01,
'max_lot' => 100,
'lot_step' => 0.01,
'spread' => 0,
'swap_type' => 'pips',
'swap_long' => 0,
'swap_short' => 0,
'stale_threshold_ms' => 1001,
'is_active' => true,
'asset_class' => 'other',
'provider' => 'binance',
'provider_symbol' => '<string>'
]),
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.{your-broker}.slate-labs.com/instruments"
payload := strings.NewReader("{\n \"symbol\": \"<string>\",\n \"display_name\": \"<string>\",\n \"category\": \"<string>\",\n \"base_currency\": \"<string>\",\n \"quote_currency\": \"<string>\",\n \"pip_size\": 123,\n \"margin_rate\": 123,\n \"unit_currency\": \"USD\",\n \"digits\": 5,\n \"contract_size\": 100000,\n \"min_lot\": 0.01,\n \"max_lot\": 100,\n \"lot_step\": 0.01,\n \"spread\": 0,\n \"swap_type\": \"pips\",\n \"swap_long\": 0,\n \"swap_short\": 0,\n \"stale_threshold_ms\": 1001,\n \"is_active\": true,\n \"asset_class\": \"other\",\n \"provider\": \"binance\",\n \"provider_symbol\": \"<string>\"\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.{your-broker}.slate-labs.com/instruments")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"<string>\",\n \"display_name\": \"<string>\",\n \"category\": \"<string>\",\n \"base_currency\": \"<string>\",\n \"quote_currency\": \"<string>\",\n \"pip_size\": 123,\n \"margin_rate\": 123,\n \"unit_currency\": \"USD\",\n \"digits\": 5,\n \"contract_size\": 100000,\n \"min_lot\": 0.01,\n \"max_lot\": 100,\n \"lot_step\": 0.01,\n \"spread\": 0,\n \"swap_type\": \"pips\",\n \"swap_long\": 0,\n \"swap_short\": 0,\n \"stale_threshold_ms\": 1001,\n \"is_active\": true,\n \"asset_class\": \"other\",\n \"provider\": \"binance\",\n \"provider_symbol\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{your-broker}.slate-labs.com/instruments")
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 \"symbol\": \"<string>\",\n \"display_name\": \"<string>\",\n \"category\": \"<string>\",\n \"base_currency\": \"<string>\",\n \"quote_currency\": \"<string>\",\n \"pip_size\": 123,\n \"margin_rate\": 123,\n \"unit_currency\": \"USD\",\n \"digits\": 5,\n \"contract_size\": 100000,\n \"min_lot\": 0.01,\n \"max_lot\": 100,\n \"lot_step\": 0.01,\n \"spread\": 0,\n \"swap_type\": \"pips\",\n \"swap_long\": 0,\n \"swap_short\": 0,\n \"stale_threshold_ms\": 1001,\n \"is_active\": true,\n \"asset_class\": \"other\",\n \"provider\": \"binance\",\n \"provider_symbol\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"symbol": "<string>",
"display_name": "<string>",
"category": "<string>",
"base_currency": "<string>",
"quote_currency": "<string>",
"unit_currency": "USD",
"digits": 5,
"pip_size": 123,
"contract_size": 100000,
"min_lot": 0.01,
"max_lot": 100,
"lot_step": 0.01,
"margin_rate": 123,
"spread": 0,
"swap_type": "pips",
"swap_long": 0,
"swap_short": 0,
"stale_threshold_ms": 123,
"is_active": true,
"is_enabled": true,
"asset_class": "other",
"exchange": "<string>",
"provider": "<string>",
"provider_symbol": "<string>",
"last_bid": 123,
"last_ask": 123,
"last_tick_at": "2023-11-07T05:31:56Z",
"logo_base_url": "<string>",
"logo_quote_url": "<string>",
"localized_description": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Body
application/json
Required string length:
1 - 32Required string length:
1 - 64Required string length:
1 - 32Required string length:
1 - 8Required string length:
1 - 8Maximum string length:
8Required range:
x >= 0Required range:
x >= 1Required range:
x >= 0Required range:
x >= 1000Maximum string length:
32Maximum string length:
32Maximum string length:
64Response
Successful Response
⌘I