ANDX API Reference

Programmatic GraphQL access to the ANDX exchange: 65 operations across 4 modules covering spot trading (instruments, orders, conversions and trading fees), deposits, withdrawals and fiat payments, the referral programme and derivatives trading.

Get a Bearer Token

Exchange your API key + secret for a JWT via service_signin, then pass it as Authorization: Bearer <token> on every request and to enable the Try It action below. Create an API key in your ANDX account settings. It returns an api_key_id and api_key_secret. Tokens are short-lived; sign in again to refresh.

Bearer access token

          

Introduction

The ANDX API is a GraphQL API. All requests are sent as POST to the /graphql endpoint with a JSON body containing query and variables, and an Authorization: Bearer <token> header.

Authentication

Programmatic access uses an API key + secret exchanged for a short-lived JWT.

  1. Create an API key in your ANDX account settings. It returns api_key_id and api_key_secret (the secret is shown only once).
  2. Exchange the key for a JWT: service_signin(service_api_key, service_api_secret) → { jwt, expires_at }.
  3. Send Authorization: Bearer <jwt> on every request. If the key has hmac_required enabled, also HMAC-sign each request with the secret.

Endpoints

ANDX exposes 2 GraphQL services. Every operation below states the endpoint it belongs to, and its Try It runner is already pointed at the right one:

https://vakotrade-andx.cryptosrvc.com/graphql Trade, Payments, Referral
https://margin-trading-service-andx.cryptosrvc.com/graphql Derivatives

Request shape

POST /graphql HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json

{
  "query": "query { instruments { instrument_id name } }",
  "variables": {}
}

Errors

GraphQL errors are returned in the errors array of the response body with HTTP status 200. Network and auth errors return non-200 statuses.

Permissions

Each operation is gated by a permission scope on the API key. A token only succeeds on operations the key's permissions grant.

Trade

24 operations across 7 areas · service: https://vakotrade-andx.cryptosrvc.com/graphql

Conversion

3 ops
query conversions Conversions
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
search String optional
pager PagerInput optional
dateRange DateRangeInput optional
wallet_id String required

Response

FieldSub-fields
conversion_id scalar
conversion_quote_id scalar
reference scalar
source_currency_id scalar
source_currency_amount scalar
target_currency_id scalar
target_currency_amount scalar
instrument_id scalar
fee_currency_id scalar
fee_currency_amount scalar
price scalar
status scalar
message scalar
error_message scalar
created_at_iso scalar
updated_at_iso scalar
wallet_id scalar
instrument name, base_currency_id, quantity_decimals, quote_quantity_decimals

GraphQL Operation

query conversions($search: String, $pager: PagerInput, $dateRange: DateRangeInput, $wallet_id: String!) {
  conversions(search: $search, pager: $pager, dateRange: $dateRange, wallet_id: $wallet_id) {
    conversion_id
    conversion_quote_id
    reference
    source_currency_id
    source_currency_amount
    target_currency_id
    target_currency_amount
    instrument_id
    fee_currency_id
    fee_currency_amount
    price
    status
    message
    error_message
    created_at_iso
    updated_at_iso
    wallet_id
    instrument {
      name
      base_currency_id
      quantity_decimals
      quote_quantity_decimals
    }
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query conversions($search: String, $pager: PagerInput, $dateRange: DateRangeInput, $wallet_id: String!) { conversions(search: $search, pager: $pager, dateRange: $dateRange, wallet_id: $wallet_id) { conversion_id conversion_quote_id reference source_currency_id source_currency_amount target_currency_id target_currency_amount instrument_id fee_currency_id fee_currency_amount price status message error_message created_at_iso updated_at_iso wallet_id instrument { name base_currency_id quantity_decimals quote_quantity_decimals } } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query conversions($search: String, $pager: PagerInput, $dateRange: DateRangeInput, $wallet_id: String!) { conversions(search: $search, pager: $pager, dateRange: $dateRange, wallet_id: $wallet_id) { conversion_id conversion_quote_id reference source_currency_id source_currency_amount target_currency_id target_currency_amount instrument_id fee_currency_id fee_currency_amount price status message error_message created_at_iso updated_at_iso wallet_id instrument { name base_currency_id quantity_decimals quote_quantity_decimals } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query conversions($search: String, $pager: PagerInput, $dateRange: DateRangeInput, $wallet_id: String!) { conversions(search: $search, pager: $pager, dateRange: $dateRange, wallet_id: $wallet_id) { conversion_id conversion_quote_id reference source_currency_id source_currency_amount target_currency_id target_currency_amount instrument_id fee_currency_id fee_currency_amount price status message error_message created_at_iso updated_at_iso wallet_id instrument { name base_currency_id quantity_decimals quote_quantity_decimals } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
mutation create_conversion_order Create Conversion Order
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
conversion_quote_id String required
wallet_id String required

Response

FieldSub-fields
status scalar
message scalar
created_at scalar
updated_at scalar
error_message scalar
price scalar
fee_currency_id scalar
fee_currency_amount scalar
conversion_quote_id scalar
source_currency_id scalar
target_currency_id scalar
target_currency_amount scalar
source_currency_amount scalar

GraphQL Operation

mutation create_conversion_order($conversion_quote_id: String!, $wallet_id: String!) {
  create_conversion_order(conversion_quote_id: $conversion_quote_id, wallet_id: $wallet_id) {
    status
    message
    created_at
    updated_at
    error_message
    price
    fee_currency_id
    fee_currency_amount
    conversion_quote_id
    source_currency_id
    target_currency_id
    target_currency_amount
    source_currency_amount
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation create_conversion_order($conversion_quote_id: String!, $wallet_id: String!) { create_conversion_order(conversion_quote_id: $conversion_quote_id, wallet_id: $wallet_id) { status message created_at updated_at error_message price fee_currency_id fee_currency_amount conversion_quote_id source_currency_id target_currency_id target_currency_amount source_currency_amount } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation create_conversion_order($conversion_quote_id: String!, $wallet_id: String!) { create_conversion_order(conversion_quote_id: $conversion_quote_id, wallet_id: $wallet_id) { status message created_at updated_at error_message price fee_currency_id fee_currency_amount conversion_quote_id source_currency_id target_currency_id target_currency_amount source_currency_amount } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation create_conversion_order($conversion_quote_id: String!, $wallet_id: String!) { create_conversion_order(conversion_quote_id: $conversion_quote_id, wallet_id: $wallet_id) { status message created_at updated_at error_message price fee_currency_id fee_currency_amount conversion_quote_id source_currency_id target_currency_id target_currency_amount source_currency_amount } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
mutation create_conversion_quote Create Conversion Quote
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
source_currency_id String required
target_currency_id String required
target_currency_amount Float optional
source_currency_amount Float optional
ttl Int optional
dry_run ToggleSwitch optional
instrument_id String optional

Response

FieldSub-fields
expires_at scalar
expires_at_iso scalar
current_time_iso scalar
fees currency_id, amount
price scalar
fee_currency_id scalar
fee_currency_amount scalar
conversion_quote_id scalar
source_currency_id scalar
target_currency_id scalar
target_currency_amount scalar
source_currency_amount scalar

GraphQL Operation

mutation create_conversion_quote($source_currency_id: String!, $target_currency_id: String!, $target_currency_amount: Float, $source_currency_amount: Float, $ttl: Int, $dry_run: ToggleSwitch, $instrument_id: String) {
  create_conversion_quote(source_currency_id: $source_currency_id, target_currency_id: $target_currency_id, target_currency_amount: $target_currency_amount, source_currency_amount: $source_currency_amount, ttl: $ttl, dry_run: $dry_run, instrument_id: $instrument_id) {
    expires_at
    expires_at_iso
    current_time_iso
    fees {
      currency_id
      amount
    }
    price
    fee_currency_id
    fee_currency_amount
    conversion_quote_id
    source_currency_id
    target_currency_id
    target_currency_amount
    source_currency_amount
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation create_conversion_quote($source_currency_id: String!, $target_currency_id: String!, $target_currency_amount: Float, $source_currency_amount: Float, $ttl: Int, $dry_run: ToggleSwitch, $instrument_id: String) { create_conversion_quote(source_currency_id: $source_currency_id, target_currency_id: $target_currency_id, target_currency_amount: $target_currency_amount, source_currency_amount: $source_currency_amount, ttl: $ttl, dry_run: $dry_run, instrument_id: $instrument_id) { expires_at expires_at_iso current_time_iso fees { currency_id amount } price fee_currency_id fee_currency_amount conversion_quote_id source_currency_id target_currency_id target_currency_amount source_currency_amount } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation create_conversion_quote($source_currency_id: String!, $target_currency_id: String!, $target_currency_amount: Float, $source_currency_amount: Float, $ttl: Int, $dry_run: ToggleSwitch, $instrument_id: String) { create_conversion_quote(source_currency_id: $source_currency_id, target_currency_id: $target_currency_id, target_currency_amount: $target_currency_amount, source_currency_amount: $source_currency_amount, ttl: $ttl, dry_run: $dry_run, instrument_id: $instrument_id) { expires_at expires_at_iso current_time_iso fees { currency_id amount } price fee_currency_id fee_currency_amount conversion_quote_id source_currency_id target_currency_id target_currency_amount source_currency_amount } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation create_conversion_quote($source_currency_id: String!, $target_currency_id: String!, $target_currency_amount: Float, $source_currency_amount: Float, $ttl: Int, $dry_run: ToggleSwitch, $instrument_id: String) { create_conversion_quote(source_currency_id: $source_currency_id, target_currency_id: $target_currency_id, target_currency_amount: $target_currency_amount, source_currency_amount: $source_currency_amount, ttl: $ttl, dry_run: $dry_run, instrument_id: $instrument_id) { expires_at expires_at_iso current_time_iso fees { currency_id amount } price fee_currency_id fee_currency_amount conversion_quote_id source_currency_id target_currency_id target_currency_amount source_currency_amount } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this

Currencies

1 op
query currencies Currencies
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
limit Int required
store_mode ToggleSwitch optional

Response

FieldSub-fields
currency_id scalar
name scalar
precision scalar
type scalar
is_active scalar

GraphQL Operation

query currencies($limit: Int!, $store_mode: ToggleSwitch) {
  currencies(limit: $limit, store_mode: $store_mode) {
    currency_id
    name
    precision
    type
    is_active
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query currencies($limit: Int!, $store_mode: ToggleSwitch) { currencies(limit: $limit, store_mode: $store_mode) { currency_id name precision type is_active } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query currencies($limit: Int!, $store_mode: ToggleSwitch) { currencies(limit: $limit, store_mode: $store_mode) { currency_id name precision type is_active } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query currencies($limit: Int!, $store_mode: ToggleSwitch) { currencies(limit: $limit, store_mode: $store_mode) { currency_id name precision type is_active } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this

Currency Prices

2 ops
query currency_prices Currency Prices
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
base_currencies [String!] required
quote_currency String required

Response

FieldSub-fields
base_currency_id scalar
quote_currency_id scalar
ask scalar
bid scalar
source scalar
updated_at scalar

GraphQL Operation

query currency_prices($base_currencies: [String!]!, $quote_currency: String!) {
  currency_prices(base_currencies: $base_currencies, quote_currency: $quote_currency) {
    base_currency_id
    quote_currency_id
    ask
    bid
    source
    updated_at
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query currency_prices($base_currencies: [String!]!, $quote_currency: String!) { currency_prices(base_currencies: $base_currencies, quote_currency: $quote_currency) { base_currency_id quote_currency_id ask bid source updated_at } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query currency_prices($base_currencies: [String!]!, $quote_currency: String!) { currency_prices(base_currencies: $base_currencies, quote_currency: $quote_currency) { base_currency_id quote_currency_id ask bid source updated_at } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query currency_prices($base_currencies: [String!]!, $quote_currency: String!) { currency_prices(base_currencies: $base_currencies, quote_currency: $quote_currency) { base_currency_id quote_currency_id ask bid source updated_at } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
subscription currency_prices Currency Prices
Endpoint: WS https://vakotrade-andx.cryptosrvc.com/graphql
Type: Subscription

Inputs

NameTypeRequired
base_currencies [String!] required
quote_currency String required

Response

FieldSub-fields
base_currency_id scalar
quote_currency_id scalar
ask scalar
bid scalar
source scalar
updated_at scalar

GraphQL Operation

subscription currency_prices($base_currencies: [String!]!, $quote_currency: String!) {
  currency_prices(base_currencies: $base_currencies, quote_currency: $quote_currency) {
    base_currency_id
    quote_currency_id
    ask
    bid
    source
    updated_at
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"subscription currency_prices($base_currencies: [String!]!, $quote_currency: String!) { currency_prices(base_currencies: $base_currencies, quote_currency: $quote_currency) { base_currency_id quote_currency_id ask bid source updated_at } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """subscription currency_prices($base_currencies: [String!]!, $quote_currency: String!) { currency_prices(base_currencies: $base_currencies, quote_currency: $quote_currency) { base_currency_id quote_currency_id ask bid source updated_at } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `subscription currency_prices($base_currencies: [String!]!, $quote_currency: String!) { currency_prices(base_currencies: $base_currencies, quote_currency: $quote_currency) { base_currency_id quote_currency_id ask bid source updated_at } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Subscriptions are delivered over WebSocket (wss://). Use a GraphQL-WS client rather than this HTTP runner.

Authenticate at the top of the page to try this

Instruments

4 ops
subscription instrument_price Instrument Price
Endpoint: WS https://vakotrade-andx.cryptosrvc.com/graphql
Type: Subscription

Inputs

NameTypeRequired
instrument_id String optional

Response

FieldSub-fields
instrument_id scalar
ask scalar
bid scalar
price_24h_change scalar
ts_iso scalar

GraphQL Operation

subscription instrument_price($instrument_id: String) {
  instrument_price(instrument_id: $instrument_id) {
    instrument_id
    ask
    bid
    price_24h_change
    ts_iso
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"subscription instrument_price($instrument_id: String) { instrument_price(instrument_id: $instrument_id) { instrument_id ask bid price_24h_change ts_iso } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """subscription instrument_price($instrument_id: String) { instrument_price(instrument_id: $instrument_id) { instrument_id ask bid price_24h_change ts_iso } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `subscription instrument_price($instrument_id: String) { instrument_price(instrument_id: $instrument_id) { instrument_id ask bid price_24h_change ts_iso } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Subscriptions are delivered over WebSocket (wss://). Use a GraphQL-WS client rather than this HTTP runner.

Authenticate at the top of the page to try this
subscription instrument_price_bar Instrument Price Bar
Endpoint: WS https://vakotrade-andx.cryptosrvc.com/graphql
Type: Subscription

Inputs

NameTypeRequired
instrument_id String required
periodicity InstrumentHistoryPeriodicity required

Response

FieldSub-fields
instrument_id scalar
high scalar
low scalar
ts_iso scalar
close scalar
open scalar

GraphQL Operation

subscription instrument_price_bar($instrument_id: String!, $periodicity: InstrumentHistoryPeriodicity!) {
  instrument_price_bar(instrument_id: $instrument_id, periodicity: $periodicity) {
    instrument_id
    high
    low
    ts_iso
    close
    open
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"subscription instrument_price_bar($instrument_id: String!, $periodicity: InstrumentHistoryPeriodicity!) { instrument_price_bar(instrument_id: $instrument_id, periodicity: $periodicity) { instrument_id high low ts_iso close open } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """subscription instrument_price_bar($instrument_id: String!, $periodicity: InstrumentHistoryPeriodicity!) { instrument_price_bar(instrument_id: $instrument_id, periodicity: $periodicity) { instrument_id high low ts_iso close open } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `subscription instrument_price_bar($instrument_id: String!, $periodicity: InstrumentHistoryPeriodicity!) { instrument_price_bar(instrument_id: $instrument_id, periodicity: $periodicity) { instrument_id high low ts_iso close open } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Subscriptions are delivered over WebSocket (wss://). Use a GraphQL-WS client rather than this HTTP runner.

Authenticate at the top of the page to try this
query instrument_price_bars Instrument Price Bars
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
instrument_id String required
limit String optional
date_range DateRangeInput optional
periodicity InstrumentHistoryPeriodicity optional

Response

FieldSub-fields
instrument_id scalar
high scalar
low scalar
ts_iso scalar
close scalar
open scalar

GraphQL Operation

query instrument_price_bars($instrument_id: String!, $limit: String, $date_range: DateRangeInput, $periodicity: InstrumentHistoryPeriodicity) {
  instrument_price_bars(instrument_id: $instrument_id, limit: $limit, date_range: $date_range, periodicity: $periodicity) {
    instrument_id
    high
    low
    ts_iso
    close
    open
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query instrument_price_bars($instrument_id: String!, $limit: String, $date_range: DateRangeInput, $periodicity: InstrumentHistoryPeriodicity) { instrument_price_bars(instrument_id: $instrument_id, limit: $limit, date_range: $date_range, periodicity: $periodicity) { instrument_id high low ts_iso close open } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query instrument_price_bars($instrument_id: String!, $limit: String, $date_range: DateRangeInput, $periodicity: InstrumentHistoryPeriodicity) { instrument_price_bars(instrument_id: $instrument_id, limit: $limit, date_range: $date_range, periodicity: $periodicity) { instrument_id high low ts_iso close open } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query instrument_price_bars($instrument_id: String!, $limit: String, $date_range: DateRangeInput, $periodicity: InstrumentHistoryPeriodicity) { instrument_price_bars(instrument_id: $instrument_id, limit: $limit, date_range: $date_range, periodicity: $periodicity) { instrument_id high low ts_iso close open } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query instruments Instruments
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
is_active ToggleSwitch optional
instrument_id String optional
search String optional
page Int optional
limit Int optional
sort SortInput optional

Response

FieldSub-fields
instrument_id scalar
price_bars instrument_id, high, low, ts_iso, close, open
name scalar
base_currency_id scalar
quote_currency_id scalar
quote_quantity_decimals scalar
quantity_decimals scalar
price_decimals scalar
min_quantity scalar
max_quantity scalar
min_quote_quantity scalar
max_quote_quantity scalar
is_active scalar
meta scalar
max_conversion_quote_ttl scalar
price instrument_id, ask, bid, price_24h_change, ts_iso
recent_price_bar high, low

GraphQL Operation

query instruments($is_active: ToggleSwitch, $instrument_id: String, $search: String, $page: Int, $limit: Int, $sort: SortInput) {
  instruments(is_active: $is_active, instrument_id: $instrument_id, search: $search, page: $page, limit: $limit, sort: $sort) {
    instrument_id
    price_bars {
      instrument_id
      high
      low
      ts_iso
      close
      open
    }
    name
    base_currency_id
    quote_currency_id
    quote_quantity_decimals
    quantity_decimals
    price_decimals
    min_quantity
    max_quantity
    min_quote_quantity
    max_quote_quantity
    is_active
    meta
    max_conversion_quote_ttl
    price {
      instrument_id
      ask
      bid
      price_24h_change
      ts_iso
    }
    recent_price_bar {
      high
      low
    }
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query instruments($is_active: ToggleSwitch, $instrument_id: String, $search: String, $page: Int, $limit: Int, $sort: SortInput) { instruments(is_active: $is_active, instrument_id: $instrument_id, search: $search, page: $page, limit: $limit, sort: $sort) { instrument_id price_bars { instrument_id high low ts_iso close open } name base_currency_id quote_currency_id quote_quantity_decimals quantity_decimals price_decimals min_quantity max_quantity min_quote_quantity max_quote_quantity is_active meta max_conversion_quote_ttl price { instrument_id ask bid price_24h_change ts_iso } recent_price_bar { high low } } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query instruments($is_active: ToggleSwitch, $instrument_id: String, $search: String, $page: Int, $limit: Int, $sort: SortInput) { instruments(is_active: $is_active, instrument_id: $instrument_id, search: $search, page: $page, limit: $limit, sort: $sort) { instrument_id price_bars { instrument_id high low ts_iso close open } name base_currency_id quote_currency_id quote_quantity_decimals quantity_decimals price_decimals min_quantity max_quantity min_quote_quantity max_quote_quantity is_active meta max_conversion_quote_ttl price { instrument_id ask bid price_24h_change ts_iso } recent_price_bar { high low } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query instruments($is_active: ToggleSwitch, $instrument_id: String, $search: String, $page: Int, $limit: Int, $sort: SortInput) { instruments(is_active: $is_active, instrument_id: $instrument_id, search: $search, page: $page, limit: $limit, sort: $sort) { instrument_id price_bars { instrument_id high low ts_iso close open } name base_currency_id quote_currency_id quote_quantity_decimals quantity_decimals price_decimals min_quantity max_quantity min_quote_quantity max_quote_quantity is_active meta max_conversion_quote_ttl price { instrument_id ask bid price_24h_change ts_iso } recent_price_bar { high low } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this

Orders

9 ops
subscription all_orders All Orders
Endpoint: WS https://vakotrade-andx.cryptosrvc.com/graphql
Type: Subscription

Inputs

NameTypeRequired
instruments [String!] optional

Response

FieldSub-fields
order_id scalar
type scalar
side scalar
status scalar
price scalar
stop_price scalar
quantity scalar
executed_quantity scalar
remaining_quantity scalar
quantity_mode scalar
instrument_id scalar
message scalar
updated_at scalar
created_at scalar
expires_at scalar
expires_at_iso scalar
time_in_force scalar
vwap scalar
wallet_id scalar
instrument quote_currency_id, name, base_currency_id, quantity_decimals, quote_quantity_decimals, price_decimals
fees currency_id, amount, type

GraphQL Operation

subscription all_orders($instruments: [String!]) {
  all_orders(instruments: $instruments) {
    order_id
    type
    side
    status
    price
    stop_price
    quantity
    executed_quantity
    remaining_quantity
    quantity_mode
    instrument_id
    message
    updated_at
    created_at
    expires_at
    expires_at_iso
    time_in_force
    vwap
    wallet_id
    instrument {
      quote_currency_id
      name
      base_currency_id
      quantity_decimals
      quote_quantity_decimals
      price_decimals
    }
    fees {
      currency_id
      amount
      type
    }
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"subscription all_orders($instruments: [String!]) { all_orders(instruments: $instruments) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """subscription all_orders($instruments: [String!]) { all_orders(instruments: $instruments) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `subscription all_orders($instruments: [String!]) { all_orders(instruments: $instruments) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Subscriptions are delivered over WebSocket (wss://). Use a GraphQL-WS client rather than this HTTP runner.

Authenticate at the top of the page to try this
mutation cancel_all_orders Cancel All Orders
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

No input arguments.

Response

Returns a scalar value (e.g. a boolean flag or identifier).

GraphQL Operation

mutation cancel_all_orders {
  cancel_all_orders
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation cancel_all_orders { cancel_all_orders }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation cancel_all_orders { cancel_all_orders }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation cancel_all_orders { cancel_all_orders }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
mutation cancel_order Cancel Order
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
order_id String required

Response

Returns a scalar value (e.g. a boolean flag or identifier).

GraphQL Operation

mutation cancel_order($order_id: String!) {
  cancel_order(order_id: $order_id)
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation cancel_order($order_id: String!) { cancel_order(order_id: $order_id) }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation cancel_order($order_id: String!) { cancel_order(order_id: $order_id) }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation cancel_order($order_id: String!) { cancel_order(order_id: $order_id) }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query closed_orders Closed Orders
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
instrument_id String optional
status [OrderStatus!] optional
side OrderSide optional
pager PagerInput optional
dateRange DateRangeInput optional
parent_order_id String optional
wallet_id String required

Response

FieldSub-fields
order_id scalar
type scalar
side scalar
status scalar
price scalar
stop_price scalar
quantity scalar
executed_quantity scalar
remaining_quantity scalar
quantity_mode scalar
instrument_id scalar
message scalar
updated_at scalar
created_at scalar
expires_at scalar
expires_at_iso scalar
time_in_force scalar
vwap scalar
wallet_id scalar
instrument quote_currency_id, name, base_currency_id, quantity_decimals, quote_quantity_decimals, price_decimals
fees currency_id, amount, type
total scalar

GraphQL Operation

query closed_orders($instrument_id: String, $status: [OrderStatus!], $side: OrderSide, $pager: PagerInput, $dateRange: DateRangeInput, $parent_order_id: String, $wallet_id: String!) {
  closed_orders(instrument_id: $instrument_id, status: $status, side: $side, pager: $pager, dateRange: $dateRange, parent_order_id: $parent_order_id, wallet_id: $wallet_id) {
    order_id
    type
    side
    status
    price
    stop_price
    quantity
    executed_quantity
    remaining_quantity
    quantity_mode
    instrument_id
    message
    updated_at
    created_at
    expires_at
    expires_at_iso
    time_in_force
    vwap
    wallet_id
    instrument {
      quote_currency_id
      name
      base_currency_id
      quantity_decimals
      quote_quantity_decimals
      price_decimals
    }
    fees {
      currency_id
      amount
      type
    }
    total
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query closed_orders($instrument_id: String, $status: [OrderStatus!], $side: OrderSide, $pager: PagerInput, $dateRange: DateRangeInput, $parent_order_id: String, $wallet_id: String!) { closed_orders(instrument_id: $instrument_id, status: $status, side: $side, pager: $pager, dateRange: $dateRange, parent_order_id: $parent_order_id, wallet_id: $wallet_id) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } total } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query closed_orders($instrument_id: String, $status: [OrderStatus!], $side: OrderSide, $pager: PagerInput, $dateRange: DateRangeInput, $parent_order_id: String, $wallet_id: String!) { closed_orders(instrument_id: $instrument_id, status: $status, side: $side, pager: $pager, dateRange: $dateRange, parent_order_id: $parent_order_id, wallet_id: $wallet_id) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } total } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query closed_orders($instrument_id: String, $status: [OrderStatus!], $side: OrderSide, $pager: PagerInput, $dateRange: DateRangeInput, $parent_order_id: String, $wallet_id: String!) { closed_orders(instrument_id: $instrument_id, status: $status, side: $side, pager: $pager, dateRange: $dateRange, parent_order_id: $parent_order_id, wallet_id: $wallet_id) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } total } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
mutation create_order Create Order
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
instrument_id String required
type OrderType required
price Float optional
stop_price Float optional
side OrderSide required
time_in_force OrderTimeInForce required
quantity Float required
expires_at String optional
quantity_mode OrderQuantityMode optional
post_only ToggleSwitch optional
wallet_id String required

Response

FieldSub-fields
order_id scalar
type scalar
side scalar
status scalar
price scalar
stop_price scalar
quantity scalar
executed_quantity scalar
remaining_quantity scalar
quantity_mode scalar
instrument_id scalar
message scalar
updated_at scalar
created_at scalar
expires_at scalar
expires_at_iso scalar
time_in_force scalar
vwap scalar
wallet_id scalar
instrument quote_currency_id, name, base_currency_id, quantity_decimals, quote_quantity_decimals, price_decimals
fees currency_id, amount, type

GraphQL Operation

mutation create_order($instrument_id: String!, $type: OrderType!, $price: Float, $stop_price: Float, $side: OrderSide!, $time_in_force: OrderTimeInForce!, $quantity: Float!, $expires_at: String, $quantity_mode: OrderQuantityMode, $post_only: ToggleSwitch, $wallet_id: String!) {
  create_order(instrument_id: $instrument_id, type: $type, price: $price, stop_price: $stop_price, side: $side, time_in_force: $time_in_force, quantity: $quantity, expires_at: $expires_at, quantity_mode: $quantity_mode, post_only: $post_only, wallet_id: $wallet_id) {
    order_id
    type
    side
    status
    price
    stop_price
    quantity
    executed_quantity
    remaining_quantity
    quantity_mode
    instrument_id
    message
    updated_at
    created_at
    expires_at
    expires_at_iso
    time_in_force
    vwap
    wallet_id
    instrument {
      quote_currency_id
      name
      base_currency_id
      quantity_decimals
      quote_quantity_decimals
      price_decimals
    }
    fees {
      currency_id
      amount
      type
    }
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation create_order($instrument_id: String!, $type: OrderType!, $price: Float, $stop_price: Float, $side: OrderSide!, $time_in_force: OrderTimeInForce!, $quantity: Float!, $expires_at: String, $quantity_mode: OrderQuantityMode, $post_only: ToggleSwitch, $wallet_id: String!) { create_order(instrument_id: $instrument_id, type: $type, price: $price, stop_price: $stop_price, side: $side, time_in_force: $time_in_force, quantity: $quantity, expires_at: $expires_at, quantity_mode: $quantity_mode, post_only: $post_only, wallet_id: $wallet_id) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation create_order($instrument_id: String!, $type: OrderType!, $price: Float, $stop_price: Float, $side: OrderSide!, $time_in_force: OrderTimeInForce!, $quantity: Float!, $expires_at: String, $quantity_mode: OrderQuantityMode, $post_only: ToggleSwitch, $wallet_id: String!) { create_order(instrument_id: $instrument_id, type: $type, price: $price, stop_price: $stop_price, side: $side, time_in_force: $time_in_force, quantity: $quantity, expires_at: $expires_at, quantity_mode: $quantity_mode, post_only: $post_only, wallet_id: $wallet_id) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation create_order($instrument_id: String!, $type: OrderType!, $price: Float, $stop_price: Float, $side: OrderSide!, $time_in_force: OrderTimeInForce!, $quantity: Float!, $expires_at: String, $quantity_mode: OrderQuantityMode, $post_only: ToggleSwitch, $wallet_id: String!) { create_order(instrument_id: $instrument_id, type: $type, price: $price, stop_price: $stop_price, side: $side, time_in_force: $time_in_force, quantity: $quantity, expires_at: $expires_at, quantity_mode: $quantity_mode, post_only: $post_only, wallet_id: $wallet_id) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query estimate_order Estimate Order
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
source_currency_id String required
target_currency_id String required
price Float optional
target_currency_amount Float optional
source_currency_amount Float optional
instrument_id String optional

Response

FieldSub-fields
type scalar
price scalar
quantity scalar
side scalar
quantity_mode scalar
instrument instrument_id
fees currency_id, amount, type

GraphQL Operation

query estimate_order($source_currency_id: String!, $target_currency_id: String!, $price: Float, $target_currency_amount: Float, $source_currency_amount: Float, $instrument_id: String) {
  estimate_order(source_currency_id: $source_currency_id, target_currency_id: $target_currency_id, price: $price, target_currency_amount: $target_currency_amount, source_currency_amount: $source_currency_amount, instrument_id: $instrument_id) {
    type
    price
    quantity
    side
    quantity_mode
    instrument {
      instrument_id
    }
    fees {
      currency_id
      amount
      type
    }
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query estimate_order($source_currency_id: String!, $target_currency_id: String!, $price: Float, $target_currency_amount: Float, $source_currency_amount: Float, $instrument_id: String) { estimate_order(source_currency_id: $source_currency_id, target_currency_id: $target_currency_id, price: $price, target_currency_amount: $target_currency_amount, source_currency_amount: $source_currency_amount, instrument_id: $instrument_id) { type price quantity side quantity_mode instrument { instrument_id } fees { currency_id amount type } } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query estimate_order($source_currency_id: String!, $target_currency_id: String!, $price: Float, $target_currency_amount: Float, $source_currency_amount: Float, $instrument_id: String) { estimate_order(source_currency_id: $source_currency_id, target_currency_id: $target_currency_id, price: $price, target_currency_amount: $target_currency_amount, source_currency_amount: $source_currency_amount, instrument_id: $instrument_id) { type price quantity side quantity_mode instrument { instrument_id } fees { currency_id amount type } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query estimate_order($source_currency_id: String!, $target_currency_id: String!, $price: Float, $target_currency_amount: Float, $source_currency_amount: Float, $instrument_id: String) { estimate_order(source_currency_id: $source_currency_id, target_currency_id: $target_currency_id, price: $price, target_currency_amount: $target_currency_amount, source_currency_amount: $source_currency_amount, instrument_id: $instrument_id) { type price quantity side quantity_mode instrument { instrument_id } fees { currency_id amount type } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query open_orders Open Orders
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
instrument_id String optional
status [OrderStatus!] optional
side OrderSide optional
pager PagerInput optional
dateRange DateRangeInput optional
parent_order_id String optional
wallet_id String required

Response

FieldSub-fields
order_id scalar
type scalar
side scalar
status scalar
price scalar
stop_price scalar
quantity scalar
executed_quantity scalar
remaining_quantity scalar
quantity_mode scalar
instrument_id scalar
message scalar
updated_at scalar
created_at scalar
expires_at scalar
expires_at_iso scalar
time_in_force scalar
vwap scalar
wallet_id scalar
instrument quote_currency_id, name, base_currency_id, quantity_decimals, quote_quantity_decimals, price_decimals
fees currency_id, amount, type
created_at_iso scalar
updated_at_iso scalar

GraphQL Operation

query open_orders($instrument_id: String, $status: [OrderStatus!], $side: OrderSide, $pager: PagerInput, $dateRange: DateRangeInput, $parent_order_id: String, $wallet_id: String!) {
  open_orders(instrument_id: $instrument_id, status: $status, side: $side, pager: $pager, dateRange: $dateRange, parent_order_id: $parent_order_id, wallet_id: $wallet_id) {
    order_id
    type
    side
    status
    price
    stop_price
    quantity
    executed_quantity
    remaining_quantity
    quantity_mode
    instrument_id
    message
    updated_at
    created_at
    expires_at
    expires_at_iso
    time_in_force
    vwap
    wallet_id
    instrument {
      quote_currency_id
      name
      base_currency_id
      quantity_decimals
      quote_quantity_decimals
      price_decimals
    }
    fees {
      currency_id
      amount
      type
    }
    created_at_iso
    updated_at_iso
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query open_orders($instrument_id: String, $status: [OrderStatus!], $side: OrderSide, $pager: PagerInput, $dateRange: DateRangeInput, $parent_order_id: String, $wallet_id: String!) { open_orders(instrument_id: $instrument_id, status: $status, side: $side, pager: $pager, dateRange: $dateRange, parent_order_id: $parent_order_id, wallet_id: $wallet_id) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } created_at_iso updated_at_iso } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query open_orders($instrument_id: String, $status: [OrderStatus!], $side: OrderSide, $pager: PagerInput, $dateRange: DateRangeInput, $parent_order_id: String, $wallet_id: String!) { open_orders(instrument_id: $instrument_id, status: $status, side: $side, pager: $pager, dateRange: $dateRange, parent_order_id: $parent_order_id, wallet_id: $wallet_id) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } created_at_iso updated_at_iso } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query open_orders($instrument_id: String, $status: [OrderStatus!], $side: OrderSide, $pager: PagerInput, $dateRange: DateRangeInput, $parent_order_id: String, $wallet_id: String!) { open_orders(instrument_id: $instrument_id, status: $status, side: $side, pager: $pager, dateRange: $dateRange, parent_order_id: $parent_order_id, wallet_id: $wallet_id) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } created_at_iso updated_at_iso } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
subscription orderbook Orderbook
Endpoint: WS https://vakotrade-andx.cryptosrvc.com/graphql
Type: Subscription

Inputs

NameTypeRequired
instrument_id String required

Response

FieldSub-fields
instrument_id scalar
buy quantity, price
sell quantity, price

GraphQL Operation

subscription orderbook($instrument_id: String!) {
  orderbook(instrument_id: $instrument_id) {
    instrument_id
    buy {
      quantity
      price
    }
    sell {
      quantity
      price
    }
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"subscription orderbook($instrument_id: String!) { orderbook(instrument_id: $instrument_id) { instrument_id buy { quantity price } sell { quantity price } } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """subscription orderbook($instrument_id: String!) { orderbook(instrument_id: $instrument_id) { instrument_id buy { quantity price } sell { quantity price } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `subscription orderbook($instrument_id: String!) { orderbook(instrument_id: $instrument_id) { instrument_id buy { quantity price } sell { quantity price } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Subscriptions are delivered over WebSocket (wss://). Use a GraphQL-WS client rather than this HTTP runner.

Authenticate at the top of the page to try this
mutation update_open_order Update Open Order
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
order_id String required
quantity Float required
price Float required
expires_at String optional

Response

FieldSub-fields
order_id scalar
type scalar
side scalar
status scalar
price scalar
stop_price scalar
quantity scalar
executed_quantity scalar
remaining_quantity scalar
quantity_mode scalar
instrument_id scalar
message scalar
updated_at scalar
created_at scalar
expires_at scalar
expires_at_iso scalar
time_in_force scalar
vwap scalar
wallet_id scalar
instrument quote_currency_id, name, base_currency_id, quantity_decimals, quote_quantity_decimals, price_decimals
fees currency_id, amount, type

GraphQL Operation

mutation update_open_order($order_id: String!, $quantity: Float!, $price: Float!, $expires_at: String) {
  update_open_order(order_id: $order_id, quantity: $quantity, price: $price, expires_at: $expires_at) {
    order_id
    type
    side
    status
    price
    stop_price
    quantity
    executed_quantity
    remaining_quantity
    quantity_mode
    instrument_id
    message
    updated_at
    created_at
    expires_at
    expires_at_iso
    time_in_force
    vwap
    wallet_id
    instrument {
      quote_currency_id
      name
      base_currency_id
      quantity_decimals
      quote_quantity_decimals
      price_decimals
    }
    fees {
      currency_id
      amount
      type
    }
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation update_open_order($order_id: String!, $quantity: Float!, $price: Float!, $expires_at: String) { update_open_order(order_id: $order_id, quantity: $quantity, price: $price, expires_at: $expires_at) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation update_open_order($order_id: String!, $quantity: Float!, $price: Float!, $expires_at: String) { update_open_order(order_id: $order_id, quantity: $quantity, price: $price, expires_at: $expires_at) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation update_open_order($order_id: String!, $quantity: Float!, $price: Float!, $expires_at: String) { update_open_order(order_id: $order_id, quantity: $quantity, price: $price, expires_at: $expires_at) { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this

Trade

4 ops
query account_transactions Account Transactions
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
currency_id String optional
pager PagerInput optional
dateRange DateRangeInput optional
wallet_id String required
type AccountTransactionType optional

Response

FieldSub-fields
account_transaction_id scalar
serial_id scalar
parent_transaction_id scalar
client_transaction_id scalar
user_id scalar
account_id scalar
payment_id scalar
currency_id scalar
transaction_class scalar
type scalar
order_id scalar
trade_id scalar
conversion_id scalar
amount scalar
post_balance scalar
comment scalar
created_at scalar
created_at_iso scalar
created_by scalar
wallet_id scalar
payment manual_transaction_date_iso

GraphQL Operation

query account_transactions($currency_id: String, $pager: PagerInput, $dateRange: DateRangeInput, $wallet_id: String!, $type: AccountTransactionType) {
  account_transactions(currency_id: $currency_id, pager: $pager, dateRange: $dateRange, wallet_id: $wallet_id, type: $type) {
    account_transaction_id
    serial_id
    parent_transaction_id
    client_transaction_id
    user_id
    account_id
    payment_id
    currency_id
    transaction_class
    type
    order_id
    trade_id
    conversion_id
    amount
    post_balance
    comment
    created_at
    created_at_iso
    created_by
    wallet_id
    payment {
      manual_transaction_date_iso
    }
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query account_transactions($currency_id: String, $pager: PagerInput, $dateRange: DateRangeInput, $wallet_id: String!, $type: AccountTransactionType) { account_transactions(currency_id: $currency_id, pager: $pager, dateRange: $dateRange, wallet_id: $wallet_id, type: $type) { account_transaction_id serial_id parent_transaction_id client_transaction_id user_id account_id payment_id currency_id transaction_class type order_id trade_id conversion_id amount post_balance comment created_at created_at_iso created_by wallet_id payment { manual_transaction_date_iso } } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query account_transactions($currency_id: String, $pager: PagerInput, $dateRange: DateRangeInput, $wallet_id: String!, $type: AccountTransactionType) { account_transactions(currency_id: $currency_id, pager: $pager, dateRange: $dateRange, wallet_id: $wallet_id, type: $type) { account_transaction_id serial_id parent_transaction_id client_transaction_id user_id account_id payment_id currency_id transaction_class type order_id trade_id conversion_id amount post_balance comment created_at created_at_iso created_by wallet_id payment { manual_transaction_date_iso } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query account_transactions($currency_id: String, $pager: PagerInput, $dateRange: DateRangeInput, $wallet_id: String!, $type: AccountTransactionType) { account_transactions(currency_id: $currency_id, pager: $pager, dateRange: $dateRange, wallet_id: $wallet_id, type: $type) { account_transaction_id serial_id parent_transaction_id client_transaction_id user_id account_id payment_id currency_id transaction_class type order_id trade_id conversion_id amount post_balance comment created_at created_at_iso created_by wallet_id payment { manual_transaction_date_iso } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query accounts_balances Accounts Balances
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
wallet_id String optional

Response

FieldSub-fields
currency_id scalar
total_balance scalar
exposed_balance scalar
margin_exposure scalar
free_balance scalar

GraphQL Operation

query accounts_balances($wallet_id: String) {
  accounts_balances(wallet_id: $wallet_id) {
    currency_id
    total_balance
    exposed_balance
    margin_exposure
    free_balance
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query accounts_balances($wallet_id: String) { accounts_balances(wallet_id: $wallet_id) { currency_id total_balance exposed_balance margin_exposure free_balance } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query accounts_balances($wallet_id: String) { accounts_balances(wallet_id: $wallet_id) { currency_id total_balance exposed_balance margin_exposure free_balance } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query accounts_balances($wallet_id: String) { accounts_balances(wallet_id: $wallet_id) { currency_id total_balance exposed_balance margin_exposure free_balance } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query portfolio_history Portfolio History
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
currency_id String required
timestamp String required
interval PortfolioHistoryInterval required

Response

Returns a scalar value (e.g. a boolean flag or identifier).

GraphQL Operation

query portfolio_history($currency_id: String!, $timestamp: String!, $interval: PortfolioHistoryInterval!) {
  portfolio_history(currency_id: $currency_id, timestamp: $timestamp, interval: $interval)
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query portfolio_history($currency_id: String!, $timestamp: String!, $interval: PortfolioHistoryInterval!) { portfolio_history(currency_id: $currency_id, timestamp: $timestamp, interval: $interval) }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query portfolio_history($currency_id: String!, $timestamp: String!, $interval: PortfolioHistoryInterval!) { portfolio_history(currency_id: $currency_id, timestamp: $timestamp, interval: $interval) }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query portfolio_history($currency_id: String!, $timestamp: String!, $interval: PortfolioHistoryInterval!) { portfolio_history(currency_id: $currency_id, timestamp: $timestamp, interval: $interval) }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
subscription user_update User Update
Endpoint: WS https://vakotrade-andx.cryptosrvc.com/graphql
Type: Subscription

Inputs

No input arguments.

Response

FieldSub-fields
order order_id, type, side, status, price, stop_price, quantity, executed_quantity, remaining_quantity, quantity_mode, instrument_id, message, updated_at, created_at, expires_at, expires_at_iso, time_in_force, vwap, wallet_id, instrument, fees
account_transaction currency_id, type, amount, post_balance, order_id
payment payment_id, currency_id, amount, type, crypto_transaction_id, crypto_address, crypto_address_tag_type, crypto_address_tag_value, crypto_network, approval_status, psp_service_id, reference, fee_amount, status, message, error_message, comment, created_at, updated_at, manual_transaction_date_iso, fees_included, wallet_id, payment_route, account_transactions, properties
account account_id, balance
notification title, body, class, code, vars
healthcheck maintenance_message, maintenance_mode
conversion conversion_id, conversion_quote_id, reference, source_currency_id, source_currency_amount, target_currency_id, target_currency_amount, instrument_id, fee_currency_id, fee_currency_amount, price, status, message, error_message, created_at_iso, updated_at_iso, wallet_id, instrument

GraphQL Operation

subscription user_update {
  user_update {
    order {
      order_id
      type
      side
      status
      price
      stop_price
      quantity
      executed_quantity
      remaining_quantity
      quantity_mode
      instrument_id
      message
      updated_at
      created_at
      expires_at
      expires_at_iso
      time_in_force
      vwap
      wallet_id
      instrument {
        quote_currency_id
        name
        base_currency_id
        quantity_decimals
        quote_quantity_decimals
        price_decimals
      }
      fees {
        currency_id
        amount
        type
      }
    }
    account_transaction {
      currency_id
      type
      amount
      post_balance
      order_id
    }
    payment {
      payment_id
      currency_id
      amount
      type
      crypto_transaction_id
      crypto_address
      crypto_address_tag_type
      crypto_address_tag_value
      crypto_network
      approval_status
      psp_service_id
      reference
      fee_amount
      status
      message
      error_message
      comment
      created_at
      updated_at
      manual_transaction_date_iso
      fees_included
      wallet_id
      payment_route {
        name
        payment_route_id
      }
      account_transactions {
        currency_id
        transaction_class
        post_balance
        amount
      }
      properties {
        name
        value
      }
    }
    account {
      account_id
      balance
    }
    notification {
      title
      body
      class
      code
      vars
    }
    healthcheck {
      maintenance_message
      maintenance_mode
    }
    conversion {
      conversion_id
      conversion_quote_id
      reference
      source_currency_id
      source_currency_amount
      target_currency_id
      target_currency_amount
      instrument_id
      fee_currency_id
      fee_currency_amount
      price
      status
      message
      error_message
      created_at_iso
      updated_at_iso
      wallet_id
      instrument {
        name
        base_currency_id
        quantity_decimals
        quote_quantity_decimals
      }
    }
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"subscription user_update { user_update { order { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } } account_transaction { currency_id type amount post_balance order_id } payment { payment_id currency_id amount type crypto_transaction_id crypto_address crypto_address_tag_type crypto_address_tag_value crypto_network approval_status psp_service_id reference fee_amount status message error_message comment created_at updated_at manual_transaction_date_iso fees_included wallet_id payment_route { name payment_route_id } account_transactions { currency_id transaction_class post_balance amount } properties { name value } } account { account_id balance } notification { title body class code vars } healthcheck { maintenance_message maintenance_mode } conversion { conversion_id conversion_quote_id reference source_currency_id source_currency_amount target_currency_id target_currency_amount instrument_id fee_currency_id fee_currency_amount price status message error_message created_at_iso updated_at_iso wallet_id instrument { name base_currency_id quantity_decimals quote_quantity_decimals } } } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """subscription user_update { user_update { order { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } } account_transaction { currency_id type amount post_balance order_id } payment { payment_id currency_id amount type crypto_transaction_id crypto_address crypto_address_tag_type crypto_address_tag_value crypto_network approval_status psp_service_id reference fee_amount status message error_message comment created_at updated_at manual_transaction_date_iso fees_included wallet_id payment_route { name payment_route_id } account_transactions { currency_id transaction_class post_balance amount } properties { name value } } account { account_id balance } notification { title body class code vars } healthcheck { maintenance_message maintenance_mode } conversion { conversion_id conversion_quote_id reference source_currency_id source_currency_amount target_currency_id target_currency_amount instrument_id fee_currency_id fee_currency_amount price status message error_message created_at_iso updated_at_iso wallet_id instrument { name base_currency_id quantity_decimals quote_quantity_decimals } } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `subscription user_update { user_update { order { order_id type side status price stop_price quantity executed_quantity remaining_quantity quantity_mode instrument_id message updated_at created_at expires_at expires_at_iso time_in_force vwap wallet_id instrument { quote_currency_id name base_currency_id quantity_decimals quote_quantity_decimals price_decimals } fees { currency_id amount type } } account_transaction { currency_id type amount post_balance order_id } payment { payment_id currency_id amount type crypto_transaction_id crypto_address crypto_address_tag_type crypto_address_tag_value crypto_network approval_status psp_service_id reference fee_amount status message error_message comment created_at updated_at manual_transaction_date_iso fees_included wallet_id payment_route { name payment_route_id } account_transactions { currency_id transaction_class post_balance amount } properties { name value } } account { account_id balance } notification { title body class code vars } healthcheck { maintenance_message maintenance_mode } conversion { conversion_id conversion_quote_id reference source_currency_id source_currency_amount target_currency_id target_currency_amount instrument_id fee_currency_id fee_currency_amount price status message error_message created_at_iso updated_at_iso wallet_id instrument { name base_currency_id quantity_decimals quote_quantity_decimals } } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Subscriptions are delivered over WebSocket (wss://). Use a GraphQL-WS client rather than this HTTP runner.

Authenticate at the top of the page to try this

Trading Fees

1 op
query trading_fees Trading Fees
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
instrument_id String optional
fee_group_id String optional
pager PagerInput optional

Response

FieldSub-fields
instrument_id scalar
maker_flat scalar
maker_progressive scalar
taker_flat scalar
taker_progressive scalar

GraphQL Operation

query trading_fees($instrument_id: String, $fee_group_id: String, $pager: PagerInput) {
  trading_fees(instrument_id: $instrument_id, fee_group_id: $fee_group_id, pager: $pager) {
    instrument_id
    maker_flat
    maker_progressive
    taker_flat
    taker_progressive
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query trading_fees($instrument_id: String, $fee_group_id: String, $pager: PagerInput) { trading_fees(instrument_id: $instrument_id, fee_group_id: $fee_group_id, pager: $pager) { instrument_id maker_flat maker_progressive taker_flat taker_progressive } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query trading_fees($instrument_id: String, $fee_group_id: String, $pager: PagerInput) { trading_fees(instrument_id: $instrument_id, fee_group_id: $fee_group_id, pager: $pager) { instrument_id maker_flat maker_progressive taker_flat taker_progressive } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query trading_fees($instrument_id: String, $fee_group_id: String, $pager: PagerInput) { trading_fees(instrument_id: $instrument_id, fee_group_id: $fee_group_id, pager: $pager) { instrument_id maker_flat maker_progressive taker_flat taker_progressive } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this

Payments

6 operations · service: https://vakotrade-andx.cryptosrvc.com/graphql

mutation create_withdrawal_crypto Create Withdrawal Crypto
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
crypto_address String required
amount Float required
crypto_address_tag_type CryptoAddressTagType optional
crypto_network_fee_preference CryptoNetworkFeePreference optional
crypto_address_tag_value String optional
mfa_token String optional
payment_route_id String required
fees_included ToggleSwitch optional
comment String optional
travel_rule_properties TravelRulePropertiesArgs optional
vasp_id String optional
wallet_id String optional

Response

FieldSub-fields
payment_id scalar
currency_id scalar
amount scalar
type scalar
crypto_transaction_id scalar
crypto_address scalar
crypto_address_tag_type scalar
crypto_address_tag_value scalar
crypto_network scalar
approval_status scalar
psp_service_id scalar
reference scalar
fee_amount scalar
status scalar
message scalar
error_message scalar
comment scalar
created_at scalar
updated_at scalar
manual_transaction_date_iso scalar
fees_included scalar
wallet_id scalar
payment_route name, payment_route_id
account_transactions currency_id, transaction_class, post_balance, amount
properties name, value

GraphQL Operation

mutation create_withdrawal_crypto($crypto_address: String!, $amount: Float!, $crypto_address_tag_type: CryptoAddressTagType, $crypto_network_fee_preference: CryptoNetworkFeePreference, $crypto_address_tag_value: String, $mfa_token: String, $payment_route_id: String!, $fees_included: ToggleSwitch, $comment: String, $travel_rule_properties: TravelRulePropertiesArgs, $vasp_id: String, $wallet_id: String) {
  create_withdrawal_crypto(crypto_address: $crypto_address, amount: $amount, crypto_address_tag_type: $crypto_address_tag_type, crypto_network_fee_preference: $crypto_network_fee_preference, crypto_address_tag_value: $crypto_address_tag_value, mfa_token: $mfa_token, payment_route_id: $payment_route_id, fees_included: $fees_included, comment: $comment, travel_rule_properties: $travel_rule_properties, vasp_id: $vasp_id, wallet_id: $wallet_id) {
    payment_id
    currency_id
    amount
    type
    crypto_transaction_id
    crypto_address
    crypto_address_tag_type
    crypto_address_tag_value
    crypto_network
    approval_status
    psp_service_id
    reference
    fee_amount
    status
    message
    error_message
    comment
    created_at
    updated_at
    manual_transaction_date_iso
    fees_included
    wallet_id
    payment_route {
      name
      payment_route_id
    }
    account_transactions {
      currency_id
      transaction_class
      post_balance
      amount
    }
    properties {
      name
      value
    }
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation create_withdrawal_crypto($crypto_address: String!, $amount: Float!, $crypto_address_tag_type: CryptoAddressTagType, $crypto_network_fee_preference: CryptoNetworkFeePreference, $crypto_address_tag_value: String, $mfa_token: String, $payment_route_id: String!, $fees_included: ToggleSwitch, $comment: String, $travel_rule_properties: TravelRulePropertiesArgs, $vasp_id: String, $wallet_id: String) { create_withdrawal_crypto(crypto_address: $crypto_address, amount: $amount, crypto_address_tag_type: $crypto_address_tag_type, crypto_network_fee_preference: $crypto_network_fee_preference, crypto_address_tag_value: $crypto_address_tag_value, mfa_token: $mfa_token, payment_route_id: $payment_route_id, fees_included: $fees_included, comment: $comment, travel_rule_properties: $travel_rule_properties, vasp_id: $vasp_id, wallet_id: $wallet_id) { payment_id currency_id amount type crypto_transaction_id crypto_address crypto_address_tag_type crypto_address_tag_value crypto_network approval_status psp_service_id reference fee_amount status message error_message comment created_at updated_at manual_transaction_date_iso fees_included wallet_id payment_route { name payment_route_id } account_transactions { currency_id transaction_class post_balance amount } properties { name value } } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation create_withdrawal_crypto($crypto_address: String!, $amount: Float!, $crypto_address_tag_type: CryptoAddressTagType, $crypto_network_fee_preference: CryptoNetworkFeePreference, $crypto_address_tag_value: String, $mfa_token: String, $payment_route_id: String!, $fees_included: ToggleSwitch, $comment: String, $travel_rule_properties: TravelRulePropertiesArgs, $vasp_id: String, $wallet_id: String) { create_withdrawal_crypto(crypto_address: $crypto_address, amount: $amount, crypto_address_tag_type: $crypto_address_tag_type, crypto_network_fee_preference: $crypto_network_fee_preference, crypto_address_tag_value: $crypto_address_tag_value, mfa_token: $mfa_token, payment_route_id: $payment_route_id, fees_included: $fees_included, comment: $comment, travel_rule_properties: $travel_rule_properties, vasp_id: $vasp_id, wallet_id: $wallet_id) { payment_id currency_id amount type crypto_transaction_id crypto_address crypto_address_tag_type crypto_address_tag_value crypto_network approval_status psp_service_id reference fee_amount status message error_message comment created_at updated_at manual_transaction_date_iso fees_included wallet_id payment_route { name payment_route_id } account_transactions { currency_id transaction_class post_balance amount } properties { name value } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation create_withdrawal_crypto($crypto_address: String!, $amount: Float!, $crypto_address_tag_type: CryptoAddressTagType, $crypto_network_fee_preference: CryptoNetworkFeePreference, $crypto_address_tag_value: String, $mfa_token: String, $payment_route_id: String!, $fees_included: ToggleSwitch, $comment: String, $travel_rule_properties: TravelRulePropertiesArgs, $vasp_id: String, $wallet_id: String) { create_withdrawal_crypto(crypto_address: $crypto_address, amount: $amount, crypto_address_tag_type: $crypto_address_tag_type, crypto_network_fee_preference: $crypto_network_fee_preference, crypto_address_tag_value: $crypto_address_tag_value, mfa_token: $mfa_token, payment_route_id: $payment_route_id, fees_included: $fees_included, comment: $comment, travel_rule_properties: $travel_rule_properties, vasp_id: $vasp_id, wallet_id: $wallet_id) { payment_id currency_id amount type crypto_transaction_id crypto_address crypto_address_tag_type crypto_address_tag_value crypto_network approval_status psp_service_id reference fee_amount status message error_message comment created_at updated_at manual_transaction_date_iso fees_included wallet_id payment_route { name payment_route_id } account_transactions { currency_id transaction_class post_balance amount } properties { name value } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
mutation create_withdrawal_fiat Create Withdrawal Fiat
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
amount Float required
mfa_token String optional
properties [FiatDepositPropertyInput!] required
payment_route_id String required
wallet_id String optional

Response

FieldSub-fields
payment_id scalar
currency_id scalar
amount scalar
type scalar
crypto_transaction_id scalar
crypto_address scalar
crypto_address_tag_type scalar
crypto_address_tag_value scalar
crypto_network scalar
approval_status scalar
psp_service_id scalar
reference scalar
fee_amount scalar
status scalar
message scalar
error_message scalar
comment scalar
created_at scalar
updated_at scalar
manual_transaction_date_iso scalar
fees_included scalar
wallet_id scalar
payment_route name, payment_route_id
account_transactions currency_id, transaction_class, post_balance, amount
properties name, value

GraphQL Operation

mutation create_withdrawal_fiat($amount: Float!, $mfa_token: String, $properties: [FiatDepositPropertyInput!]!, $payment_route_id: String!, $wallet_id: String) {
  create_withdrawal_fiat(amount: $amount, mfa_token: $mfa_token, properties: $properties, payment_route_id: $payment_route_id, wallet_id: $wallet_id) {
    payment_id
    currency_id
    amount
    type
    crypto_transaction_id
    crypto_address
    crypto_address_tag_type
    crypto_address_tag_value
    crypto_network
    approval_status
    psp_service_id
    reference
    fee_amount
    status
    message
    error_message
    comment
    created_at
    updated_at
    manual_transaction_date_iso
    fees_included
    wallet_id
    payment_route {
      name
      payment_route_id
    }
    account_transactions {
      currency_id
      transaction_class
      post_balance
      amount
    }
    properties {
      name
      value
    }
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation create_withdrawal_fiat($amount: Float!, $mfa_token: String, $properties: [FiatDepositPropertyInput!]!, $payment_route_id: String!, $wallet_id: String) { create_withdrawal_fiat(amount: $amount, mfa_token: $mfa_token, properties: $properties, payment_route_id: $payment_route_id, wallet_id: $wallet_id) { payment_id currency_id amount type crypto_transaction_id crypto_address crypto_address_tag_type crypto_address_tag_value crypto_network approval_status psp_service_id reference fee_amount status message error_message comment created_at updated_at manual_transaction_date_iso fees_included wallet_id payment_route { name payment_route_id } account_transactions { currency_id transaction_class post_balance amount } properties { name value } } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation create_withdrawal_fiat($amount: Float!, $mfa_token: String, $properties: [FiatDepositPropertyInput!]!, $payment_route_id: String!, $wallet_id: String) { create_withdrawal_fiat(amount: $amount, mfa_token: $mfa_token, properties: $properties, payment_route_id: $payment_route_id, wallet_id: $wallet_id) { payment_id currency_id amount type crypto_transaction_id crypto_address crypto_address_tag_type crypto_address_tag_value crypto_network approval_status psp_service_id reference fee_amount status message error_message comment created_at updated_at manual_transaction_date_iso fees_included wallet_id payment_route { name payment_route_id } account_transactions { currency_id transaction_class post_balance amount } properties { name value } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation create_withdrawal_fiat($amount: Float!, $mfa_token: String, $properties: [FiatDepositPropertyInput!]!, $payment_route_id: String!, $wallet_id: String) { create_withdrawal_fiat(amount: $amount, mfa_token: $mfa_token, properties: $properties, payment_route_id: $payment_route_id, wallet_id: $wallet_id) { payment_id currency_id amount type crypto_transaction_id crypto_address crypto_address_tag_type crypto_address_tag_value crypto_network approval_status psp_service_id reference fee_amount status message error_message comment created_at updated_at manual_transaction_date_iso fees_included wallet_id payment_route { name payment_route_id } account_transactions { currency_id transaction_class post_balance amount } properties { name value } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query deposit_address_crypto Deposit Address Crypto
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
currency_id String required
reference String optional
payment_route_id String required

Response

FieldSub-fields
deposit_address_crypto_id scalar
currency_id scalar
address scalar
address_tag_type scalar
address_tag_value scalar
network scalar
created_at scalar
updated_at scalar

GraphQL Operation

query deposit_address_crypto($currency_id: String!, $reference: String, $payment_route_id: String!) {
  deposit_address_crypto(currency_id: $currency_id, reference: $reference, payment_route_id: $payment_route_id) {
    deposit_address_crypto_id
    currency_id
    address
    address_tag_type
    address_tag_value
    network
    created_at
    updated_at
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query deposit_address_crypto($currency_id: String!, $reference: String, $payment_route_id: String!) { deposit_address_crypto(currency_id: $currency_id, reference: $reference, payment_route_id: $payment_route_id) { deposit_address_crypto_id currency_id address address_tag_type address_tag_value network created_at updated_at } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query deposit_address_crypto($currency_id: String!, $reference: String, $payment_route_id: String!) { deposit_address_crypto(currency_id: $currency_id, reference: $reference, payment_route_id: $payment_route_id) { deposit_address_crypto_id currency_id address address_tag_type address_tag_value network created_at updated_at } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query deposit_address_crypto($currency_id: String!, $reference: String, $payment_route_id: String!) { deposit_address_crypto(currency_id: $currency_id, reference: $reference, payment_route_id: $payment_route_id) { deposit_address_crypto_id currency_id address address_tag_type address_tag_value network created_at updated_at } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
mutation estimate_payment_fee Estimate Payment Fee
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
user_id String optional
payment_route_id String required
type PaymentType required
amount Float required
crypto_network_fee_preference CryptoNetworkFeePreference optional

Response

Returns a scalar value (e.g. a boolean flag or identifier).

GraphQL Operation

mutation estimate_payment_fee($user_id: String, $payment_route_id: String!, $type: PaymentType!, $amount: Float!, $crypto_network_fee_preference: CryptoNetworkFeePreference) {
  estimate_payment_fee(user_id: $user_id, payment_route_id: $payment_route_id, type: $type, amount: $amount, crypto_network_fee_preference: $crypto_network_fee_preference)
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation estimate_payment_fee($user_id: String, $payment_route_id: String!, $type: PaymentType!, $amount: Float!, $crypto_network_fee_preference: CryptoNetworkFeePreference) { estimate_payment_fee(user_id: $user_id, payment_route_id: $payment_route_id, type: $type, amount: $amount, crypto_network_fee_preference: $crypto_network_fee_preference) }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation estimate_payment_fee($user_id: String, $payment_route_id: String!, $type: PaymentType!, $amount: Float!, $crypto_network_fee_preference: CryptoNetworkFeePreference) { estimate_payment_fee(user_id: $user_id, payment_route_id: $payment_route_id, type: $type, amount: $amount, crypto_network_fee_preference: $crypto_network_fee_preference) }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation estimate_payment_fee($user_id: String, $payment_route_id: String!, $type: PaymentType!, $amount: Float!, $crypto_network_fee_preference: CryptoNetworkFeePreference) { estimate_payment_fee(user_id: $user_id, payment_route_id: $payment_route_id, type: $type, amount: $amount, crypto_network_fee_preference: $crypto_network_fee_preference) }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query payments Payments
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
type PaymentType optional
currency_id String optional
dateRange DateRangeInput optional
pager PagerInput optional
approval_status [PaymentApprovalStatus!] optional
status [PaymentStatus!] optional
wallet_id String optional

Response

FieldSub-fields
payment_id scalar
currency_id scalar
amount scalar
type scalar
crypto_transaction_id scalar
crypto_address scalar
crypto_address_tag_type scalar
crypto_address_tag_value scalar
crypto_network scalar
approval_status scalar
psp_service_id scalar
reference scalar
fee_amount scalar
status scalar
message scalar
error_message scalar
comment scalar
created_at scalar
updated_at scalar
manual_transaction_date_iso scalar
fees_included scalar
wallet_id scalar
payment_route name, payment_route_id
account_transactions currency_id, transaction_class, post_balance, amount
properties name, value
amount_quoted scalar
fee_quoted scalar

GraphQL Operation

query payments($type: PaymentType, $currency_id: String, $dateRange: DateRangeInput, $pager: PagerInput, $approval_status: [PaymentApprovalStatus!], $status: [PaymentStatus!], $wallet_id: String) {
  payments(type: $type, currency_id: $currency_id, dateRange: $dateRange, pager: $pager, approval_status: $approval_status, status: $status, wallet_id: $wallet_id) {
    payment_id
    currency_id
    amount
    type
    crypto_transaction_id
    crypto_address
    crypto_address_tag_type
    crypto_address_tag_value
    crypto_network
    approval_status
    psp_service_id
    reference
    fee_amount
    status
    message
    error_message
    comment
    created_at
    updated_at
    manual_transaction_date_iso
    fees_included
    wallet_id
    payment_route {
      name
      payment_route_id
    }
    account_transactions {
      currency_id
      transaction_class
      post_balance
      amount
    }
    properties {
      name
      value
    }
    amount_quoted
    fee_quoted
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query payments($type: PaymentType, $currency_id: String, $dateRange: DateRangeInput, $pager: PagerInput, $approval_status: [PaymentApprovalStatus!], $status: [PaymentStatus!], $wallet_id: String) { payments(type: $type, currency_id: $currency_id, dateRange: $dateRange, pager: $pager, approval_status: $approval_status, status: $status, wallet_id: $wallet_id) { payment_id currency_id amount type crypto_transaction_id crypto_address crypto_address_tag_type crypto_address_tag_value crypto_network approval_status psp_service_id reference fee_amount status message error_message comment created_at updated_at manual_transaction_date_iso fees_included wallet_id payment_route { name payment_route_id } account_transactions { currency_id transaction_class post_balance amount } properties { name value } amount_quoted fee_quoted } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query payments($type: PaymentType, $currency_id: String, $dateRange: DateRangeInput, $pager: PagerInput, $approval_status: [PaymentApprovalStatus!], $status: [PaymentStatus!], $wallet_id: String) { payments(type: $type, currency_id: $currency_id, dateRange: $dateRange, pager: $pager, approval_status: $approval_status, status: $status, wallet_id: $wallet_id) { payment_id currency_id amount type crypto_transaction_id crypto_address crypto_address_tag_type crypto_address_tag_value crypto_network approval_status psp_service_id reference fee_amount status message error_message comment created_at updated_at manual_transaction_date_iso fees_included wallet_id payment_route { name payment_route_id } account_transactions { currency_id transaction_class post_balance amount } properties { name value } amount_quoted fee_quoted } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query payments($type: PaymentType, $currency_id: String, $dateRange: DateRangeInput, $pager: PagerInput, $approval_status: [PaymentApprovalStatus!], $status: [PaymentStatus!], $wallet_id: String) { payments(type: $type, currency_id: $currency_id, dateRange: $dateRange, pager: $pager, approval_status: $approval_status, status: $status, wallet_id: $wallet_id) { payment_id currency_id amount type crypto_transaction_id crypto_address crypto_address_tag_type crypto_address_tag_value crypto_network approval_status psp_service_id reference fee_amount status message error_message comment created_at updated_at manual_transaction_date_iso fees_included wallet_id payment_route { name payment_route_id } account_transactions { currency_id transaction_class post_balance amount } properties { name value } amount_quoted fee_quoted } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query payments_routes Payments Routes
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
payment_route_id String required

Response

FieldSub-fields
fiat_deposit_properties name, value

GraphQL Operation

query payments_routes($payment_route_id: String!) {
  payments_routes(payment_route_id: $payment_route_id) {
    fiat_deposit_properties {
      name
      value
    }
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query payments_routes($payment_route_id: String!) { payments_routes(payment_route_id: $payment_route_id) { fiat_deposit_properties { name value } } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query payments_routes($payment_route_id: String!) { payments_routes(payment_route_id: $payment_route_id) { fiat_deposit_properties { name value } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query payments_routes($payment_route_id: String!) { payments_routes(payment_route_id: $payment_route_id) { fiat_deposit_properties { name value } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this

Referral

6 operations · service: https://vakotrade-andx.cryptosrvc.com/graphql

mutation claim_referral Claim Referral
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
referral_id String required
user_id String optional

Response

Returns a scalar value (e.g. a boolean flag or identifier).

GraphQL Operation

mutation claim_referral($referral_id: String!, $user_id: String) {
  claim_referral(referral_id: $referral_id, user_id: $user_id)
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation claim_referral($referral_id: String!, $user_id: String) { claim_referral(referral_id: $referral_id, user_id: $user_id) }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation claim_referral($referral_id: String!, $user_id: String) { claim_referral(referral_id: $referral_id, user_id: $user_id) }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation claim_referral($referral_id: String!, $user_id: String) { claim_referral(referral_id: $referral_id, user_id: $user_id) }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
mutation create_referral Create Referral
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
user_id String optional

Response

FieldSub-fields
referral_id scalar

GraphQL Operation

mutation create_referral($user_id: String) {
  create_referral(user_id: $user_id) {
    referral_id
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation create_referral($user_id: String) { create_referral(user_id: $user_id) { referral_id } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation create_referral($user_id: String) { create_referral(user_id: $user_id) { referral_id } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation create_referral($user_id: String) { create_referral(user_id: $user_id) { referral_id } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query referrals Referrals
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

No input arguments.

Response

FieldSub-fields
referral_id scalar

GraphQL Operation

query referrals {
  referrals {
    referral_id
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query referrals { referrals { referral_id } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query referrals { referrals { referral_id } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query referrals { referrals { referral_id } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query referrals_transactions_info Referrals Transactions Info
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
account_transaction_id String optional
pager PagerInput optional
date_range DateRangeInput optional
search String optional
referral_id String optional
reward_type ReferralRewardType optional
target_user_id String optional

Response

FieldSub-fields
target_user_id scalar
referral_id scalar
reward_type scalar
account_transaction_id scalar
delayed_until_iso scalar
created_at scalar
account_transaction currency_id, amount

GraphQL Operation

query referrals_transactions_info($account_transaction_id: String, $pager: PagerInput, $date_range: DateRangeInput, $search: String, $referral_id: String, $reward_type: ReferralRewardType, $target_user_id: String) {
  referrals_transactions_info(account_transaction_id: $account_transaction_id, pager: $pager, date_range: $date_range, search: $search, referral_id: $referral_id, reward_type: $reward_type, target_user_id: $target_user_id) {
    target_user_id
    referral_id
    reward_type
    account_transaction_id
    delayed_until_iso
    created_at
    account_transaction {
      currency_id
      amount
    }
  }
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query referrals_transactions_info($account_transaction_id: String, $pager: PagerInput, $date_range: DateRangeInput, $search: String, $referral_id: String, $reward_type: ReferralRewardType, $target_user_id: String) { referrals_transactions_info(account_transaction_id: $account_transaction_id, pager: $pager, date_range: $date_range, search: $search, referral_id: $referral_id, reward_type: $reward_type, target_user_id: $target_user_id) { target_user_id referral_id reward_type account_transaction_id delayed_until_iso created_at account_transaction { currency_id amount } } }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query referrals_transactions_info($account_transaction_id: String, $pager: PagerInput, $date_range: DateRangeInput, $search: String, $referral_id: String, $reward_type: ReferralRewardType, $target_user_id: String) { referrals_transactions_info(account_transaction_id: $account_transaction_id, pager: $pager, date_range: $date_range, search: $search, referral_id: $referral_id, reward_type: $reward_type, target_user_id: $target_user_id) { target_user_id referral_id reward_type account_transaction_id delayed_until_iso created_at account_transaction { currency_id amount } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query referrals_transactions_info($account_transaction_id: String, $pager: PagerInput, $date_range: DateRangeInput, $search: String, $referral_id: String, $reward_type: ReferralRewardType, $target_user_id: String) { referrals_transactions_info(account_transaction_id: $account_transaction_id, pager: $pager, date_range: $date_range, search: $search, referral_id: $referral_id, reward_type: $reward_type, target_user_id: $target_user_id) { target_user_id referral_id reward_type account_transaction_id delayed_until_iso created_at account_transaction { currency_id amount } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query referred_users_count Referred Users Count
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

No input arguments.

Response

Returns a scalar value (e.g. a boolean flag or identifier).

GraphQL Operation

query referred_users_count {
  referred_users_count
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query referred_users_count { referred_users_count }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query referred_users_count { referred_users_count }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query referred_users_count { referred_users_count }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query referrer_total_reward_quoted Referrer Total Reward Quoted
Endpoint: POST https://vakotrade-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
quote_currency_id String required

Response

Returns a scalar value (e.g. a boolean flag or identifier).

GraphQL Operation

query referrer_total_reward_quoted($quote_currency_id: String!) {
  referrer_total_reward_quoted(quote_currency_id: $quote_currency_id)
}

Code Examples

curl -X POST 'https://vakotrade-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query referrer_total_reward_quoted($quote_currency_id: String!) { referrer_total_reward_quoted(quote_currency_id: $quote_currency_id) }","variables":{}}'
import requests

url = "https://vakotrade-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query referrer_total_reward_quoted($quote_currency_id: String!) { referrer_total_reward_quoted(quote_currency_id: $quote_currency_id) }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query referrer_total_reward_quoted($quote_currency_id: String!) { referrer_total_reward_quoted(quote_currency_id: $quote_currency_id) }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this

Derivatives

29 operations across 6 areas · service: https://margin-trading-service-andx.cryptosrvc.com/graphql

History

2 ops
query margin_funding_fees Margin Funding Fees
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
sort SortInput optional
pager PagerInput optional
dateRange DateRangeInput optional
margin_position_id String optional
wallet_id String optional

Response

FieldSub-fields
amount scalar
updated_at_iso scalar
margin_position_id scalar
position_size scalar
rate scalar
currency_id scalar
rate_type scalar

GraphQL Operation

query margin_funding_fees($sort: SortInput, $pager: PagerInput, $dateRange: DateRangeInput, $margin_position_id: String, $wallet_id: String) {
  margin_funding_fees(sort: $sort, pager: $pager, dateRange: $dateRange, margin_position_id: $margin_position_id, wallet_id: $wallet_id) {
    amount
    updated_at_iso
    margin_position_id
    position_size
    rate
    currency_id
    rate_type
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query margin_funding_fees($sort: SortInput, $pager: PagerInput, $dateRange: DateRangeInput, $margin_position_id: String, $wallet_id: String) { margin_funding_fees(sort: $sort, pager: $pager, dateRange: $dateRange, margin_position_id: $margin_position_id, wallet_id: $wallet_id) { amount updated_at_iso margin_position_id position_size rate currency_id rate_type } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query margin_funding_fees($sort: SortInput, $pager: PagerInput, $dateRange: DateRangeInput, $margin_position_id: String, $wallet_id: String) { margin_funding_fees(sort: $sort, pager: $pager, dateRange: $dateRange, margin_position_id: $margin_position_id, wallet_id: $wallet_id) { amount updated_at_iso margin_position_id position_size rate currency_id rate_type } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query margin_funding_fees($sort: SortInput, $pager: PagerInput, $dateRange: DateRangeInput, $margin_position_id: String, $wallet_id: String) { margin_funding_fees(sort: $sort, pager: $pager, dateRange: $dateRange, margin_position_id: $margin_position_id, wallet_id: $wallet_id) { amount updated_at_iso margin_position_id position_size rate currency_id rate_type } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query margin_funding_rates_history Margin Funding Rates History
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
margin_instrument_strategy_id String optional
pager PagerInput optional
dateRange DateRangeInput optional

Response

FieldSub-fields
updated_at_iso scalar
short_funding_rate scalar
long_funding_rate scalar
margin_instrument_id scalar

GraphQL Operation

query margin_funding_rates_history($margin_instrument_strategy_id: String, $pager: PagerInput, $dateRange: DateRangeInput) {
  margin_funding_rates_history(margin_instrument_strategy_id: $margin_instrument_strategy_id, pager: $pager, dateRange: $dateRange) {
    updated_at_iso
    short_funding_rate
    long_funding_rate
    margin_instrument_id
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query margin_funding_rates_history($margin_instrument_strategy_id: String, $pager: PagerInput, $dateRange: DateRangeInput) { margin_funding_rates_history(margin_instrument_strategy_id: $margin_instrument_strategy_id, pager: $pager, dateRange: $dateRange) { updated_at_iso short_funding_rate long_funding_rate margin_instrument_id } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query margin_funding_rates_history($margin_instrument_strategy_id: String, $pager: PagerInput, $dateRange: DateRangeInput) { margin_funding_rates_history(margin_instrument_strategy_id: $margin_instrument_strategy_id, pager: $pager, dateRange: $dateRange) { updated_at_iso short_funding_rate long_funding_rate margin_instrument_id } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query margin_funding_rates_history($margin_instrument_strategy_id: String, $pager: PagerInput, $dateRange: DateRangeInput) { margin_funding_rates_history(margin_instrument_strategy_id: $margin_instrument_strategy_id, pager: $pager, dateRange: $dateRange) { updated_at_iso short_funding_rate long_funding_rate margin_instrument_id } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this

Instruments

6 ops
query derivatives_enabled Derivatives Enabled
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

No input arguments.

Response

Returns a scalar value (e.g. a boolean flag or identifier).

GraphQL Operation

query derivatives_enabled {
  derivatives_enabled
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query derivatives_enabled { derivatives_enabled }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query derivatives_enabled { derivatives_enabled }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query derivatives_enabled { derivatives_enabled }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query margin_currencies Margin Currencies
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
is_active ToggleSwitch required
pager PagerInput optional

Response

FieldSub-fields
currency_id scalar
precision scalar

GraphQL Operation

query margin_currencies($is_active: ToggleSwitch!, $pager: PagerInput) {
  margin_currencies(is_active: $is_active, pager: $pager) {
    currency_id
    precision
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query margin_currencies($is_active: ToggleSwitch!, $pager: PagerInput) { margin_currencies(is_active: $is_active, pager: $pager) { currency_id precision } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query margin_currencies($is_active: ToggleSwitch!, $pager: PagerInput) { margin_currencies(is_active: $is_active, pager: $pager) { currency_id precision } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query margin_currencies($is_active: ToggleSwitch!, $pager: PagerInput) { margin_currencies(is_active: $is_active, pager: $pager) { currency_id precision } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
subscription margin_instrument_price_bar Margin Instrument Price Bar
Endpoint: WS https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Subscription

Inputs

NameTypeRequired
instrument_id String required
periodicity MarginInstrumentHistoryPeriodicity required

Response

FieldSub-fields
margin_instrument_id scalar
high scalar
low scalar
updated_at scalar
updated_at_iso scalar
close scalar
open scalar

GraphQL Operation

subscription margin_instrument_price_bar($instrument_id: String!, $periodicity: MarginInstrumentHistoryPeriodicity!) {
  margin_instrument_price_bar(instrument_id: $instrument_id, periodicity: $periodicity) {
    margin_instrument_id
    high
    low
    updated_at
    updated_at_iso
    close
    open
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"subscription margin_instrument_price_bar($instrument_id: String!, $periodicity: MarginInstrumentHistoryPeriodicity!) { margin_instrument_price_bar(instrument_id: $instrument_id, periodicity: $periodicity) { margin_instrument_id high low updated_at updated_at_iso close open } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """subscription margin_instrument_price_bar($instrument_id: String!, $periodicity: MarginInstrumentHistoryPeriodicity!) { margin_instrument_price_bar(instrument_id: $instrument_id, periodicity: $periodicity) { margin_instrument_id high low updated_at updated_at_iso close open } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `subscription margin_instrument_price_bar($instrument_id: String!, $periodicity: MarginInstrumentHistoryPeriodicity!) { margin_instrument_price_bar(instrument_id: $instrument_id, periodicity: $periodicity) { margin_instrument_id high low updated_at updated_at_iso close open } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Subscriptions are delivered over WebSocket (wss://). Use a GraphQL-WS client rather than this HTTP runner.

Authenticate at the top of the page to try this
query margin_instrument_price_bars Margin Instrument Price Bars
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
instrument_id String required
limit String optional
date_range DateRangeInput optional
periodicity MarginInstrumentHistoryPeriodicity optional

Response

FieldSub-fields
margin_instrument_id scalar
high scalar
low scalar
updated_at scalar
updated_at_iso scalar
close scalar
open scalar

GraphQL Operation

query margin_instrument_price_bars($instrument_id: String!, $limit: String, $date_range: DateRangeInput, $periodicity: MarginInstrumentHistoryPeriodicity) {
  margin_instrument_price_bars(instrument_id: $instrument_id, limit: $limit, date_range: $date_range, periodicity: $periodicity) {
    margin_instrument_id
    high
    low
    updated_at
    updated_at_iso
    close
    open
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query margin_instrument_price_bars($instrument_id: String!, $limit: String, $date_range: DateRangeInput, $periodicity: MarginInstrumentHistoryPeriodicity) { margin_instrument_price_bars(instrument_id: $instrument_id, limit: $limit, date_range: $date_range, periodicity: $periodicity) { margin_instrument_id high low updated_at updated_at_iso close open } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query margin_instrument_price_bars($instrument_id: String!, $limit: String, $date_range: DateRangeInput, $periodicity: MarginInstrumentHistoryPeriodicity) { margin_instrument_price_bars(instrument_id: $instrument_id, limit: $limit, date_range: $date_range, periodicity: $periodicity) { margin_instrument_id high low updated_at updated_at_iso close open } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query margin_instrument_price_bars($instrument_id: String!, $limit: String, $date_range: DateRangeInput, $periodicity: MarginInstrumentHistoryPeriodicity) { margin_instrument_price_bars(instrument_id: $instrument_id, limit: $limit, date_range: $date_range, periodicity: $periodicity) { margin_instrument_id high low updated_at updated_at_iso close open } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query margin_instruments Margin Instruments
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
is_active ToggleSwitch required
pager PagerInput optional
search String optional

Response

FieldSub-fields
margin_instrument_id scalar
name scalar
base_currency_id scalar
quote_currency_id scalar
min_leverage scalar
max_leverage scalar
min_quantity scalar
max_quantity scalar
long_funding_rate scalar
short_funding_rate scalar
price_24h_change scalar
price_decimals scalar
quantity_decimals scalar
price_24h_low scalar
price_24h_high scalar
is_trading_on scalar
market_status scalar
margin_instrument_strategy_is_active scalar
margin_instrument_strategy_id scalar
class scalar
lot_size scalar
step_size scalar
cross_quote_price scalar
close_only scalar
base_currency currency_id, precision, is_active
quote_currency currency_id, precision, is_active
price margin_instrument_id, ask, bid, updated_at
funding_data rate_type, next_funding_date, long_funding_rate, short_funding_rate, multiplier, period
meta scalar
market_hours custom_periods, general_rules, holidays
funding_rates_history long_funding_rate, short_funding_rate, updated_at

GraphQL Operation

query margin_instruments($is_active: ToggleSwitch!, $pager: PagerInput, $search: String) {
  margin_instruments(is_active: $is_active, pager: $pager, search: $search) {
    margin_instrument_id
    name
    base_currency_id
    quote_currency_id
    min_leverage
    max_leverage
    min_quantity
    max_quantity
    long_funding_rate
    short_funding_rate
    price_24h_change
    price_decimals
    quantity_decimals
    price_24h_low
    price_24h_high
    is_trading_on
    market_status
    margin_instrument_strategy_is_active
    margin_instrument_strategy_id
    class
    lot_size
    step_size
    cross_quote_price
    close_only
    base_currency {
      currency_id
      precision
      is_active
    }
    quote_currency {
      currency_id
      precision
      is_active
    }
    price {
      margin_instrument_id
      ask
      bid
      updated_at
    }
    funding_data {
      rate_type
      next_funding_date
      long_funding_rate
      short_funding_rate
      multiplier
      period
    }
    meta
    market_hours {
      custom_periods {
        end_time
        name
        start_time
      }
      general_rules {
        days
        end_time
        is_active
        start_time
      }
      holidays {
        end_time
        name
        start_time
      }
    }
    funding_rates_history {
      long_funding_rate
      short_funding_rate
      updated_at
    }
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query margin_instruments($is_active: ToggleSwitch!, $pager: PagerInput, $search: String) { margin_instruments(is_active: $is_active, pager: $pager, search: $search) { margin_instrument_id name base_currency_id quote_currency_id min_leverage max_leverage min_quantity max_quantity long_funding_rate short_funding_rate price_24h_change price_decimals quantity_decimals price_24h_low price_24h_high is_trading_on market_status margin_instrument_strategy_is_active margin_instrument_strategy_id class lot_size step_size cross_quote_price close_only base_currency { currency_id precision is_active } quote_currency { currency_id precision is_active } price { margin_instrument_id ask bid updated_at } funding_data { rate_type next_funding_date long_funding_rate short_funding_rate multiplier period } meta market_hours { custom_periods { end_time name start_time } general_rules { days end_time is_active start_time } holidays { end_time name start_time } } funding_rates_history { long_funding_rate short_funding_rate updated_at } } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query margin_instruments($is_active: ToggleSwitch!, $pager: PagerInput, $search: String) { margin_instruments(is_active: $is_active, pager: $pager, search: $search) { margin_instrument_id name base_currency_id quote_currency_id min_leverage max_leverage min_quantity max_quantity long_funding_rate short_funding_rate price_24h_change price_decimals quantity_decimals price_24h_low price_24h_high is_trading_on market_status margin_instrument_strategy_is_active margin_instrument_strategy_id class lot_size step_size cross_quote_price close_only base_currency { currency_id precision is_active } quote_currency { currency_id precision is_active } price { margin_instrument_id ask bid updated_at } funding_data { rate_type next_funding_date long_funding_rate short_funding_rate multiplier period } meta market_hours { custom_periods { end_time name start_time } general_rules { days end_time is_active start_time } holidays { end_time name start_time } } funding_rates_history { long_funding_rate short_funding_rate updated_at } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query margin_instruments($is_active: ToggleSwitch!, $pager: PagerInput, $search: String) { margin_instruments(is_active: $is_active, pager: $pager, search: $search) { margin_instrument_id name base_currency_id quote_currency_id min_leverage max_leverage min_quantity max_quantity long_funding_rate short_funding_rate price_24h_change price_decimals quantity_decimals price_24h_low price_24h_high is_trading_on market_status margin_instrument_strategy_is_active margin_instrument_strategy_id class lot_size step_size cross_quote_price close_only base_currency { currency_id precision is_active } quote_currency { currency_id precision is_active } price { margin_instrument_id ask bid updated_at } funding_data { rate_type next_funding_date long_funding_rate short_funding_rate multiplier period } meta market_hours { custom_periods { end_time name start_time } general_rules { days end_time is_active start_time } holidays { end_time name start_time } } funding_rates_history { long_funding_rate short_funding_rate updated_at } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query margin_trading_config Margin Trading Config
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

No input arguments.

Response

FieldSub-fields
margin_currency scalar
margin_call_level scalar
liquidation_level scalar
add_limit_orders_when_market_closed scalar

GraphQL Operation

query margin_trading_config {
  margin_trading_config {
    margin_currency
    margin_call_level
    liquidation_level
    add_limit_orders_when_market_closed
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query margin_trading_config { margin_trading_config { margin_currency margin_call_level liquidation_level add_limit_orders_when_market_closed } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query margin_trading_config { margin_trading_config { margin_currency margin_call_level liquidation_level add_limit_orders_when_market_closed } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query margin_trading_config { margin_trading_config { margin_currency margin_call_level liquidation_level add_limit_orders_when_market_closed } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this

Orders

3 ops
query closed_margin_orders Closed Margin Orders
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
search String optional
pager PagerInput optional
sort SortInput optional
user_id String optional
dateRange DateRangeInput optional
side MarginPositionSide optional
status MarginOrderStatus optional
time_in_force MarginOrderTimeInForce optional
type MarginOrderType optional
instrument_id String optional
instruments_ids [String!] optional
wallet_id String optional

Response

FieldSub-fields
value scalar
margin_order_id scalar
margin_position_id scalar
user_id scalar
instrument_id scalar
side scalar
type scalar
status scalar
leverage scalar
quantity scalar
price scalar
limit_price scalar
message scalar
created_at_timestamp scalar
stop_loss scalar
take_profit scalar
ask scalar
bid scalar
executed_quantity scalar
fee_amount scalar
time_in_force scalar
expires_at_iso scalar
updated_at_iso scalar
cross_quote_price scalar
wallet_id scalar
margin_instrument base_currency_id, quote_currency_id, name, price_decimals, quantity_decimals, min_leverage, max_leverage, min_quantity, max_quantity, cross_quote_price, close_only, quote_currency, base_currency, price, margin_instrument_strategy_is_active, lot_size, step_size, class, margin_instrument_id, is_trading_on, market_status

GraphQL Operation

query closed_margin_orders($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $status: MarginOrderStatus, $time_in_force: MarginOrderTimeInForce, $type: MarginOrderType, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) {
  closed_margin_orders(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, status: $status, time_in_force: $time_in_force, type: $type, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) {
    value
    margin_order_id
    margin_position_id
    user_id
    instrument_id
    side
    type
    status
    leverage
    quantity
    price
    limit_price
    message
    created_at_timestamp
    stop_loss
    take_profit
    ask
    bid
    executed_quantity
    fee_amount
    time_in_force
    expires_at_iso
    updated_at_iso
    cross_quote_price
    wallet_id
    margin_instrument {
      base_currency_id
      quote_currency_id
      name
      price_decimals
      quantity_decimals
      min_leverage
      max_leverage
      min_quantity
      max_quantity
      cross_quote_price
      close_only
      quote_currency {
        precision
      }
      base_currency {
        precision
      }
      price {
        ask
        bid
      }
      margin_instrument_strategy_is_active
      lot_size
      step_size
      class
      margin_instrument_id
      is_trading_on
      market_status
    }
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query closed_margin_orders($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $status: MarginOrderStatus, $time_in_force: MarginOrderTimeInForce, $type: MarginOrderType, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) { closed_margin_orders(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, status: $status, time_in_force: $time_in_force, type: $type, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) { value margin_order_id margin_position_id user_id instrument_id side type status leverage quantity price limit_price message created_at_timestamp stop_loss take_profit ask bid executed_quantity fee_amount time_in_force expires_at_iso updated_at_iso cross_quote_price wallet_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_leverage max_leverage min_quantity max_quantity cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size class margin_instrument_id is_trading_on market_status } } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query closed_margin_orders($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $status: MarginOrderStatus, $time_in_force: MarginOrderTimeInForce, $type: MarginOrderType, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) { closed_margin_orders(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, status: $status, time_in_force: $time_in_force, type: $type, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) { value margin_order_id margin_position_id user_id instrument_id side type status leverage quantity price limit_price message created_at_timestamp stop_loss take_profit ask bid executed_quantity fee_amount time_in_force expires_at_iso updated_at_iso cross_quote_price wallet_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_leverage max_leverage min_quantity max_quantity cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size class margin_instrument_id is_trading_on market_status } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query closed_margin_orders($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $status: MarginOrderStatus, $time_in_force: MarginOrderTimeInForce, $type: MarginOrderType, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) { closed_margin_orders(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, status: $status, time_in_force: $time_in_force, type: $type, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) { value margin_order_id margin_position_id user_id instrument_id side type status leverage quantity price limit_price message created_at_timestamp stop_loss take_profit ask bid executed_quantity fee_amount time_in_force expires_at_iso updated_at_iso cross_quote_price wallet_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_leverage max_leverage min_quantity max_quantity cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size class margin_instrument_id is_trading_on market_status } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
subscription margin_order_update Margin Order Update
Endpoint: WS https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Subscription

Inputs

NameTypeRequired
wallet_id String optional

Response

FieldSub-fields
margin_order_id scalar
margin_position_id scalar
user_id scalar
instrument_id scalar
side scalar
type scalar
status scalar
leverage scalar
quantity scalar
price scalar
limit_price scalar
message scalar
created_at_timestamp scalar
stop_loss scalar
take_profit scalar
ask scalar
bid scalar
executed_quantity scalar
fee_amount scalar
time_in_force scalar
expires_at_iso scalar
updated_at_iso scalar
cross_quote_price scalar
wallet_id scalar
margin_instrument base_currency_id, quote_currency_id, name, price_decimals, quantity_decimals, min_leverage, max_leverage, min_quantity, max_quantity, cross_quote_price, close_only, quote_currency, base_currency, price, margin_instrument_strategy_is_active, lot_size, step_size, class, margin_instrument_id, is_trading_on, market_status

GraphQL Operation

subscription margin_order_update($wallet_id: String) {
  margin_order_update(wallet_id: $wallet_id) {
    margin_order_id
    margin_position_id
    user_id
    instrument_id
    side
    type
    status
    leverage
    quantity
    price
    limit_price
    message
    created_at_timestamp
    stop_loss
    take_profit
    ask
    bid
    executed_quantity
    fee_amount
    time_in_force
    expires_at_iso
    updated_at_iso
    cross_quote_price
    wallet_id
    margin_instrument {
      base_currency_id
      quote_currency_id
      name
      price_decimals
      quantity_decimals
      min_leverage
      max_leverage
      min_quantity
      max_quantity
      cross_quote_price
      close_only
      quote_currency {
        precision
      }
      base_currency {
        precision
      }
      price {
        ask
        bid
      }
      margin_instrument_strategy_is_active
      lot_size
      step_size
      class
      margin_instrument_id
      is_trading_on
      market_status
    }
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"subscription margin_order_update($wallet_id: String) { margin_order_update(wallet_id: $wallet_id) { margin_order_id margin_position_id user_id instrument_id side type status leverage quantity price limit_price message created_at_timestamp stop_loss take_profit ask bid executed_quantity fee_amount time_in_force expires_at_iso updated_at_iso cross_quote_price wallet_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_leverage max_leverage min_quantity max_quantity cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size class margin_instrument_id is_trading_on market_status } } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """subscription margin_order_update($wallet_id: String) { margin_order_update(wallet_id: $wallet_id) { margin_order_id margin_position_id user_id instrument_id side type status leverage quantity price limit_price message created_at_timestamp stop_loss take_profit ask bid executed_quantity fee_amount time_in_force expires_at_iso updated_at_iso cross_quote_price wallet_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_leverage max_leverage min_quantity max_quantity cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size class margin_instrument_id is_trading_on market_status } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `subscription margin_order_update($wallet_id: String) { margin_order_update(wallet_id: $wallet_id) { margin_order_id margin_position_id user_id instrument_id side type status leverage quantity price limit_price message created_at_timestamp stop_loss take_profit ask bid executed_quantity fee_amount time_in_force expires_at_iso updated_at_iso cross_quote_price wallet_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_leverage max_leverage min_quantity max_quantity cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size class margin_instrument_id is_trading_on market_status } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Subscriptions are delivered over WebSocket (wss://). Use a GraphQL-WS client rather than this HTTP runner.

Authenticate at the top of the page to try this
query open_margin_orders Open Margin Orders
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
search String optional
pager PagerInput optional
sort SortInput optional
user_id String optional
dateRange DateRangeInput optional
side MarginPositionSide optional
status MarginOrderStatus optional
time_in_force MarginOrderTimeInForce optional
type MarginOrderType optional
instrument_id String optional
instruments_ids [String!] optional
wallet_id String optional

Response

FieldSub-fields
margin_order_id scalar
margin_position_id scalar
user_id scalar
instrument_id scalar
side scalar
type scalar
status scalar
leverage scalar
quantity scalar
price scalar
limit_price scalar
message scalar
created_at_timestamp scalar
stop_loss scalar
take_profit scalar
ask scalar
bid scalar
executed_quantity scalar
fee_amount scalar
time_in_force scalar
expires_at_iso scalar
updated_at_iso scalar
cross_quote_price scalar
wallet_id scalar
margin_instrument base_currency_id, quote_currency_id, name, price_decimals, quantity_decimals, min_leverage, max_leverage, min_quantity, max_quantity, cross_quote_price, close_only, quote_currency, base_currency, price, margin_instrument_strategy_is_active, lot_size, step_size, class, margin_instrument_id, is_trading_on, market_status

GraphQL Operation

query open_margin_orders($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $status: MarginOrderStatus, $time_in_force: MarginOrderTimeInForce, $type: MarginOrderType, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) {
  open_margin_orders(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, status: $status, time_in_force: $time_in_force, type: $type, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) {
    margin_order_id
    margin_position_id
    user_id
    instrument_id
    side
    type
    status
    leverage
    quantity
    price
    limit_price
    message
    created_at_timestamp
    stop_loss
    take_profit
    ask
    bid
    executed_quantity
    fee_amount
    time_in_force
    expires_at_iso
    updated_at_iso
    cross_quote_price
    wallet_id
    margin_instrument {
      base_currency_id
      quote_currency_id
      name
      price_decimals
      quantity_decimals
      min_leverage
      max_leverage
      min_quantity
      max_quantity
      cross_quote_price
      close_only
      quote_currency {
        precision
      }
      base_currency {
        precision
      }
      price {
        ask
        bid
      }
      margin_instrument_strategy_is_active
      lot_size
      step_size
      class
      margin_instrument_id
      is_trading_on
      market_status
    }
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query open_margin_orders($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $status: MarginOrderStatus, $time_in_force: MarginOrderTimeInForce, $type: MarginOrderType, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) { open_margin_orders(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, status: $status, time_in_force: $time_in_force, type: $type, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) { margin_order_id margin_position_id user_id instrument_id side type status leverage quantity price limit_price message created_at_timestamp stop_loss take_profit ask bid executed_quantity fee_amount time_in_force expires_at_iso updated_at_iso cross_quote_price wallet_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_leverage max_leverage min_quantity max_quantity cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size class margin_instrument_id is_trading_on market_status } } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query open_margin_orders($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $status: MarginOrderStatus, $time_in_force: MarginOrderTimeInForce, $type: MarginOrderType, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) { open_margin_orders(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, status: $status, time_in_force: $time_in_force, type: $type, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) { margin_order_id margin_position_id user_id instrument_id side type status leverage quantity price limit_price message created_at_timestamp stop_loss take_profit ask bid executed_quantity fee_amount time_in_force expires_at_iso updated_at_iso cross_quote_price wallet_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_leverage max_leverage min_quantity max_quantity cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size class margin_instrument_id is_trading_on market_status } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query open_margin_orders($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $status: MarginOrderStatus, $time_in_force: MarginOrderTimeInForce, $type: MarginOrderType, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) { open_margin_orders(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, status: $status, time_in_force: $time_in_force, type: $type, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) { margin_order_id margin_position_id user_id instrument_id side type status leverage quantity price limit_price message created_at_timestamp stop_loss take_profit ask bid executed_quantity fee_amount time_in_force expires_at_iso updated_at_iso cross_quote_price wallet_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_leverage max_leverage min_quantity max_quantity cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size class margin_instrument_id is_trading_on market_status } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this

Performance

4 ops
query user_closed_orders_stats User Closed Orders Stats
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
user_id String optional
instrument_ids [String!] optional
date_range DateRangeInput optional
wallet_id String optional

Response

FieldSub-fields
long_count scalar
short_count scalar
avg_long_order_size scalar
avg_short_order_size scalar
short_volume scalar
long_volume scalar
avg_order_size scalar
trading_fees scalar

GraphQL Operation

query user_closed_orders_stats($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $wallet_id: String) {
  user_closed_orders_stats(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, wallet_id: $wallet_id) {
    long_count
    short_count
    avg_long_order_size
    avg_short_order_size
    short_volume
    long_volume
    avg_order_size
    trading_fees
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query user_closed_orders_stats($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $wallet_id: String) { user_closed_orders_stats(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, wallet_id: $wallet_id) { long_count short_count avg_long_order_size avg_short_order_size short_volume long_volume avg_order_size trading_fees } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query user_closed_orders_stats($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $wallet_id: String) { user_closed_orders_stats(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, wallet_id: $wallet_id) { long_count short_count avg_long_order_size avg_short_order_size short_volume long_volume avg_order_size trading_fees } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query user_closed_orders_stats($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $wallet_id: String) { user_closed_orders_stats(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, wallet_id: $wallet_id) { long_count short_count avg_long_order_size avg_short_order_size short_volume long_volume avg_order_size trading_fees } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query user_closed_positions_stats User Closed Positions Stats
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
user_id String optional
instrument_ids [String!] optional
date_range DateRangeInput optional
wallet_id String optional

Response

FieldSub-fields
long_positions wins_count, loss_count, win_rate, avg_position_duration, total_pnl, pnl_ranking, spread_pnl, funding_fees
short_positions wins_count, loss_count, win_rate, avg_position_duration, total_pnl, pnl_ranking, spread_pnl, funding_fees
all_positions wins_count, loss_count, win_rate, avg_position_duration, total_pnl, pnl_ranking, spread_pnl, funding_fees

GraphQL Operation

query user_closed_positions_stats($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $wallet_id: String) {
  user_closed_positions_stats(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, wallet_id: $wallet_id) {
    long_positions {
      wins_count
      loss_count
      win_rate
      avg_position_duration
      total_pnl
      pnl_ranking
      spread_pnl
      funding_fees
    }
    short_positions {
      wins_count
      loss_count
      win_rate
      avg_position_duration
      total_pnl
      pnl_ranking
      spread_pnl
      funding_fees
    }
    all_positions {
      wins_count
      loss_count
      win_rate
      avg_position_duration
      total_pnl
      pnl_ranking
      spread_pnl
      funding_fees
    }
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query user_closed_positions_stats($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $wallet_id: String) { user_closed_positions_stats(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, wallet_id: $wallet_id) { long_positions { wins_count loss_count win_rate avg_position_duration total_pnl pnl_ranking spread_pnl funding_fees } short_positions { wins_count loss_count win_rate avg_position_duration total_pnl pnl_ranking spread_pnl funding_fees } all_positions { wins_count loss_count win_rate avg_position_duration total_pnl pnl_ranking spread_pnl funding_fees } } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query user_closed_positions_stats($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $wallet_id: String) { user_closed_positions_stats(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, wallet_id: $wallet_id) { long_positions { wins_count loss_count win_rate avg_position_duration total_pnl pnl_ranking spread_pnl funding_fees } short_positions { wins_count loss_count win_rate avg_position_duration total_pnl pnl_ranking spread_pnl funding_fees } all_positions { wins_count loss_count win_rate avg_position_duration total_pnl pnl_ranking spread_pnl funding_fees } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query user_closed_positions_stats($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $wallet_id: String) { user_closed_positions_stats(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, wallet_id: $wallet_id) { long_positions { wins_count loss_count win_rate avg_position_duration total_pnl pnl_ranking spread_pnl funding_fees } short_positions { wins_count loss_count win_rate avg_position_duration total_pnl pnl_ranking spread_pnl funding_fees } all_positions { wins_count loss_count win_rate avg_position_duration total_pnl pnl_ranking spread_pnl funding_fees } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query user_pnl_ranking User Pnl Ranking
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
user_id String optional
instrument_ids [String!] optional
date_range DateRangeInput optional
sort SortDirection optional
wallet_id String optional

Response

FieldSub-fields
instrument_id scalar
pnl scalar

GraphQL Operation

query user_pnl_ranking($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $sort: SortDirection, $wallet_id: String) {
  user_pnl_ranking(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, sort: $sort, wallet_id: $wallet_id) {
    instrument_id
    pnl
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query user_pnl_ranking($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $sort: SortDirection, $wallet_id: String) { user_pnl_ranking(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, sort: $sort, wallet_id: $wallet_id) { instrument_id pnl } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query user_pnl_ranking($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $sort: SortDirection, $wallet_id: String) { user_pnl_ranking(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, sort: $sort, wallet_id: $wallet_id) { instrument_id pnl } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query user_pnl_ranking($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $sort: SortDirection, $wallet_id: String) { user_pnl_ranking(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, sort: $sort, wallet_id: $wallet_id) { instrument_id pnl } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query user_trading_performace User Trading Performace
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
user_id String optional
instrument_ids [String!] optional
date_range DateRangeInput optional
limit Int optional
periodicity UserTradingPerformancePeriodicity optional
wallet_id String optional

Response

FieldSub-fields
date scalar
pnl scalar

GraphQL Operation

query user_trading_performace($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $limit: Int, $periodicity: UserTradingPerformancePeriodicity, $wallet_id: String) {
  user_trading_performace(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, limit: $limit, periodicity: $periodicity, wallet_id: $wallet_id) {
    date
    pnl
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query user_trading_performace($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $limit: Int, $periodicity: UserTradingPerformancePeriodicity, $wallet_id: String) { user_trading_performace(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, limit: $limit, periodicity: $periodicity, wallet_id: $wallet_id) { date pnl } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query user_trading_performace($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $limit: Int, $periodicity: UserTradingPerformancePeriodicity, $wallet_id: String) { user_trading_performace(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, limit: $limit, periodicity: $periodicity, wallet_id: $wallet_id) { date pnl } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query user_trading_performace($user_id: String, $instrument_ids: [String!], $date_range: DateRangeInput, $limit: Int, $periodicity: UserTradingPerformancePeriodicity, $wallet_id: String) { user_trading_performace(user_id: $user_id, instrument_ids: $instrument_ids, date_range: $date_range, limit: $limit, periodicity: $periodicity, wallet_id: $wallet_id) { date pnl } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this

Positions

5 ops
query closed_margin_positions Closed Margin Positions
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
search String optional
pager PagerInput optional
sort SortInput optional
user_id String optional
dateRange DateRangeInput optional
side MarginPositionSide optional
instrument_id String optional
instruments_ids [String!] optional
wallet_id String optional

Response

FieldSub-fields
margin_position_id scalar
instrument_id scalar
user_id scalar
side scalar
leverage scalar
amount scalar
value scalar
funding_fee_amount scalar
entry_price scalar
start_price_ts scalar
end_price_ts scalar
start_ask_price scalar
duration scalar
end_ask_price scalar
pnl scalar
stop_loss scalar
take_profit scalar
start_ts_timestamp scalar
close_reason scalar
updated_at_iso scalar
start_bid_price scalar
end_bid_price scalar
close_reason_code scalar
margin scalar
total_pnl scalar
cross_quote_price scalar
exit_price scalar
wallet_id scalar
margin_currency_id scalar
end_ts_iso scalar
margin_instrument base_currency_id, quote_currency_id, name, price_decimals, quantity_decimals, min_quantity, min_leverage, max_leverage, is_trading_on, class, margin_instrument_id, market_status, cross_quote_price, close_only, quote_currency, base_currency, price, margin_instrument_strategy_is_active, lot_size, step_size

GraphQL Operation

query closed_margin_positions($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) {
  closed_margin_positions(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) {
    margin_position_id
    instrument_id
    user_id
    side
    leverage
    amount
    value
    funding_fee_amount
    entry_price
    start_price_ts
    end_price_ts
    start_ask_price
    duration
    end_ask_price
    pnl
    stop_loss
    take_profit
    start_ts_timestamp
    close_reason
    updated_at_iso
    start_bid_price
    end_bid_price
    close_reason_code
    margin
    total_pnl
    cross_quote_price
    exit_price
    wallet_id
    margin_currency_id
    end_ts_iso
    margin_instrument {
      base_currency_id
      quote_currency_id
      name
      price_decimals
      quantity_decimals
      min_quantity
      min_leverage
      max_leverage
      is_trading_on
      class
      margin_instrument_id
      market_status
      cross_quote_price
      close_only
      quote_currency {
        precision
      }
      base_currency {
        precision
      }
      price {
        ask
        bid
      }
      margin_instrument_strategy_is_active
      lot_size
      step_size
    }
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query closed_margin_positions($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) { closed_margin_positions(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) { margin_position_id instrument_id user_id side leverage amount value funding_fee_amount entry_price start_price_ts end_price_ts start_ask_price duration end_ask_price pnl stop_loss take_profit start_ts_timestamp close_reason updated_at_iso start_bid_price end_bid_price close_reason_code margin total_pnl cross_quote_price exit_price wallet_id margin_currency_id end_ts_iso margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_quantity min_leverage max_leverage is_trading_on class margin_instrument_id market_status cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size } } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query closed_margin_positions($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) { closed_margin_positions(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) { margin_position_id instrument_id user_id side leverage amount value funding_fee_amount entry_price start_price_ts end_price_ts start_ask_price duration end_ask_price pnl stop_loss take_profit start_ts_timestamp close_reason updated_at_iso start_bid_price end_bid_price close_reason_code margin total_pnl cross_quote_price exit_price wallet_id margin_currency_id end_ts_iso margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_quantity min_leverage max_leverage is_trading_on class margin_instrument_id market_status cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query closed_margin_positions($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) { closed_margin_positions(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) { margin_position_id instrument_id user_id side leverage amount value funding_fee_amount entry_price start_price_ts end_price_ts start_ask_price duration end_ask_price pnl stop_loss take_profit start_ts_timestamp close_reason updated_at_iso start_bid_price end_bid_price close_reason_code margin total_pnl cross_quote_price exit_price wallet_id margin_currency_id end_ts_iso margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_quantity min_leverage max_leverage is_trading_on class margin_instrument_id market_status cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
subscription margin_orderbook Margin Orderbook
Endpoint: WS https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Subscription

Inputs

NameTypeRequired
instrument_id String required

Response

FieldSub-fields
instrument_id scalar
buy quantity, price
sell quantity, price

GraphQL Operation

subscription margin_orderbook($instrument_id: String!) {
  margin_orderbook(instrument_id: $instrument_id) {
    instrument_id
    buy {
      quantity
      price
    }
    sell {
      quantity
      price
    }
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"subscription margin_orderbook($instrument_id: String!) { margin_orderbook(instrument_id: $instrument_id) { instrument_id buy { quantity price } sell { quantity price } } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """subscription margin_orderbook($instrument_id: String!) { margin_orderbook(instrument_id: $instrument_id) { instrument_id buy { quantity price } sell { quantity price } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `subscription margin_orderbook($instrument_id: String!) { margin_orderbook(instrument_id: $instrument_id) { instrument_id buy { quantity price } sell { quantity price } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Subscriptions are delivered over WebSocket (wss://). Use a GraphQL-WS client rather than this HTTP runner.

Authenticate at the top of the page to try this
subscription open_margin_position_update Open Margin Position Update
Endpoint: WS https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Subscription

Inputs

NameTypeRequired
wallet_id String optional

Response

FieldSub-fields
margin_position_id scalar
instrument_id scalar
user_id scalar
side scalar
leverage scalar
amount scalar
value scalar
funding_fee_amount scalar
entry_price scalar
start_price_ts scalar
end_price_ts scalar
start_ask_price scalar
duration scalar
end_ask_price scalar
pnl scalar
stop_loss scalar
take_profit scalar
start_ts_timestamp scalar
close_reason scalar
updated_at_iso scalar
start_bid_price scalar
end_bid_price scalar
close_reason_code scalar
margin scalar
total_pnl scalar
cross_quote_price scalar
exit_price scalar
wallet_id scalar
margin_currency_id scalar
end_ts_iso scalar
margin_instrument base_currency_id, quote_currency_id, name, price_decimals, quantity_decimals, min_quantity, min_leverage, max_leverage, is_trading_on, class, margin_instrument_id, market_status, cross_quote_price, close_only, quote_currency, base_currency, price, margin_instrument_strategy_is_active, lot_size, step_size

GraphQL Operation

subscription open_margin_position_update($wallet_id: String) {
  open_margin_position_update(wallet_id: $wallet_id) {
    margin_position_id
    instrument_id
    user_id
    side
    leverage
    amount
    value
    funding_fee_amount
    entry_price
    start_price_ts
    end_price_ts
    start_ask_price
    duration
    end_ask_price
    pnl
    stop_loss
    take_profit
    start_ts_timestamp
    close_reason
    updated_at_iso
    start_bid_price
    end_bid_price
    close_reason_code
    margin
    total_pnl
    cross_quote_price
    exit_price
    wallet_id
    margin_currency_id
    end_ts_iso
    margin_instrument {
      base_currency_id
      quote_currency_id
      name
      price_decimals
      quantity_decimals
      min_quantity
      min_leverage
      max_leverage
      is_trading_on
      class
      margin_instrument_id
      market_status
      cross_quote_price
      close_only
      quote_currency {
        precision
      }
      base_currency {
        precision
      }
      price {
        ask
        bid
      }
      margin_instrument_strategy_is_active
      lot_size
      step_size
    }
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"subscription open_margin_position_update($wallet_id: String) { open_margin_position_update(wallet_id: $wallet_id) { margin_position_id instrument_id user_id side leverage amount value funding_fee_amount entry_price start_price_ts end_price_ts start_ask_price duration end_ask_price pnl stop_loss take_profit start_ts_timestamp close_reason updated_at_iso start_bid_price end_bid_price close_reason_code margin total_pnl cross_quote_price exit_price wallet_id margin_currency_id end_ts_iso margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_quantity min_leverage max_leverage is_trading_on class margin_instrument_id market_status cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size } } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """subscription open_margin_position_update($wallet_id: String) { open_margin_position_update(wallet_id: $wallet_id) { margin_position_id instrument_id user_id side leverage amount value funding_fee_amount entry_price start_price_ts end_price_ts start_ask_price duration end_ask_price pnl stop_loss take_profit start_ts_timestamp close_reason updated_at_iso start_bid_price end_bid_price close_reason_code margin total_pnl cross_quote_price exit_price wallet_id margin_currency_id end_ts_iso margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_quantity min_leverage max_leverage is_trading_on class margin_instrument_id market_status cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `subscription open_margin_position_update($wallet_id: String) { open_margin_position_update(wallet_id: $wallet_id) { margin_position_id instrument_id user_id side leverage amount value funding_fee_amount entry_price start_price_ts end_price_ts start_ask_price duration end_ask_price pnl stop_loss take_profit start_ts_timestamp close_reason updated_at_iso start_bid_price end_bid_price close_reason_code margin total_pnl cross_quote_price exit_price wallet_id margin_currency_id end_ts_iso margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_quantity min_leverage max_leverage is_trading_on class margin_instrument_id market_status cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Subscriptions are delivered over WebSocket (wss://). Use a GraphQL-WS client rather than this HTTP runner.

Authenticate at the top of the page to try this
query open_margin_positions Open Margin Positions
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
search String optional
pager PagerInput optional
sort SortInput optional
user_id String optional
dateRange DateRangeInput optional
side MarginPositionSide optional
instrument_id String optional
instruments_ids [String!] optional
wallet_id String optional

Response

FieldSub-fields
margin_position_id scalar
instrument_id scalar
user_id scalar
side scalar
leverage scalar
amount scalar
value scalar
funding_fee_amount scalar
entry_price scalar
start_price_ts scalar
end_price_ts scalar
start_ask_price scalar
duration scalar
end_ask_price scalar
pnl scalar
stop_loss scalar
take_profit scalar
start_ts_timestamp scalar
close_reason scalar
updated_at_iso scalar
start_bid_price scalar
end_bid_price scalar
close_reason_code scalar
margin scalar
total_pnl scalar
cross_quote_price scalar
exit_price scalar
wallet_id scalar
margin_currency_id scalar
margin_instrument base_currency_id, quote_currency_id, name, price_decimals, quantity_decimals, min_quantity, min_leverage, max_leverage, is_trading_on, class, margin_instrument_id, market_status, cross_quote_price, close_only, quote_currency, base_currency, price, margin_instrument_strategy_is_active, lot_size, step_size

GraphQL Operation

query open_margin_positions($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) {
  open_margin_positions(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) {
    margin_position_id
    instrument_id
    user_id
    side
    leverage
    amount
    value
    funding_fee_amount
    entry_price
    start_price_ts
    end_price_ts
    start_ask_price
    duration
    end_ask_price
    pnl
    stop_loss
    take_profit
    start_ts_timestamp
    close_reason
    updated_at_iso
    start_bid_price
    end_bid_price
    close_reason_code
    margin
    total_pnl
    cross_quote_price
    exit_price
    wallet_id
    margin_currency_id
    margin_instrument {
      base_currency_id
      quote_currency_id
      name
      price_decimals
      quantity_decimals
      min_quantity
      min_leverage
      max_leverage
      is_trading_on
      class
      margin_instrument_id
      market_status
      cross_quote_price
      close_only
      quote_currency {
        precision
      }
      base_currency {
        precision
      }
      price {
        ask
        bid
      }
      margin_instrument_strategy_is_active
      lot_size
      step_size
    }
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query open_margin_positions($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) { open_margin_positions(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) { margin_position_id instrument_id user_id side leverage amount value funding_fee_amount entry_price start_price_ts end_price_ts start_ask_price duration end_ask_price pnl stop_loss take_profit start_ts_timestamp close_reason updated_at_iso start_bid_price end_bid_price close_reason_code margin total_pnl cross_quote_price exit_price wallet_id margin_currency_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_quantity min_leverage max_leverage is_trading_on class margin_instrument_id market_status cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size } } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query open_margin_positions($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) { open_margin_positions(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) { margin_position_id instrument_id user_id side leverage amount value funding_fee_amount entry_price start_price_ts end_price_ts start_ask_price duration end_ask_price pnl stop_loss take_profit start_ts_timestamp close_reason updated_at_iso start_bid_price end_bid_price close_reason_code margin total_pnl cross_quote_price exit_price wallet_id margin_currency_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_quantity min_leverage max_leverage is_trading_on class margin_instrument_id market_status cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query open_margin_positions($search: String, $pager: PagerInput, $sort: SortInput, $user_id: String, $dateRange: DateRangeInput, $side: MarginPositionSide, $instrument_id: String, $instruments_ids: [String!], $wallet_id: String) { open_margin_positions(search: $search, pager: $pager, sort: $sort, user_id: $user_id, dateRange: $dateRange, side: $side, instrument_id: $instrument_id, instruments_ids: $instruments_ids, wallet_id: $wallet_id) { margin_position_id instrument_id user_id side leverage amount value funding_fee_amount entry_price start_price_ts end_price_ts start_ask_price duration end_ask_price pnl stop_loss take_profit start_ts_timestamp close_reason updated_at_iso start_bid_price end_bid_price close_reason_code margin total_pnl cross_quote_price exit_price wallet_id margin_currency_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_quantity min_leverage max_leverage is_trading_on class margin_instrument_id market_status cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
subscription user_balance_position User Balance Position
Endpoint: WS https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Subscription

Inputs

NameTypeRequired
wallet_id String optional

Response

FieldSub-fields
free_balance scalar
equity scalar
margin_call_left_margin scalar
currently_used_margin scalar
pnl scalar
total_pnl scalar
margin_ratio_percentage scalar
risk_level scalar
liquidation_left_margin scalar
unsettled_balance scalar

GraphQL Operation

subscription user_balance_position($wallet_id: String) {
  user_balance_position(wallet_id: $wallet_id) {
    free_balance
    equity
    margin_call_left_margin
    currently_used_margin
    pnl
    total_pnl
    margin_ratio_percentage
    risk_level
    liquidation_left_margin
    unsettled_balance
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"subscription user_balance_position($wallet_id: String) { user_balance_position(wallet_id: $wallet_id) { free_balance equity margin_call_left_margin currently_used_margin pnl total_pnl margin_ratio_percentage risk_level liquidation_left_margin unsettled_balance } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """subscription user_balance_position($wallet_id: String) { user_balance_position(wallet_id: $wallet_id) { free_balance equity margin_call_left_margin currently_used_margin pnl total_pnl margin_ratio_percentage risk_level liquidation_left_margin unsettled_balance } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `subscription user_balance_position($wallet_id: String) { user_balance_position(wallet_id: $wallet_id) { free_balance equity margin_call_left_margin currently_used_margin pnl total_pnl margin_ratio_percentage risk_level liquidation_left_margin unsettled_balance } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Subscriptions are delivered over WebSocket (wss://). Use a GraphQL-WS client rather than this HTTP runner.

Authenticate at the top of the page to try this

Trade

9 ops
mutation cancel_all_margin_orders Cancel All Margin Orders
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
wallet_id String optional

Response

Returns a scalar value (e.g. a boolean flag or identifier).

GraphQL Operation

mutation cancel_all_margin_orders($wallet_id: String) {
  cancel_all_margin_orders(wallet_id: $wallet_id)
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation cancel_all_margin_orders($wallet_id: String) { cancel_all_margin_orders(wallet_id: $wallet_id) }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation cancel_all_margin_orders($wallet_id: String) { cancel_all_margin_orders(wallet_id: $wallet_id) }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation cancel_all_margin_orders($wallet_id: String) { cancel_all_margin_orders(wallet_id: $wallet_id) }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
mutation cancel_margin_order Cancel Margin Order
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
margin_order_id String required

Response

Returns a scalar value (e.g. a boolean flag or identifier).

GraphQL Operation

mutation cancel_margin_order($margin_order_id: String!) {
  cancel_margin_order(margin_order_id: $margin_order_id)
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation cancel_margin_order($margin_order_id: String!) { cancel_margin_order(margin_order_id: $margin_order_id) }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation cancel_margin_order($margin_order_id: String!) { cancel_margin_order(margin_order_id: $margin_order_id) }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation cancel_margin_order($margin_order_id: String!) { cancel_margin_order(margin_order_id: $margin_order_id) }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
mutation close_all_margin_positions Close All Margin Positions
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
wallet_id String required

Response

Returns a scalar value (e.g. a boolean flag or identifier).

GraphQL Operation

mutation close_all_margin_positions($wallet_id: String!) {
  close_all_margin_positions(wallet_id: $wallet_id)
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation close_all_margin_positions($wallet_id: String!) { close_all_margin_positions(wallet_id: $wallet_id) }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation close_all_margin_positions($wallet_id: String!) { close_all_margin_positions(wallet_id: $wallet_id) }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation close_all_margin_positions($wallet_id: String!) { close_all_margin_positions(wallet_id: $wallet_id) }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
mutation close_margin_position Close Margin Position
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
margin_position_id String required
percentage Percentage optional
amount Float optional
wallet_id String required

Response

Returns a scalar value (e.g. a boolean flag or identifier).

GraphQL Operation

mutation close_margin_position($margin_position_id: String!, $percentage: Percentage, $amount: Float, $wallet_id: String!) {
  close_margin_position(margin_position_id: $margin_position_id, percentage: $percentage, amount: $amount, wallet_id: $wallet_id)
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation close_margin_position($margin_position_id: String!, $percentage: Percentage, $amount: Float, $wallet_id: String!) { close_margin_position(margin_position_id: $margin_position_id, percentage: $percentage, amount: $amount, wallet_id: $wallet_id) }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation close_margin_position($margin_position_id: String!, $percentage: Percentage, $amount: Float, $wallet_id: String!) { close_margin_position(margin_position_id: $margin_position_id, percentage: $percentage, amount: $amount, wallet_id: $wallet_id) }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation close_margin_position($margin_position_id: String!, $percentage: Percentage, $amount: Float, $wallet_id: String!) { close_margin_position(margin_position_id: $margin_position_id, percentage: $percentage, amount: $amount, wallet_id: $wallet_id) }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
mutation create_margin_order Create Margin Order
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
quantity Float required
instrument_id String required
leverage Int required
side MarginPositionSide required
type MarginOrderType required
price Float optional
stop_loss Float optional
take_profit Float optional
expires_at String optional
all_in ToggleSwitch optional
wallet_id String optional
time_in_force MarginOrderTimeInForce required

Response

FieldSub-fields
margin_order_id scalar

GraphQL Operation

mutation create_margin_order($quantity: Float!, $instrument_id: String!, $leverage: Int!, $side: MarginPositionSide!, $type: MarginOrderType!, $price: Float, $stop_loss: Float, $take_profit: Float, $expires_at: String, $all_in: ToggleSwitch, $wallet_id: String, $time_in_force: MarginOrderTimeInForce!) {
  create_margin_order(quantity: $quantity, instrument_id: $instrument_id, leverage: $leverage, side: $side, type: $type, price: $price, stop_loss: $stop_loss, take_profit: $take_profit, expires_at: $expires_at, all_in: $all_in, wallet_id: $wallet_id, time_in_force: $time_in_force) {
    margin_order_id
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation create_margin_order($quantity: Float!, $instrument_id: String!, $leverage: Int!, $side: MarginPositionSide!, $type: MarginOrderType!, $price: Float, $stop_loss: Float, $take_profit: Float, $expires_at: String, $all_in: ToggleSwitch, $wallet_id: String, $time_in_force: MarginOrderTimeInForce!) { create_margin_order(quantity: $quantity, instrument_id: $instrument_id, leverage: $leverage, side: $side, type: $type, price: $price, stop_loss: $stop_loss, take_profit: $take_profit, expires_at: $expires_at, all_in: $all_in, wallet_id: $wallet_id, time_in_force: $time_in_force) { margin_order_id } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation create_margin_order($quantity: Float!, $instrument_id: String!, $leverage: Int!, $side: MarginPositionSide!, $type: MarginOrderType!, $price: Float, $stop_loss: Float, $take_profit: Float, $expires_at: String, $all_in: ToggleSwitch, $wallet_id: String, $time_in_force: MarginOrderTimeInForce!) { create_margin_order(quantity: $quantity, instrument_id: $instrument_id, leverage: $leverage, side: $side, type: $type, price: $price, stop_loss: $stop_loss, take_profit: $take_profit, expires_at: $expires_at, all_in: $all_in, wallet_id: $wallet_id, time_in_force: $time_in_force) { margin_order_id } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation create_margin_order($quantity: Float!, $instrument_id: String!, $leverage: Int!, $side: MarginPositionSide!, $type: MarginOrderType!, $price: Float, $stop_loss: Float, $take_profit: Float, $expires_at: String, $all_in: ToggleSwitch, $wallet_id: String, $time_in_force: MarginOrderTimeInForce!) { create_margin_order(quantity: $quantity, instrument_id: $instrument_id, leverage: $leverage, side: $side, type: $type, price: $price, stop_loss: $stop_loss, take_profit: $take_profit, expires_at: $expires_at, all_in: $all_in, wallet_id: $wallet_id, time_in_force: $time_in_force) { margin_order_id } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
mutation edit_margin_order Edit Margin Order
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
margin_order_id String required
leverage Int required
quantity Float required
price Float optional
stop_loss Float optional
take_profit Float optional
expires_at String optional

Response

Returns a scalar value (e.g. a boolean flag or identifier).

GraphQL Operation

mutation edit_margin_order($margin_order_id: String!, $leverage: Int!, $quantity: Float!, $price: Float, $stop_loss: Float, $take_profit: Float, $expires_at: String) {
  edit_margin_order(margin_order_id: $margin_order_id, leverage: $leverage, quantity: $quantity, price: $price, stop_loss: $stop_loss, take_profit: $take_profit, expires_at: $expires_at)
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation edit_margin_order($margin_order_id: String!, $leverage: Int!, $quantity: Float!, $price: Float, $stop_loss: Float, $take_profit: Float, $expires_at: String) { edit_margin_order(margin_order_id: $margin_order_id, leverage: $leverage, quantity: $quantity, price: $price, stop_loss: $stop_loss, take_profit: $take_profit, expires_at: $expires_at) }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation edit_margin_order($margin_order_id: String!, $leverage: Int!, $quantity: Float!, $price: Float, $stop_loss: Float, $take_profit: Float, $expires_at: String) { edit_margin_order(margin_order_id: $margin_order_id, leverage: $leverage, quantity: $quantity, price: $price, stop_loss: $stop_loss, take_profit: $take_profit, expires_at: $expires_at) }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation edit_margin_order($margin_order_id: String!, $leverage: Int!, $quantity: Float!, $price: Float, $stop_loss: Float, $take_profit: Float, $expires_at: String) { edit_margin_order(margin_order_id: $margin_order_id, leverage: $leverage, quantity: $quantity, price: $price, stop_loss: $stop_loss, take_profit: $take_profit, expires_at: $expires_at) }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
query estimate_margin_user_position Estimate Margin User Position
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Query

Inputs

NameTypeRequired
instrument_id String required
quantity Float required
leverage Int required
side MarginPositionSide required
limit_price Float optional
use_cached_price ToggleSwitch optional
wallet_id String optional

Response

FieldSub-fields
order_required_margin scalar
fee scalar
order_available_margin scalar
order_value scalar
max_position_size_base scalar
min_position_size_base scalar
fees_breakdown fee, value, source
free_balance scalar
pnl scalar
equity scalar
total_pnl scalar

GraphQL Operation

query estimate_margin_user_position($instrument_id: String!, $quantity: Float!, $leverage: Int!, $side: MarginPositionSide!, $limit_price: Float, $use_cached_price: ToggleSwitch, $wallet_id: String) {
  estimate_margin_user_position(instrument_id: $instrument_id, quantity: $quantity, leverage: $leverage, side: $side, limit_price: $limit_price, use_cached_price: $use_cached_price, wallet_id: $wallet_id) {
    order_required_margin
    fee
    order_available_margin
    order_value
    max_position_size_base
    min_position_size_base
    fees_breakdown {
      fee
      value
      source
    }
    free_balance
    pnl
    equity
    total_pnl
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"query estimate_margin_user_position($instrument_id: String!, $quantity: Float!, $leverage: Int!, $side: MarginPositionSide!, $limit_price: Float, $use_cached_price: ToggleSwitch, $wallet_id: String) { estimate_margin_user_position(instrument_id: $instrument_id, quantity: $quantity, leverage: $leverage, side: $side, limit_price: $limit_price, use_cached_price: $use_cached_price, wallet_id: $wallet_id) { order_required_margin fee order_available_margin order_value max_position_size_base min_position_size_base fees_breakdown { fee value source } free_balance pnl equity total_pnl } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """query estimate_margin_user_position($instrument_id: String!, $quantity: Float!, $leverage: Int!, $side: MarginPositionSide!, $limit_price: Float, $use_cached_price: ToggleSwitch, $wallet_id: String) { estimate_margin_user_position(instrument_id: $instrument_id, quantity: $quantity, leverage: $leverage, side: $side, limit_price: $limit_price, use_cached_price: $use_cached_price, wallet_id: $wallet_id) { order_required_margin fee order_available_margin order_value max_position_size_base min_position_size_base fees_breakdown { fee value source } free_balance pnl equity total_pnl } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `query estimate_margin_user_position($instrument_id: String!, $quantity: Float!, $leverage: Int!, $side: MarginPositionSide!, $limit_price: Float, $use_cached_price: ToggleSwitch, $wallet_id: String) { estimate_margin_user_position(instrument_id: $instrument_id, quantity: $quantity, leverage: $leverage, side: $side, limit_price: $limit_price, use_cached_price: $use_cached_price, wallet_id: $wallet_id) { order_required_margin fee order_available_margin order_value max_position_size_base min_position_size_base fees_breakdown { fee value source } free_balance pnl equity total_pnl } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this
subscription margin_user_update Margin User Update
Endpoint: WS https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Subscription

Inputs

NameTypeRequired
wallet_id String optional

Response

FieldSub-fields
notification title, body, trigger

GraphQL Operation

subscription margin_user_update($wallet_id: String) {
  margin_user_update(wallet_id: $wallet_id) {
    notification {
      title
      body
      trigger
    }
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"subscription margin_user_update($wallet_id: String) { margin_user_update(wallet_id: $wallet_id) { notification { title body trigger } } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """subscription margin_user_update($wallet_id: String) { margin_user_update(wallet_id: $wallet_id) { notification { title body trigger } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `subscription margin_user_update($wallet_id: String) { margin_user_update(wallet_id: $wallet_id) { notification { title body trigger } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Subscriptions are delivered over WebSocket (wss://). Use a GraphQL-WS client rather than this HTTP runner.

Authenticate at the top of the page to try this
mutation update_open_margin_position Update Open Margin Position
Endpoint: POST https://margin-trading-service-andx.cryptosrvc.com/graphql
Type: Mutation

Inputs

NameTypeRequired
margin_position_id String required
leverage Int required
stop_loss Float optional
take_profit Float optional

Response

FieldSub-fields
margin_position_id scalar
instrument_id scalar
user_id scalar
side scalar
leverage scalar
amount scalar
value scalar
funding_fee_amount scalar
entry_price scalar
start_price_ts scalar
end_price_ts scalar
start_ask_price scalar
duration scalar
end_ask_price scalar
pnl scalar
stop_loss scalar
take_profit scalar
start_ts_timestamp scalar
close_reason scalar
updated_at_iso scalar
start_bid_price scalar
end_bid_price scalar
close_reason_code scalar
margin scalar
total_pnl scalar
cross_quote_price scalar
exit_price scalar
wallet_id scalar
margin_currency_id scalar
margin_instrument base_currency_id, quote_currency_id, name, price_decimals, quantity_decimals, min_quantity, min_leverage, max_leverage, is_trading_on, class, margin_instrument_id, market_status, cross_quote_price, close_only, quote_currency, base_currency, price, margin_instrument_strategy_is_active, lot_size, step_size

GraphQL Operation

mutation update_open_margin_position($margin_position_id: String!, $leverage: Int!, $stop_loss: Float, $take_profit: Float) {
  update_open_margin_position(margin_position_id: $margin_position_id, leverage: $leverage, stop_loss: $stop_loss, take_profit: $take_profit) {
    margin_position_id
    instrument_id
    user_id
    side
    leverage
    amount
    value
    funding_fee_amount
    entry_price
    start_price_ts
    end_price_ts
    start_ask_price
    duration
    end_ask_price
    pnl
    stop_loss
    take_profit
    start_ts_timestamp
    close_reason
    updated_at_iso
    start_bid_price
    end_bid_price
    close_reason_code
    margin
    total_pnl
    cross_quote_price
    exit_price
    wallet_id
    margin_currency_id
    margin_instrument {
      base_currency_id
      quote_currency_id
      name
      price_decimals
      quantity_decimals
      min_quantity
      min_leverage
      max_leverage
      is_trading_on
      class
      margin_instrument_id
      market_status
      cross_quote_price
      close_only
      quote_currency {
        precision
      }
      base_currency {
        precision
      }
      price {
        ask
        bid
      }
      margin_instrument_strategy_is_active
      lot_size
      step_size
    }
  }
}

Code Examples

curl -X POST 'https://margin-trading-service-andx.cryptosrvc.com/graphql' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation update_open_margin_position($margin_position_id: String!, $leverage: Int!, $stop_loss: Float, $take_profit: Float) { update_open_margin_position(margin_position_id: $margin_position_id, leverage: $leverage, stop_loss: $stop_loss, take_profit: $take_profit) { margin_position_id instrument_id user_id side leverage amount value funding_fee_amount entry_price start_price_ts end_price_ts start_ask_price duration end_ask_price pnl stop_loss take_profit start_ts_timestamp close_reason updated_at_iso start_bid_price end_bid_price close_reason_code margin total_pnl cross_quote_price exit_price wallet_id margin_currency_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_quantity min_leverage max_leverage is_trading_on class margin_instrument_id market_status cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size } } }","variables":{}}'
import requests

url = "https://margin-trading-service-andx.cryptosrvc.com/graphql"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
    "query": """mutation update_open_margin_position($margin_position_id: String!, $leverage: Int!, $stop_loss: Float, $take_profit: Float) { update_open_margin_position(margin_position_id: $margin_position_id, leverage: $leverage, stop_loss: $stop_loss, take_profit: $take_profit) { margin_position_id instrument_id user_id side leverage amount value funding_fee_amount entry_price start_price_ts end_price_ts start_ask_price duration end_ask_price pnl stop_loss take_profit start_ts_timestamp close_reason updated_at_iso start_bid_price end_bid_price close_reason_code margin total_pnl cross_quote_price exit_price wallet_id margin_currency_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_quantity min_leverage max_leverage is_trading_on class margin_instrument_id market_status cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size } } }""",
    "variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service-andx.cryptosrvc.com/graphql", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${YOUR_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `mutation update_open_margin_position($margin_position_id: String!, $leverage: Int!, $stop_loss: Float, $take_profit: Float) { update_open_margin_position(margin_position_id: $margin_position_id, leverage: $leverage, stop_loss: $stop_loss, take_profit: $take_profit) { margin_position_id instrument_id user_id side leverage amount value funding_fee_amount entry_price start_price_ts end_price_ts start_ask_price duration end_ask_price pnl stop_loss take_profit start_ts_timestamp close_reason updated_at_iso start_bid_price end_bid_price close_reason_code margin total_pnl cross_quote_price exit_price wallet_id margin_currency_id margin_instrument { base_currency_id quote_currency_id name price_decimals quantity_decimals min_quantity min_leverage max_leverage is_trading_on class margin_instrument_id market_status cross_quote_price close_only quote_currency { precision } base_currency { precision } price { ask bid } margin_instrument_strategy_is_active lot_size step_size } } }`,
    variables: {},
  }),
});
const data = await response.json();
console.log(data);

Try It

Authenticate at the top of the page to try this