True Markets Documentation
Trading infrastructure for centralized (CeFi) and decentralized (DeFi) markets. APIs and tools for traders, market makers, and integrators.
Developer Quickstart
Mint a JWT, fetch a quote, and place a market order. The full Gateway flow takes a few dozen lines in any language. Start with the Quick Start for the end-to-end walkthrough, or copy a snippet below.
- cURL
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
curl -X POST https://api.truemarkets.co/v1/conductor/quotes \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"base_asset": "BTC",
"quote_asset": "USDC",
"qty": "5",
"qty_unit": "quote",
"side": "buy"
}'
const quote = await (await fetch("https://api.truemarkets.co/v1/conductor/quotes", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
base_asset: "BTC",
quote_asset: "USDC",
qty: "5",
qty_unit: "quote",
side: "buy",
}),
})).json();
import os, requests
quote = requests.post(
"https://api.truemarkets.co/v1/conductor/quotes",
headers={"Authorization": f"Bearer {os.environ['TOKEN']}"},
json={
"base_asset": "BTC",
"quote_asset": "USDC",
"qty": "5",
"qty_unit": "quote",
"side": "buy",
},
).json()
String body = """
{
"base_asset": "BTC",
"quote_asset": "USDC",
"qty": "5",
"qty_unit": "quote",
"side": "buy"
}""";
HttpResponse<String> response = HttpClient.newHttpClient().send(
HttpRequest.newBuilder()
.uri(URI.create("https://api.truemarkets.co/v1/conductor/quotes"))
.header("Authorization", "Bearer " + System.getenv("TOKEN"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build(),
HttpResponse.BodyHandlers.ofString());
using System.Net.Http;
using System.Net.Http.Json;
var token = Environment.GetEnvironmentVariable("TOKEN");
var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token);
var quote = await http.PostAsJsonAsync(
"https://api.truemarkets.co/v1/conductor/quotes",
new {
base_asset = "BTC",
quote_asset = "USDC",
qty = "5",
qty_unit = "quote",
side = "buy",
});
<?php
$ch = curl_init('https://api.truemarkets.co/v1/conductor/quotes');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
'base_asset' => 'BTC',
'quote_asset' => 'USDC',
'qty' => '5',
'qty_unit' => 'quote',
'side' => 'buy',
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('TOKEN'),
'Content-Type: application/json',
],
CURLOPT_RETURNTRANSFER => true,
]);
$quote = json_decode(curl_exec($ch), true);
package main
import (
"bytes"
"encoding/json"
"io"
"net/http"
"os"
)
body, _ := json.Marshal(map[string]string{
"base_asset": "BTC",
"quote_asset": "USDC",
"qty": "5",
"qty_unit": "quote",
"side": "buy",
})
req, _ := http.NewRequest("POST",
"https://api.truemarkets.co/v1/conductor/quotes",
bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("TOKEN"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
quote, _ := io.ReadAll(res.Body)
require 'json'; require 'net/http'; require 'uri'
uri = URI('https://api.truemarkets.co/v1/conductor/quotes')
req = Net::HTTP::Post.new(uri,
'Authorization' => "Bearer #{ENV['TOKEN']}",
'Content-Type' => 'application/json')
req.body = JSON.generate(
base_asset: 'BTC', quote_asset: 'USDC',
qty: '5', qty_unit: 'quote', side: 'buy')
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
quote = JSON.parse(res.body)
library(httr); library(jsonlite)
quote <- POST("https://api.truemarkets.co/v1/conductor/quotes",
add_headers(Authorization = paste("Bearer", Sys.getenv("TOKEN"))),
body = toJSON(list(
base_asset = "BTC",
quote_asset = "USDC",
qty = "5",
qty_unit = "quote",
side = "buy"
), auto_unbox = TRUE),
content_type_json())
content(quote)
Get Familiar with True Markets
Pick a starting point based on what you're building.