SHIFT Platform API Reference
Programmatic GraphQL access to the SHIFT exchange platform — 117 operations across 7 modules covering spot trading, wallets, conversions & payments, derivatives, vaults/earn, referral, and account settings.
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 account settings (or via the create_api_key mutation) — it returns an api_key_id and api_key_secret. Tokens are short-lived; sign in again to refresh.
Introduction
The Platform API Reference 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.
- Create an API key in your account settings (or via the
create_api_keymutation). It returnsapi_key_idandapi_key_secret(the secret is shown only once). - Exchange the key for a JWT:
service_signin(service_api_key, service_api_secret)→{ jwt, expires_at }. - Send
Authorization: Bearer <jwt>on every request. If the key hashmac_requiredenabled, also HMAC-sign each request with the secret.
Endpoint
Operations in this document target the SHIFT demo environment:
https://vakotrade-demo.cryptosrvc.com/graphql for all operations except Derivatives
https://margin-trading-service.cryptosrvc.com/graphql for Derivatives operations
The same bearer token is accepted on both endpoints.
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.
Users
27 operations · service: https://vakotrade-demo.cryptosrvc.com/graphql
query
api_keys
Paginated list of the caller's API keys, newest first; secrets are masked (secret_hash returned as ****). Admins may pass user_id; non-super admins only see keys they created.
api_keys.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
search |
String |
optional | Prefix match on API key ID, key name or IP address. |
pager |
PagerInput |
optional | Pagination: limit (default 30) and offset (default 0). |
sort |
SortInput |
optional | Sort direction by creation order (serial_id); default DESC. |
Response
| Field | Sub-fields |
|---|---|
api_key_id |
scalar |
name |
scalar |
is_active |
scalar |
created_at_iso |
scalar |
expires_at_iso |
scalar |
permissions |
scalar |
ip_address |
scalar |
hmac_required |
scalar |
GraphQL Operation
query api_keys($search: String, $pager: PagerInput, $sort: SortInput) {
api_keys(search: $search, pager: $pager, sort: $sort) {
api_key_id
name
is_active
created_at_iso
expires_at_iso
permissions
ip_address
hmac_required
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query api_keys($search: String, $pager: PagerInput, $sort: SortInput) { api_keys(search: $search, pager: $pager, sort: $sort) { api_key_id name is_active created_at_iso expires_at_iso permissions ip_address hmac_required } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query api_keys($search: String, $pager: PagerInput, $sort: SortInput) { api_keys(search: $search, pager: $pager, sort: $sort) { api_key_id name is_active created_at_iso expires_at_iso permissions ip_address hmac_required } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query api_keys($search: String, $pager: PagerInput, $sort: SortInput) { api_keys(search: $search, pager: $pager, sort: $sort) { api_key_id name is_active created_at_iso expires_at_iso permissions ip_address hmac_required } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation
checkin
Registers a sign-in after authentication. On a trader's first check-in it creates the user profile (default language, currency, Europe/London timezone); always fires the signin notification. Returns true.
Inputs
Response
GraphQL Operation
mutation checkin {
checkin
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation checkin { checkin }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation checkin { checkin }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation checkin { checkin }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
This operation takes no inputs.
mutation checkout Signs the caller out: marks the current access token as signed out and revokes the current session. Returns true.
Inputs
Response
GraphQL Operation
mutation checkout {
checkout
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation checkout { checkout }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation checkout { checkout }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation checkout { checkout }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
This operation takes no inputs.
mutation
complete_upload
Finalises a document upload started with create_upload after the file was PUT to the pre-signed URL. Saves the file details and returns the upload record with a pre-signed download URL.
upload_user_document.Inputs
| Name | Type | Required | Description | ||
|---|---|---|---|---|---|
upload_id |
String |
required | Not accepted: checkin takes no arguments. |
Not accepted: checkout takes no arguments. |
ID returned by create_upload. |
size |
Float |
required | Not accepted: checkin takes no arguments. |
Not accepted: checkout takes no arguments. |
File size in bytes. |
original_name |
String |
required | Not accepted: checkin takes no arguments. |
Not accepted: checkout takes no arguments. |
Original file name. |
s3_etag |
String |
required | Not accepted: checkin takes no arguments. |
Not accepted: checkout takes no arguments. |
ETag returned by storage for the uploaded object. |
Response
| Field | Sub-fields |
|---|---|
content_type |
scalar |
created_at |
scalar |
document_type |
scalar |
original_name |
scalar |
s3_bucket |
scalar |
s3_etag |
scalar |
s3_key |
scalar |
s3_location |
scalar |
s3_public_url |
scalar |
size |
scalar |
upload_id |
scalar |
user_id |
scalar |
GraphQL Operation
mutation complete_upload($upload_id: String!, $size: Float!, $original_name: String!, $s3_etag: String!) {
complete_upload(upload_id: $upload_id, size: $size, original_name: $original_name, s3_etag: $s3_etag) {
content_type
created_at
document_type
original_name
s3_bucket
s3_etag
s3_key
s3_location
s3_public_url
size
upload_id
user_id
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation complete_upload($upload_id: String!, $size: Float!, $original_name: String!, $s3_etag: String!) { complete_upload(upload_id: $upload_id, size: $size, original_name: $original_name, s3_etag: $s3_etag) { content_type created_at document_type original_name s3_bucket s3_etag s3_key s3_location s3_public_url size upload_id user_id } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation complete_upload($upload_id: String!, $size: Float!, $original_name: String!, $s3_etag: String!) { complete_upload(upload_id: $upload_id, size: $size, original_name: $original_name, s3_etag: $s3_etag) { content_type created_at document_type original_name s3_bucket s3_etag s3_key s3_location s3_public_url size upload_id user_id } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation complete_upload($upload_id: String!, $size: Float!, $original_name: String!, $s3_etag: String!) { complete_upload(upload_id: $upload_id, size: $size, original_name: $original_name, s3_etag: $s3_etag) { content_type created_at document_type original_name s3_bucket s3_etag s3_key s3_location s3_public_url size upload_id user_id } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation
complete_upload_trading_view_template
Finalises a chart template upload after its JSON was PUT to the upload URL. Returns the template with a pre-signed download url.
upload_user_document.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
template_id |
String |
required | ID returned by upload_trading_view_template. |
s3_etag |
String |
required | ETag returned by storage for the uploaded object. |
original_name |
String |
required | Original file name; keeps the stored name when empty. |
Response
| Field | Sub-fields |
|---|---|
template_id |
scalar |
template_name |
scalar |
template_type |
scalar |
instrument_id |
scalar |
url |
scalar |
GraphQL Operation
mutation complete_upload_trading_view_template($template_id: String!, $s3_etag: String!, $original_name: String!) {
complete_upload_trading_view_template(template_id: $template_id, s3_etag: $s3_etag, original_name: $original_name) {
template_id
template_name
template_type
instrument_id
url
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation complete_upload_trading_view_template($template_id: String!, $s3_etag: String!, $original_name: String!) { complete_upload_trading_view_template(template_id: $template_id, s3_etag: $s3_etag, original_name: $original_name) { template_id template_name template_type instrument_id url } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation complete_upload_trading_view_template($template_id: String!, $s3_etag: String!, $original_name: String!) { complete_upload_trading_view_template(template_id: $template_id, s3_etag: $s3_etag, original_name: $original_name) { template_id template_name template_type instrument_id url } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation complete_upload_trading_view_template($template_id: String!, $s3_etag: String!, $original_name: String!) { complete_upload_trading_view_template(template_id: $template_id, s3_etag: $s3_etag, original_name: $original_name) { template_id template_name template_type instrument_id url } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation create_api_key Creates an API key and returns its ID, secret and expiry. The secret is shown only here. Traders are limited to 20 keys (per-user override possible) and trader-role permissions. Admins may pass user_id.
create_api_key. Requires approved KYC unless allow_payment_operation_without_kyc is on (admins exempt).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
name |
String |
optional | Optional label: letters/digits, words separated by single space, hyphen or underscore. |
expires_at |
String |
required | Expiry date-time; must be in the future. |
is_active |
ToggleSwitch |
required | Initial status (on/off). |
ip_address |
[String!] |
optional | Allowed caller IP addresses. Required for service keys. |
permissions |
[Permission!] |
required | Permissions to grant; non-empty. For trader keys, permissions outside the trader role are dropped. |
type |
ApiKeyTypes |
required | Key type: trader, admin (admins only) or service (super admins only). |
hmac_required |
ToggleSwitch |
required | When on, requests made with this key must carry an HMAC request signature. |
Response
| Field | Sub-fields |
|---|---|
api_key_id |
scalar |
api_key_secret |
scalar |
GraphQL Operation
mutation create_api_key($name: String, $expires_at: String!, $is_active: ToggleSwitch!, $ip_address: [String!], $permissions: [Permission!]!, $type: ApiKeyTypes!, $hmac_required: ToggleSwitch!) {
create_api_key(name: $name, expires_at: $expires_at, is_active: $is_active, ip_address: $ip_address, permissions: $permissions, type: $type, hmac_required: $hmac_required) {
api_key_id
api_key_secret
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation create_api_key($name: String, $expires_at: String!, $is_active: ToggleSwitch!, $ip_address: [String!], $permissions: [Permission!]!, $type: ApiKeyTypes!, $hmac_required: ToggleSwitch!) { create_api_key(name: $name, expires_at: $expires_at, is_active: $is_active, ip_address: $ip_address, permissions: $permissions, type: $type, hmac_required: $hmac_required) { api_key_id api_key_secret } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation create_api_key($name: String, $expires_at: String!, $is_active: ToggleSwitch!, $ip_address: [String!], $permissions: [Permission!]!, $type: ApiKeyTypes!, $hmac_required: ToggleSwitch!) { create_api_key(name: $name, expires_at: $expires_at, is_active: $is_active, ip_address: $ip_address, permissions: $permissions, type: $type, hmac_required: $hmac_required) { api_key_id api_key_secret } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation create_api_key($name: String, $expires_at: String!, $is_active: ToggleSwitch!, $ip_address: [String!], $permissions: [Permission!]!, $type: ApiKeyTypes!, $hmac_required: ToggleSwitch!) { create_api_key(name: $name, expires_at: $expires_at, is_active: $is_active, ip_address: $ip_address, permissions: $permissions, type: $type, hmac_required: $hmac_required) { api_key_id api_key_secret } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation create_kyc_session Opens a session with the configured KYC provider for the caller and returns the provider session identifier. Fails for the manual provider or after a 15 s provider timeout. Admins must pass user_id.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
kyc_type |
KycType |
required | individual (default) or corporate; selects which provider configuration is used. |
Response
GraphQL Operation
mutation create_kyc_session($kyc_type: KycType!) {
create_kyc_session(kyc_type: $kyc_type)
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation create_kyc_session($kyc_type: KycType!) { create_kyc_session(kyc_type: $kyc_type) }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation create_kyc_session($kyc_type: KycType!) { create_kyc_session(kyc_type: $kyc_type) }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation create_kyc_session($kyc_type: KycType!) { create_kyc_session(kyc_type: $kyc_type) }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation
create_upload
Starts a document upload: returns an upload_id and a pre-signed PUT upload_url. Replaces any existing upload of the same document type for that user. Finish with complete_upload.
upload_user_document.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
document_type |
UploadDocumentType |
required | Document kind, e.g. passport, proof_of_residence, profile_picture. |
content_type |
String |
required | MIME type: application/pdf, image/png, image/jpeg or image/gif. |
user_id |
String |
optional | Admin only; required for admins, ignored for traders. |
Response
| Field | Sub-fields |
|---|---|
upload_id |
scalar |
upload_url |
scalar |
GraphQL Operation
mutation create_upload($document_type: UploadDocumentType!, $content_type: String!, $user_id: String) {
create_upload(document_type: $document_type, content_type: $content_type, user_id: $user_id) {
upload_id
upload_url
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation create_upload($document_type: UploadDocumentType!, $content_type: String!, $user_id: String) { create_upload(document_type: $document_type, content_type: $content_type, user_id: $user_id) { upload_id upload_url } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation create_upload($document_type: UploadDocumentType!, $content_type: String!, $user_id: String) { create_upload(document_type: $document_type, content_type: $content_type, user_id: $user_id) { upload_id upload_url } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation create_upload($document_type: UploadDocumentType!, $content_type: String!, $user_id: String) { create_upload(document_type: $document_type, content_type: $content_type, user_id: $user_id) { upload_id upload_url } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation
create_user_mfa_secret
Generates a new authenticator (TOTP) secret for the caller and returns it with an otpauth URI and QR code. Fails if MFA is already on. Enable MFA afterwards with update_user_mfa_status.
Inputs
Response
| Field | Sub-fields | |
|---|---|---|
secret |
scalar | Response field, not an argument (operation takes none): the generated secret. |
uri |
scalar | Response field, not an argument: otpauth URI for authenticator apps. |
qr |
scalar | Response field, not an argument: QR code encoding the URI. |
GraphQL Operation
mutation create_user_mfa_secret {
create_user_mfa_secret {
secret
uri
qr
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation create_user_mfa_secret { create_user_mfa_secret { secret uri qr } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation create_user_mfa_secret { create_user_mfa_secret { secret uri qr } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation create_user_mfa_secret { create_user_mfa_secret { secret uri qr } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
This operation takes no inputs.
query crypto_networks All crypto networks configured on the platform, as network code and display name.
Inputs
Response
| Field | Sub-fields | |
|---|---|---|
crypto_network |
scalar | Response field, not an argument (query takes none): network code. |
crypto_network_name |
scalar | Response field, not an argument: network display name. |
GraphQL Operation
query crypto_networks {
crypto_networks {
crypto_network
crypto_network_name
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query crypto_networks { crypto_networks { crypto_network crypto_network_name } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query crypto_networks { crypto_networks { crypto_network crypto_network_name } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query crypto_networks { crypto_networks { crypto_network crypto_network_name } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
This operation takes no inputs.
mutation delete_api_key Deletes an API key. Traders can delete only their own keys; non-super admins only keys they created. Returns true on success.
delete_api_key. Requires approved KYC unless allow_payment_operation_without_kyc is on (admins exempt). Admin calls may need second-admin approval (delayed_mutations).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
api_key_id |
String |
required | ID of the API key to delete. |
Response
GraphQL Operation
mutation delete_api_key($api_key_id: String!) {
delete_api_key(api_key_id: $api_key_id)
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation delete_api_key($api_key_id: String!) { delete_api_key(api_key_id: $api_key_id) }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation delete_api_key($api_key_id: String!) { delete_api_key(api_key_id: $api_key_id) }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation delete_api_key($api_key_id: String!) { delete_api_key(api_key_id: $api_key_id) }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation delete_trading_view_template Deletes one of the caller's chart templates and its stored file. Returns true.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
template_id |
String |
required | ID of the caller's template to delete. |
Response
GraphQL Operation
mutation delete_trading_view_template($template_id: String!) {
delete_trading_view_template(template_id: $template_id)
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation delete_trading_view_template($template_id: String!) { delete_trading_view_template(template_id: $template_id) }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation delete_trading_view_template($template_id: String!) { delete_trading_view_template(template_id: $template_id) }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation delete_trading_view_template($template_id: String!) { delete_trading_view_template(template_id: $template_id) }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query is_trading_allowed Whether the caller may trade. Returns false for non-trader roles; for traders returns false only if the operation-restriction check fails.
Inputs
Response
GraphQL Operation
query is_trading_allowed {
is_trading_allowed
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query is_trading_allowed { is_trading_allowed }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query is_trading_allowed { is_trading_allowed }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query is_trading_allowed { is_trading_allowed }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
This operation takes no inputs.
query
kyc_preferences
Platform KYC provider settings for individual and corporate verification. provider_secret_key is blanked for non-admins.
Inputs
Response
| Field | Sub-fields | |||
|---|---|---|---|---|
individual |
provider, provider_url, enabled | Not accepted: the arguments are mfa_token and hard_delete. |
Not accepted: is_trading_allowed takes no arguments. |
Response field, not an argument (query takes none): provider settings for individual KYC. |
corporate |
provider, provider_url, enabled | Not accepted: the arguments are mfa_token and hard_delete. |
Not accepted: is_trading_allowed takes no arguments. |
Response field, not an argument: provider settings for corporate KYC. |
GraphQL Operation
query kyc_preferences {
kyc_preferences {
individual {
provider
provider_url
enabled
}
corporate {
provider
provider_url
enabled
}
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query kyc_preferences { kyc_preferences { individual { provider provider_url enabled } corporate { provider provider_url enabled } } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query kyc_preferences { kyc_preferences { individual { provider provider_url enabled } corporate { provider provider_url enabled } } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query kyc_preferences { kyc_preferences { individual { provider provider_url enabled } corporate { provider provider_url enabled } } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
This operation takes no inputs.
query kyc_user_data The caller's KYC data entries (property/value). Admins may pass user_id.
kyc_user_data.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
user_id |
String |
required | Admin only; ignored for traders. |
kyc_properties |
[String!] |
required | Return only these KYC property names (exact match). |
Response
| Field | Sub-fields |
|---|---|
user_id |
scalar |
kyc_property |
scalar |
kyc_value |
scalar |
updated_at |
scalar |
GraphQL Operation
query kyc_user_data($user_id: String!, $kyc_properties: [String!]!) {
kyc_user_data(user_id: $user_id, kyc_properties: $kyc_properties) {
user_id
kyc_property
kyc_value
updated_at
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query kyc_user_data($user_id: String!, $kyc_properties: [String!]!) { kyc_user_data(user_id: $user_id, kyc_properties: $kyc_properties) { user_id kyc_property kyc_value updated_at } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query kyc_user_data($user_id: String!, $kyc_properties: [String!]!) { kyc_user_data(user_id: $user_id, kyc_properties: $kyc_properties) { user_id kyc_property kyc_value updated_at } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query kyc_user_data($user_id: String!, $kyc_properties: [String!]!) { kyc_user_data(user_id: $user_id, kyc_properties: $kyc_properties) { user_id kyc_property kyc_value updated_at } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query payments_fees Paginated list of deposit/withdrawal fee rules, newest first. Not scoped to the caller's fee group; filter with fee_group_id.
payments_fees. Rate-limited (30 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
fee_group_id |
String |
optional | Exact match on fee group ID. |
pager |
PagerInput |
optional | Pagination: limit (default 30) and offset (default 0). |
currency_id |
String |
optional | Exact match on currency ID. |
Response
| Field | Sub-fields |
|---|---|
currency_id |
scalar |
deposit_flat_fee |
scalar |
deposit_progressive_fee |
scalar |
fee_group_id |
scalar |
fiat_transfer_type |
scalar |
crypto_network |
scalar |
payment_route_id |
scalar |
calculation_type |
scalar |
GraphQL Operation
query payments_fees($fee_group_id: String, $pager: PagerInput, $currency_id: String) {
payments_fees(fee_group_id: $fee_group_id, pager: $pager, currency_id: $currency_id) {
currency_id
deposit_flat_fee
deposit_progressive_fee
fee_group_id
fiat_transfer_type
crypto_network
payment_route_id
calculation_type
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query payments_fees($fee_group_id: String, $pager: PagerInput, $currency_id: String) { payments_fees(fee_group_id: $fee_group_id, pager: $pager, currency_id: $currency_id) { currency_id deposit_flat_fee deposit_progressive_fee fee_group_id fiat_transfer_type crypto_network payment_route_id calculation_type } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query payments_fees($fee_group_id: String, $pager: PagerInput, $currency_id: String) { payments_fees(fee_group_id: $fee_group_id, pager: $pager, currency_id: $currency_id) { currency_id deposit_flat_fee deposit_progressive_fee fee_group_id fiat_transfer_type crypto_network payment_route_id calculation_type } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query payments_fees($fee_group_id: String, $pager: PagerInput, $currency_id: String) { payments_fees(fee_group_id: $fee_group_id, pager: $pager, currency_id: $currency_id) { currency_id deposit_flat_fee deposit_progressive_fee fee_group_id fiat_transfer_type crypto_network payment_route_id calculation_type } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query payments_routes Paginated list of payment routes (deposit/withdrawal methods), newest first. For traders, routes disabled by their limit group are excluded.
payments_routes. Rate-limited (60 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
pager |
PagerInput |
optional | Pagination: limit (default 30) and offset (default 0). |
Response
| Field | Sub-fields |
|---|---|
payment_route_id |
scalar |
currency_id |
scalar |
psp_service_id |
scalar |
name |
scalar |
crypto_network |
scalar |
crypto_address_generate_new |
scalar |
crypto_address_tag_type |
scalar |
fiat_iframe_deposit_url |
scalar |
fiat_iframe_withdrawal_url |
scalar |
fiat_transfer_type |
scalar |
is_active |
scalar |
extend_network_fee |
scalar |
is_development |
scalar |
verification_type |
scalar |
deposit_enabled |
scalar |
withdrawal_enabled |
scalar |
is_crypto_to_fiat |
scalar |
meta |
scalar |
GraphQL Operation
query payments_routes($pager: PagerInput) {
payments_routes(pager: $pager) {
payment_route_id
currency_id
psp_service_id
name
crypto_network
crypto_address_generate_new
crypto_address_tag_type
fiat_iframe_deposit_url
fiat_iframe_withdrawal_url
fiat_transfer_type
is_active
extend_network_fee
is_development
verification_type
deposit_enabled
withdrawal_enabled
is_crypto_to_fiat
meta
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query payments_routes($pager: PagerInput) { payments_routes(pager: $pager) { payment_route_id currency_id psp_service_id name crypto_network crypto_address_generate_new crypto_address_tag_type fiat_iframe_deposit_url fiat_iframe_withdrawal_url fiat_transfer_type is_active extend_network_fee is_development verification_type deposit_enabled withdrawal_enabled is_crypto_to_fiat meta } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query payments_routes($pager: PagerInput) { payments_routes(pager: $pager) { payment_route_id currency_id psp_service_id name crypto_network crypto_address_generate_new crypto_address_tag_type fiat_iframe_deposit_url fiat_iframe_withdrawal_url fiat_transfer_type is_active extend_network_fee is_development verification_type deposit_enabled withdrawal_enabled is_crypto_to_fiat meta } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query payments_routes($pager: PagerInput) { payments_routes(pager: $pager) { payment_route_id currency_id psp_service_id name crypto_network crypto_address_generate_new crypto_address_tag_type fiat_iframe_deposit_url fiat_iframe_withdrawal_url fiat_transfer_type is_active extend_network_fee is_development verification_type deposit_enabled withdrawal_enabled is_crypto_to_fiat meta } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query timeline Paginated activity events for the caller, newest first. Without a date range, only the last month is returned. Admins may pass user_id.
timeline. Rate-limited (15 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
pager |
PagerInput |
optional | Pagination: limit (default 30, max 1000) and offset (default 0). |
event_name |
[NotificationTrigger!] |
optional | Return only these notification trigger types. |
Response
| Field | Sub-fields |
|---|---|
event_name |
scalar |
event_data |
scalar |
created_at |
scalar |
instrument |
base_currency_id, quote_currency_id |
GraphQL Operation
query timeline($pager: PagerInput, $event_name: [NotificationTrigger!]) {
timeline(pager: $pager, event_name: $event_name) {
event_name
event_data
created_at
instrument {
base_currency_id
quote_currency_id
}
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query timeline($pager: PagerInput, $event_name: [NotificationTrigger!]) { timeline(pager: $pager, event_name: $event_name) { event_name event_data created_at instrument { base_currency_id quote_currency_id } } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query timeline($pager: PagerInput, $event_name: [NotificationTrigger!]) { timeline(pager: $pager, event_name: $event_name) { event_name event_data created_at instrument { base_currency_id quote_currency_id } } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query timeline($pager: PagerInput, $event_name: [NotificationTrigger!]) { timeline(pager: $pager, event_name: $event_name) { event_name event_data created_at instrument { base_currency_id quote_currency_id } } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query
trading_view_templates
The caller's saved chart templates, each with a short-lived pre-signed download url.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
template_type |
SpotMargin |
optional | Filter by spot or margin. |
template_id |
String |
optional | Exact match on template ID. |
Response
| Field | Sub-fields |
|---|---|
template_id |
scalar |
template_name |
scalar |
template_type |
scalar |
instrument_id |
scalar |
serial_id |
scalar |
url |
scalar |
updated_at_iso |
scalar |
touched_at |
scalar |
periodicity |
scalar |
GraphQL Operation
query trading_view_templates($template_type: SpotMargin, $template_id: String) {
trading_view_templates(template_type: $template_type, template_id: $template_id) {
template_id
template_name
template_type
instrument_id
serial_id
url
updated_at_iso
touched_at
periodicity
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query trading_view_templates($template_type: SpotMargin, $template_id: String) { trading_view_templates(template_type: $template_type, template_id: $template_id) { template_id template_name template_type instrument_id serial_id url updated_at_iso touched_at periodicity } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query trading_view_templates($template_type: SpotMargin, $template_id: String) { trading_view_templates(template_type: $template_type, template_id: $template_id) { template_id template_name template_type instrument_id serial_id url updated_at_iso touched_at periodicity } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query trading_view_templates($template_type: SpotMargin, $template_id: String) { trading_view_templates(template_type: $template_type, template_id: $template_id) { template_id template_name template_type instrument_id serial_id url updated_at_iso touched_at periodicity } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation update_anti_phishing_code Sets the caller's anti-phishing code (HTML tags stripped) and returns the stored value.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
anti_phishing_code |
String |
required | New anti-phishing code; HTML tags are removed. |
token |
String |
required | Deprecated and ignored. |
Response
GraphQL Operation
mutation update_anti_phishing_code($anti_phishing_code: String!, $token: String!) {
update_anti_phishing_code(anti_phishing_code: $anti_phishing_code, token: $token)
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation update_anti_phishing_code($anti_phishing_code: String!, $token: String!) { update_anti_phishing_code(anti_phishing_code: $anti_phishing_code, token: $token) }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation update_anti_phishing_code($anti_phishing_code: String!, $token: String!) { update_anti_phishing_code(anti_phishing_code: $anti_phishing_code, token: $token) }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation update_anti_phishing_code($anti_phishing_code: String!, $token: String!) { update_anti_phishing_code(anti_phishing_code: $anti_phishing_code, token: $token) }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation update_api_key Updates an API key's name, expiry, status, IP list, permissions or HMAC requirement; omitted fields are unchanged. Traders can update only their own keys. Returns true.
update_api_key. Requires approved KYC unless allow_payment_operation_without_kyc is on (admins exempt). Admin calls may need second-admin approval (delayed_mutations).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
api_key_id |
String |
required | ID of the key to update. |
name |
String |
optional | New label. |
expires_at |
String |
optional | New expiry date-time; must be in the future. |
is_active |
ToggleSwitch |
optional | Enable or disable the key. |
ip_address |
[String!] |
optional | Replaces the allowed caller IP list. |
permissions |
[Permission!] |
optional | Replaces the permission list; for trader keys, permissions outside the trader role are dropped. |
hmac_required |
ToggleSwitch |
required | When on, requests made with this key must carry an HMAC request signature. |
Response
GraphQL Operation
mutation update_api_key($api_key_id: String!, $name: String, $expires_at: String, $is_active: ToggleSwitch, $ip_address: [String!], $permissions: [Permission!], $hmac_required: ToggleSwitch!) {
update_api_key(api_key_id: $api_key_id, name: $name, expires_at: $expires_at, is_active: $is_active, ip_address: $ip_address, permissions: $permissions, hmac_required: $hmac_required)
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation update_api_key($api_key_id: String!, $name: String, $expires_at: String, $is_active: ToggleSwitch, $ip_address: [String!], $permissions: [Permission!], $hmac_required: ToggleSwitch!) { update_api_key(api_key_id: $api_key_id, name: $name, expires_at: $expires_at, is_active: $is_active, ip_address: $ip_address, permissions: $permissions, hmac_required: $hmac_required) }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation update_api_key($api_key_id: String!, $name: String, $expires_at: String, $is_active: ToggleSwitch, $ip_address: [String!], $permissions: [Permission!], $hmac_required: ToggleSwitch!) { update_api_key(api_key_id: $api_key_id, name: $name, expires_at: $expires_at, is_active: $is_active, ip_address: $ip_address, permissions: $permissions, hmac_required: $hmac_required) }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation update_api_key($api_key_id: String!, $name: String, $expires_at: String, $is_active: ToggleSwitch, $ip_address: [String!], $permissions: [Permission!], $hmac_required: ToggleSwitch!) { update_api_key(api_key_id: $api_key_id, name: $name, expires_at: $expires_at, is_active: $is_active, ip_address: $ip_address, permissions: $permissions, hmac_required: $hmac_required) }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation
update_trading_view_template
Updates one of the caller's chart templates (name, periodicity, last-used time) and returns it with a pre-signed PUT update_url for uploading new content.
upload_user_document.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
template_id |
String |
required | ID (UUID) of the caller's template. |
template_name |
String |
optional | New template name. |
periodicity |
InstrumentHistoryPeriodicity |
optional | Chart periodicity to store with the template. |
touched_at |
String |
optional | Last-used timestamp to record. |
Response
| Field | Sub-fields |
|---|---|
template_id |
scalar |
template_name |
scalar |
template_type |
scalar |
instrument_id |
scalar |
serial_id |
scalar |
update_url |
scalar |
periodicity |
scalar |
touched_at |
scalar |
GraphQL Operation
mutation update_trading_view_template($template_id: String!, $template_name: String, $periodicity: InstrumentHistoryPeriodicity, $touched_at: String) {
update_trading_view_template(template_id: $template_id, template_name: $template_name, periodicity: $periodicity, touched_at: $touched_at) {
template_id
template_name
template_type
instrument_id
serial_id
update_url
periodicity
touched_at
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation update_trading_view_template($template_id: String!, $template_name: String, $periodicity: InstrumentHistoryPeriodicity, $touched_at: String) { update_trading_view_template(template_id: $template_id, template_name: $template_name, periodicity: $periodicity, touched_at: $touched_at) { template_id template_name template_type instrument_id serial_id update_url periodicity touched_at } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation update_trading_view_template($template_id: String!, $template_name: String, $periodicity: InstrumentHistoryPeriodicity, $touched_at: String) { update_trading_view_template(template_id: $template_id, template_name: $template_name, periodicity: $periodicity, touched_at: $touched_at) { template_id template_name template_type instrument_id serial_id update_url periodicity touched_at } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation update_trading_view_template($template_id: String!, $template_name: String, $periodicity: InstrumentHistoryPeriodicity, $touched_at: String) { update_trading_view_template(template_id: $template_id, template_name: $template_name, periodicity: $periodicity, touched_at: $touched_at) { template_id template_name template_type instrument_id serial_id update_url periodicity touched_at } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation update_user Updates the caller's profile and preferences; omitted fields are unchanged and list fields replace the stored list. Returns the user. Admins may pass user_id.
update_user. Rate-limited (60 req / 60 s, 1000 ms min gap). Admin calls may need second-admin approval (delayed_mutations).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
email |
String |
optional | Admin only; ignored for traders. |
language |
String |
optional | Preferred language code. |
primary_market_currency |
String |
optional | Currency used to display valuations. |
timezone |
String |
optional | Timezone name. |
favorite_instruments |
[String!] |
optional | Replaces the list of favourite instrument IDs. |
favorite_addresses_crypto |
[FavoriteAddressCryptoItem!] |
optional | Replaces saved crypto withdrawal addresses; newly added addresses trigger a crypto_address_added notification. |
favorite_fiat_destinations |
[FavoriteFiatDestinationItem!] |
optional | Replaces saved fiat withdrawal destinations (bank and beneficiary details). |
notifications_options |
NotificationOptionsArgs |
optional | Notification triggers to receive per channel: client, push, email, sms. |
default_timezone |
ToggleSwitch |
optional | Toggle to use the default timezone (on/off). |
client_custom_properties |
[ClientCustomPropertyItem!] |
optional | Custom property/value pairs, merged by property; protected existing properties are kept. |
Response
| Field | Sub-fields |
|---|---|
username |
scalar |
user_id |
scalar |
parent_user_id |
scalar |
email |
scalar |
language |
scalar |
timezone |
scalar |
primary_market_currency |
scalar |
profile_pic_url |
scalar |
created_at |
scalar |
updated_at |
scalar |
favorite_instruments |
scalar |
mfa_status |
scalar |
default_timezone |
scalar |
crypto_pay |
scalar |
fee_group_id |
scalar |
is_referral_claim_available |
scalar |
client_custom_properties |
property, value |
kyc_data |
kyc_property, kyc_value |
favorite_addresses_crypto |
currency_id, address, address_tag_type, address_tag_value, name, network, psp_service_id, network_name |
notifications_options |
client, push, email, sms |
favorite_fiat_destinations |
name, bank_name, bank_country, bank_region, bank_city, bank_address, bank_postal_code, bank_bic, routing_number, reference, notes, beneficiary_name, beneficiary_country, beneficiary_region, beneficiary_account_number, beneficiary_address_line_1, beneficiary_address_line_2, beneficiary_city, beneficiary_postal_code, properties |
anti_phishing_code |
scalar |
GraphQL Operation
mutation update_user($email: String, $language: String, $primary_market_currency: String, $timezone: String, $favorite_instruments: [String!], $favorite_addresses_crypto: [FavoriteAddressCryptoItem!], $favorite_fiat_destinations: [FavoriteFiatDestinationItem!], $notifications_options: NotificationOptionsArgs, $default_timezone: ToggleSwitch, $client_custom_properties: [ClientCustomPropertyItem!]) {
update_user(email: $email, language: $language, primary_market_currency: $primary_market_currency, timezone: $timezone, favorite_instruments: $favorite_instruments, favorite_addresses_crypto: $favorite_addresses_crypto, favorite_fiat_destinations: $favorite_fiat_destinations, notifications_options: $notifications_options, default_timezone: $default_timezone, client_custom_properties: $client_custom_properties) {
username
user_id
parent_user_id
email
language
timezone
primary_market_currency
profile_pic_url
created_at
updated_at
favorite_instruments
mfa_status
default_timezone
crypto_pay
fee_group_id
is_referral_claim_available
client_custom_properties {
property
value
}
kyc_data {
kyc_property
kyc_value
}
favorite_addresses_crypto {
currency_id
address
address_tag_type
address_tag_value
name
network
psp_service_id
network_name
}
notifications_options {
client
push
email
sms
}
favorite_fiat_destinations {
name
bank_name
bank_country
bank_region
bank_city
bank_address
bank_postal_code
bank_bic
routing_number
reference
notes
beneficiary_name
beneficiary_country
beneficiary_region
beneficiary_account_number
beneficiary_address_line_1
beneficiary_address_line_2
beneficiary_city
beneficiary_postal_code
properties {
name
value
}
}
anti_phishing_code
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation update_user($email: String, $language: String, $primary_market_currency: String, $timezone: String, $favorite_instruments: [String!], $favorite_addresses_crypto: [FavoriteAddressCryptoItem!], $favorite_fiat_destinations: [FavoriteFiatDestinationItem!], $notifications_options: NotificationOptionsArgs, $default_timezone: ToggleSwitch, $client_custom_properties: [ClientCustomPropertyItem!]) { update_user(email: $email, language: $language, primary_market_currency: $primary_market_currency, timezone: $timezone, favorite_instruments: $favorite_instruments, favorite_addresses_crypto: $favorite_addresses_crypto, favorite_fiat_destinations: $favorite_fiat_destinations, notifications_options: $notifications_options, default_timezone: $default_timezone, client_custom_properties: $client_custom_properties) { username user_id parent_user_id email language timezone primary_market_currency profile_pic_url created_at updated_at favorite_instruments mfa_status default_timezone crypto_pay fee_group_id is_referral_claim_available client_custom_properties { property value } kyc_data { kyc_property kyc_value } favorite_addresses_crypto { currency_id address address_tag_type address_tag_value name network psp_service_id network_name } notifications_options { client push email sms } favorite_fiat_destinations { name bank_name bank_country bank_region bank_city bank_address bank_postal_code bank_bic routing_number reference notes beneficiary_name beneficiary_country beneficiary_region beneficiary_account_number beneficiary_address_line_1 beneficiary_address_line_2 beneficiary_city beneficiary_postal_code properties { name value } } anti_phishing_code } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation update_user($email: String, $language: String, $primary_market_currency: String, $timezone: String, $favorite_instruments: [String!], $favorite_addresses_crypto: [FavoriteAddressCryptoItem!], $favorite_fiat_destinations: [FavoriteFiatDestinationItem!], $notifications_options: NotificationOptionsArgs, $default_timezone: ToggleSwitch, $client_custom_properties: [ClientCustomPropertyItem!]) { update_user(email: $email, language: $language, primary_market_currency: $primary_market_currency, timezone: $timezone, favorite_instruments: $favorite_instruments, favorite_addresses_crypto: $favorite_addresses_crypto, favorite_fiat_destinations: $favorite_fiat_destinations, notifications_options: $notifications_options, default_timezone: $default_timezone, client_custom_properties: $client_custom_properties) { username user_id parent_user_id email language timezone primary_market_currency profile_pic_url created_at updated_at favorite_instruments mfa_status default_timezone crypto_pay fee_group_id is_referral_claim_available client_custom_properties { property value } kyc_data { kyc_property kyc_value } favorite_addresses_crypto { currency_id address address_tag_type address_tag_value name network psp_service_id network_name } notifications_options { client push email sms } favorite_fiat_destinations { name bank_name bank_country bank_region bank_city bank_address bank_postal_code bank_bic routing_number reference notes beneficiary_name beneficiary_country beneficiary_region beneficiary_account_number beneficiary_address_line_1 beneficiary_address_line_2 beneficiary_city beneficiary_postal_code properties { name value } } anti_phishing_code } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation update_user($email: String, $language: String, $primary_market_currency: String, $timezone: String, $favorite_instruments: [String!], $favorite_addresses_crypto: [FavoriteAddressCryptoItem!], $favorite_fiat_destinations: [FavoriteFiatDestinationItem!], $notifications_options: NotificationOptionsArgs, $default_timezone: ToggleSwitch, $client_custom_properties: [ClientCustomPropertyItem!]) { update_user(email: $email, language: $language, primary_market_currency: $primary_market_currency, timezone: $timezone, favorite_instruments: $favorite_instruments, favorite_addresses_crypto: $favorite_addresses_crypto, favorite_fiat_destinations: $favorite_fiat_destinations, notifications_options: $notifications_options, default_timezone: $default_timezone, client_custom_properties: $client_custom_properties) { username user_id parent_user_id email language timezone primary_market_currency profile_pic_url created_at updated_at favorite_instruments mfa_status default_timezone crypto_pay fee_group_id is_referral_claim_available client_custom_properties { property value } kyc_data { kyc_property kyc_value } favorite_addresses_crypto { currency_id address address_tag_type address_tag_value name network psp_service_id network_name } notifications_options { client push email sms } favorite_fiat_destinations { name bank_name bank_country bank_region bank_city bank_address bank_postal_code bank_bic routing_number reference notes beneficiary_name beneficiary_country beneficiary_region beneficiary_account_number beneficiary_address_line_1 beneficiary_address_line_2 beneficiary_city beneficiary_postal_code properties { name value } } anti_phishing_code } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation
update_user_mfa_status
Turns the caller's MFA on or off after verifying a current authenticator code. Turning on needs the secret from create_user_mfa_secret; turning off uses the stored secret.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
status |
ToggleSwitch |
required | on to enable MFA, off to disable. |
secret |
String |
optional | Required when switching MFA on; when switching off the saved secret is used. |
token |
String |
required | Current authenticator code. |
Response
GraphQL Operation
mutation update_user_mfa_status($status: ToggleSwitch!, $secret: String, $token: String!) {
update_user_mfa_status(status: $status, secret: $secret, token: $token)
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation update_user_mfa_status($status: ToggleSwitch!, $secret: String, $token: String!) { update_user_mfa_status(status: $status, secret: $secret, token: $token) }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation update_user_mfa_status($status: ToggleSwitch!, $secret: String, $token: String!) { update_user_mfa_status(status: $status, secret: $secret, token: $token) }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation update_user_mfa_status($status: ToggleSwitch!, $secret: String, $token: String!) { update_user_mfa_status(status: $status, secret: $secret, token: $token) }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation
upload_trading_view_template
Creates a chart template record for the caller and returns its template_id and a pre-signed PUT upload_url for the JSON content. Fails when the per-type template limit is reached.
upload_user_document.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
template_name |
String |
required | Template name. |
template_type |
SpotMargin |
required | spot or margin; the template limit applies per type. |
instrument_id |
String |
required | Instrument the template belongs to. |
periodicity |
InstrumentHistoryPeriodicity |
optional | Chart periodicity to store with the template. |
Response
| Field | Sub-fields |
|---|---|
template_id |
scalar |
upload_url |
scalar |
GraphQL Operation
mutation upload_trading_view_template($template_name: String!, $template_type: SpotMargin!, $instrument_id: String!, $periodicity: InstrumentHistoryPeriodicity) {
upload_trading_view_template(template_name: $template_name, template_type: $template_type, instrument_id: $instrument_id, periodicity: $periodicity) {
template_id
upload_url
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation upload_trading_view_template($template_name: String!, $template_type: SpotMargin!, $instrument_id: String!, $periodicity: InstrumentHistoryPeriodicity) { upload_trading_view_template(template_name: $template_name, template_type: $template_type, instrument_id: $instrument_id, periodicity: $periodicity) { template_id upload_url } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation upload_trading_view_template($template_name: String!, $template_type: SpotMargin!, $instrument_id: String!, $periodicity: InstrumentHistoryPeriodicity) { upload_trading_view_template(template_name: $template_name, template_type: $template_type, instrument_id: $instrument_id, periodicity: $periodicity) { template_id upload_url } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation upload_trading_view_template($template_name: String!, $template_type: SpotMargin!, $instrument_id: String!, $periodicity: InstrumentHistoryPeriodicity) { upload_trading_view_template(template_name: $template_name, template_type: $template_type, instrument_id: $instrument_id, periodicity: $periodicity) { template_id upload_url } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query user The caller's user profile. Admins must pass user_id.
Inputs
Response
| Field | Sub-fields | |
|---|---|---|
mfa_status |
scalar | Response field: whether MFA is on. |
username |
scalar | Response field: username, or email when no username is set. |
user_id |
scalar | Admin only; required for admins, ignored for traders. The only argument; other rows are response fields. |
parent_user_id |
scalar | Response field: ID of the parent user, if any. |
email |
scalar | Response field: email address. |
language |
scalar | Response field: preferred language. |
timezone |
scalar | Response field: timezone. |
primary_market_currency |
scalar | Response field: display currency for valuations. |
profile_pic_url |
scalar | Response field: pre-signed URL of the profile picture upload. |
created_at |
scalar | Response field: account creation time. |
updated_at |
scalar | Response field: last update time. |
favorite_instruments |
scalar | Response field: favourite instrument IDs. |
default_timezone |
scalar | Response field: default-timezone toggle. |
crypto_pay |
scalar | Response field: Crypto Pay toggle for the user. |
fee_group_id |
scalar | Response field: assigned fee group ID. |
is_referral_claim_available |
scalar | Response field: true while still within the referral-claim window after registration. |
client_custom_properties |
property, value | Response field: custom property/value pairs. |
kyc_data |
kyc_property, kyc_value | Response field: KYC entries; restricted to non-sensitive fields unless viewing self or admin with kyc_user_data. |
favorite_addresses_crypto |
currency_id, address, address_tag_type, address_tag_value, name, network, psp_service_id, network_name | Response field: saved crypto withdrawal addresses. |
notifications_options |
client, push, email, sms | Response field: enabled notification triggers per channel. |
favorite_fiat_destinations |
name, bank_name, bank_country, bank_region, bank_city, bank_address, bank_postal_code, bank_bic, routing_number, reference, notes, beneficiary_name, beneficiary_country, beneficiary_region, beneficiary_account_number, beneficiary_address_line_1, beneficiary_address_line_2, beneficiary_city, beneficiary_postal_code, properties | Response field: saved fiat withdrawal destinations. |
anti_phishing_code |
scalar | Response field: masked anti-phishing code; null for non-traders. |
proof_of_residence_url |
scalar | Response field: pre-signed URL of the proof-of-residence upload. |
proof_of_id_front_url |
scalar | Response field: pre-signed URL of the ID front upload. |
company_registration_url |
scalar | Response field: pre-signed URL of the company registration upload. |
memorandum_of_association_url |
scalar | Response field: pre-signed URL of the memorandum of association upload. |
limit_group |
aggregated_payment_limit, payment_limits, disabled_instruments, disabled_currencies | Response field: assigned limit group. |
GraphQL Operation
query user {
user {
mfa_status
username
user_id
parent_user_id
email
language
timezone
primary_market_currency
profile_pic_url
created_at
updated_at
favorite_instruments
default_timezone
crypto_pay
fee_group_id
is_referral_claim_available
client_custom_properties {
property
value
}
kyc_data {
kyc_property
kyc_value
}
favorite_addresses_crypto {
currency_id
address
address_tag_type
address_tag_value
name
network
psp_service_id
network_name
}
notifications_options {
client
push
email
sms
}
favorite_fiat_destinations {
name
bank_name
bank_country
bank_region
bank_city
bank_address
bank_postal_code
bank_bic
routing_number
reference
notes
beneficiary_name
beneficiary_country
beneficiary_region
beneficiary_account_number
beneficiary_address_line_1
beneficiary_address_line_2
beneficiary_city
beneficiary_postal_code
properties {
name
value
}
}
anti_phishing_code
proof_of_residence_url
proof_of_id_front_url
company_registration_url
memorandum_of_association_url
limit_group {
aggregated_payment_limit {
auto_reject
is_active
}
payment_limits {
currency_id
deposit_enabled
deposit_min_amount
withdrawal_enabled
withdrawal_min_amount
notion_currency
}
disabled_instruments
disabled_currencies
}
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query user { user { mfa_status username user_id parent_user_id email language timezone primary_market_currency profile_pic_url created_at updated_at favorite_instruments default_timezone crypto_pay fee_group_id is_referral_claim_available client_custom_properties { property value } kyc_data { kyc_property kyc_value } favorite_addresses_crypto { currency_id address address_tag_type address_tag_value name network psp_service_id network_name } notifications_options { client push email sms } favorite_fiat_destinations { name bank_name bank_country bank_region bank_city bank_address bank_postal_code bank_bic routing_number reference notes beneficiary_name beneficiary_country beneficiary_region beneficiary_account_number beneficiary_address_line_1 beneficiary_address_line_2 beneficiary_city beneficiary_postal_code properties { name value } } anti_phishing_code proof_of_residence_url proof_of_id_front_url company_registration_url memorandum_of_association_url limit_group { aggregated_payment_limit { auto_reject is_active } payment_limits { currency_id deposit_enabled deposit_min_amount withdrawal_enabled withdrawal_min_amount notion_currency } disabled_instruments disabled_currencies } } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query user { user { mfa_status username user_id parent_user_id email language timezone primary_market_currency profile_pic_url created_at updated_at favorite_instruments default_timezone crypto_pay fee_group_id is_referral_claim_available client_custom_properties { property value } kyc_data { kyc_property kyc_value } favorite_addresses_crypto { currency_id address address_tag_type address_tag_value name network psp_service_id network_name } notifications_options { client push email sms } favorite_fiat_destinations { name bank_name bank_country bank_region bank_city bank_address bank_postal_code bank_bic routing_number reference notes beneficiary_name beneficiary_country beneficiary_region beneficiary_account_number beneficiary_address_line_1 beneficiary_address_line_2 beneficiary_city beneficiary_postal_code properties { name value } } anti_phishing_code proof_of_residence_url proof_of_id_front_url company_registration_url memorandum_of_association_url limit_group { aggregated_payment_limit { auto_reject is_active } payment_limits { currency_id deposit_enabled deposit_min_amount withdrawal_enabled withdrawal_min_amount notion_currency } disabled_instruments disabled_currencies } } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query user { user { mfa_status username user_id parent_user_id email language timezone primary_market_currency profile_pic_url created_at updated_at favorite_instruments default_timezone crypto_pay fee_group_id is_referral_claim_available client_custom_properties { property value } kyc_data { kyc_property kyc_value } favorite_addresses_crypto { currency_id address address_tag_type address_tag_value name network psp_service_id network_name } notifications_options { client push email sms } favorite_fiat_destinations { name bank_name bank_country bank_region bank_city bank_address bank_postal_code bank_bic routing_number reference notes beneficiary_name beneficiary_country beneficiary_region beneficiary_account_number beneficiary_address_line_1 beneficiary_address_line_2 beneficiary_city beneficiary_postal_code properties { name value } } anti_phishing_code proof_of_residence_url proof_of_id_front_url company_registration_url memorandum_of_association_url limit_group { aggregated_payment_limit { auto_reject is_active } payment_limits { currency_id deposit_enabled deposit_min_amount withdrawal_enabled withdrawal_min_amount notion_currency } disabled_instruments disabled_currencies } } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
This operation takes no inputs.
mutation verify_user_mfa_token Checks an authenticator code against the caller's enabled MFA and records the result. Returns true if valid, false otherwise; errors if MFA is not enabled.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
token |
String |
required | Current authenticator code. |
Response
GraphQL Operation
mutation verify_user_mfa_token($token: String!) {
verify_user_mfa_token(token: $token)
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation verify_user_mfa_token($token: String!) { verify_user_mfa_token(token: $token) }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation verify_user_mfa_token($token: String!) { verify_user_mfa_token(token: $token) }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation verify_user_mfa_token($token: String!) { verify_user_mfa_token(token: $token) }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
Wallets
5 operations · service: https://vakotrade-demo.cryptosrvc.com/graphql
mutation
create_wallet
Creates a personal sub-wallet for the caller and returns it. If an active wallet with that name exists it is returned; an inactive one is reactivated. Limited by personal_wallets_count_limit. Admins may pass user_id.
create_wallet.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
name |
String |
required | Wallet name; unique per user. |
description |
String |
optional | Optional free-text description. |
type |
WalletType |
optional | Wallet type; defaults to PERSONAL. Traders may only create PERSONAL wallets. |
Response
| Field | Sub-fields |
|---|---|
wallet_id |
scalar |
user_id |
scalar |
name |
scalar |
description |
scalar |
type |
scalar |
created_at |
scalar |
GraphQL Operation
mutation create_wallet($name: String!, $description: String, $type: WalletType) {
create_wallet(name: $name, description: $description, type: $type) {
wallet_id
user_id
name
description
type
created_at
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation create_wallet($name: String!, $description: String, $type: WalletType) { create_wallet(name: $name, description: $description, type: $type) { wallet_id user_id name description type created_at } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation create_wallet($name: String!, $description: String, $type: WalletType) { create_wallet(name: $name, description: $description, type: $type) { wallet_id user_id name description type created_at } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation create_wallet($name: String!, $description: String, $type: WalletType) { create_wallet(name: $name, description: $description, type: $type) { wallet_id user_id name description type created_at } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation
create_wallet_transfer
Moves funds between two of the caller's active wallets and returns the transfer. Use MAIN for the main wallet. Amount is rounded to currency precision and must be positive. Admins may pass user_id.
create_wallet_transfer. Rate-limited (30 req / 60 s, 1000 ms min gap).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
from_wallet_id |
String |
required | Source wallet ID, or MAIN. |
to_wallet_id |
String |
required | Destination wallet ID, or MAIN; must differ from the source. |
currency_id |
String |
required | Currency to transfer. |
amount |
Float |
required | Amount to transfer; rounded to currency precision, must be positive. |
Response
| Field | Sub-fields |
|---|---|
user_id |
scalar |
from_wallet_id |
scalar |
to_wallet_id |
scalar |
currency_id |
scalar |
amount |
scalar |
created_at |
scalar |
GraphQL Operation
mutation create_wallet_transfer($from_wallet_id: String!, $to_wallet_id: String!, $currency_id: String!, $amount: Float!) {
create_wallet_transfer(from_wallet_id: $from_wallet_id, to_wallet_id: $to_wallet_id, currency_id: $currency_id, amount: $amount) {
user_id
from_wallet_id
to_wallet_id
currency_id
amount
created_at
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation create_wallet_transfer($from_wallet_id: String!, $to_wallet_id: String!, $currency_id: String!, $amount: Float!) { create_wallet_transfer(from_wallet_id: $from_wallet_id, to_wallet_id: $to_wallet_id, currency_id: $currency_id, amount: $amount) { user_id from_wallet_id to_wallet_id currency_id amount created_at } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation create_wallet_transfer($from_wallet_id: String!, $to_wallet_id: String!, $currency_id: String!, $amount: Float!) { create_wallet_transfer(from_wallet_id: $from_wallet_id, to_wallet_id: $to_wallet_id, currency_id: $currency_id, amount: $amount) { user_id from_wallet_id to_wallet_id currency_id amount created_at } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation create_wallet_transfer($from_wallet_id: String!, $to_wallet_id: String!, $currency_id: String!, $amount: Float!) { create_wallet_transfer(from_wallet_id: $from_wallet_id, to_wallet_id: $to_wallet_id, currency_id: $currency_id, amount: $amount) { user_id from_wallet_id to_wallet_id currency_id amount created_at } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation
update_wallet
Renames or re-describes one of the caller's active wallets and returns it. Traders can update only PERSONAL wallets; the name MAIN is reserved. Admins may pass user_id.
update_wallet.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
wallet_id |
String |
required | ID of the caller's wallet. |
name |
String |
optional | New name (trimmed); must be unique per user and not MAIN. |
description |
String |
optional | New description (trimmed). |
Response
| Field | Sub-fields |
|---|---|
wallet_id |
scalar |
user_id |
scalar |
name |
scalar |
description |
scalar |
type |
scalar |
created_at |
scalar |
GraphQL Operation
mutation update_wallet($wallet_id: String!, $name: String, $description: String) {
update_wallet(wallet_id: $wallet_id, name: $name, description: $description) {
wallet_id
user_id
name
description
type
created_at
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation update_wallet($wallet_id: String!, $name: String, $description: String) { update_wallet(wallet_id: $wallet_id, name: $name, description: $description) { wallet_id user_id name description type created_at } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation update_wallet($wallet_id: String!, $name: String, $description: String) { update_wallet(wallet_id: $wallet_id, name: $name, description: $description) { wallet_id user_id name description type created_at } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation update_wallet($wallet_id: String!, $name: String, $description: String) { update_wallet(wallet_id: $wallet_id, name: $name, description: $description) { wallet_id user_id name description type created_at } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query wallet_transfers Paginated list of the caller's transfers between own wallets, newest first. Admins may pass user_id.
account_transactions.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
from_wallet_id |
String |
optional | Exact match on source wallet ID. |
to_wallet_id |
String |
optional | Exact match on destination wallet ID. |
currency_id |
String |
optional | Exact match on currency ID. |
pager |
PagerInput |
optional | Pagination: limit (default 30) and offset (default 0). |
dateRange |
DateRangeInput |
optional | Creation-time window: time_from / time_to (inclusive). |
sort |
SortInput |
optional | Sort direction by creation order; default DESC. |
Response
| Field | Sub-fields |
|---|---|
transfer_id |
scalar |
from_wallet_id |
scalar |
to_wallet_id |
scalar |
currency_id |
scalar |
amount |
scalar |
created_at |
scalar |
from_post_balance |
scalar |
to_post_balance |
scalar |
GraphQL Operation
query wallet_transfers($from_wallet_id: String, $to_wallet_id: String, $currency_id: String, $pager: PagerInput, $dateRange: DateRangeInput, $sort: SortInput) {
wallet_transfers(from_wallet_id: $from_wallet_id, to_wallet_id: $to_wallet_id, currency_id: $currency_id, pager: $pager, dateRange: $dateRange, sort: $sort) {
transfer_id
from_wallet_id
to_wallet_id
currency_id
amount
created_at
from_post_balance
to_post_balance
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query wallet_transfers($from_wallet_id: String, $to_wallet_id: String, $currency_id: String, $pager: PagerInput, $dateRange: DateRangeInput, $sort: SortInput) { wallet_transfers(from_wallet_id: $from_wallet_id, to_wallet_id: $to_wallet_id, currency_id: $currency_id, pager: $pager, dateRange: $dateRange, sort: $sort) { transfer_id from_wallet_id to_wallet_id currency_id amount created_at from_post_balance to_post_balance } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query wallet_transfers($from_wallet_id: String, $to_wallet_id: String, $currency_id: String, $pager: PagerInput, $dateRange: DateRangeInput, $sort: SortInput) { wallet_transfers(from_wallet_id: $from_wallet_id, to_wallet_id: $to_wallet_id, currency_id: $currency_id, pager: $pager, dateRange: $dateRange, sort: $sort) { transfer_id from_wallet_id to_wallet_id currency_id amount created_at from_post_balance to_post_balance } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query wallet_transfers($from_wallet_id: String, $to_wallet_id: String, $currency_id: String, $pager: PagerInput, $dateRange: DateRangeInput, $sort: SortInput) { wallet_transfers(from_wallet_id: $from_wallet_id, to_wallet_id: $to_wallet_id, currency_id: $currency_id, pager: $pager, dateRange: $dateRange, sort: $sort) { transfer_id from_wallet_id to_wallet_id currency_id amount created_at from_post_balance to_post_balance } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query
wallets
The caller's wallets: a synthetic MAIN wallet (included when listing active wallets) plus paginated sub-wallets, and the personal-wallet limit. Without is_active, only active wallets are returned. Admins may pass user_id.
wallets.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
wallet_id |
String |
optional | Exact match on wallet ID (does not filter out MAIN). |
name |
String |
optional | Exact match on wallet name. |
description |
String |
optional | Substring match on description. |
is_active |
String |
optional | Active (on, default) or deactivated (off) wallets. |
type |
String |
optional | Exact match on wallet type. |
pager |
PagerInput |
optional | Pagination: limit (default 30) and offset (default 0). |
sort |
SortInput |
optional | Sort property (default serial_id) and direction (default DESC). |
dateRange |
DateRangeInput |
optional | Creation-time window: time_from / time_to (inclusive). |
Response
| Field | Sub-fields |
|---|---|
wallets |
wallet_id, user_id, name, description, is_active, type, created_at |
personal_wallets_limit |
scalar |
GraphQL Operation
query wallets($wallet_id: String, $name: String, $description: String, $is_active: String, $type: String, $pager: PagerInput, $sort: SortInput, $dateRange: DateRangeInput) {
wallets(wallet_id: $wallet_id, name: $name, description: $description, is_active: $is_active, type: $type, pager: $pager, sort: $sort, dateRange: $dateRange) {
wallets {
wallet_id
user_id
name
description
is_active
type
created_at
}
personal_wallets_limit
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query wallets($wallet_id: String, $name: String, $description: String, $is_active: String, $type: String, $pager: PagerInput, $sort: SortInput, $dateRange: DateRangeInput) { wallets(wallet_id: $wallet_id, name: $name, description: $description, is_active: $is_active, type: $type, pager: $pager, sort: $sort, dateRange: $dateRange) { wallets { wallet_id user_id name description is_active type created_at } personal_wallets_limit } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query wallets($wallet_id: String, $name: String, $description: String, $is_active: String, $type: String, $pager: PagerInput, $sort: SortInput, $dateRange: DateRangeInput) { wallets(wallet_id: $wallet_id, name: $name, description: $description, is_active: $is_active, type: $type, pager: $pager, sort: $sort, dateRange: $dateRange) { wallets { wallet_id user_id name description is_active type created_at } personal_wallets_limit } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query wallets($wallet_id: String, $name: String, $description: String, $is_active: String, $type: String, $pager: PagerInput, $sort: SortInput, $dateRange: DateRangeInput) { wallets(wallet_id: $wallet_id, name: $name, description: $description, is_active: $is_active, type: $type, pager: $pager, sort: $sort, dateRange: $dateRange) { wallets { wallet_id user_id name description is_active type created_at } personal_wallets_limit } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
Trade
31 operations across 9 areas · service: https://vakotrade-demo.cryptosrvc.com/graphql
Conversion
3 ops
query conversions The caller's conversion history, ordered by serial_id (newest first by default). With no dateRange a server-configured default window ending now applies; wider ranges than the configured maximum are rejected. Admins may pass user_id.
conversions. Rate-limited (120 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
search |
String |
optional | Free text: exact conversion/quote/user ID, reference or source/target currency; instrument_id prefix; email pattern. |
pager |
PagerInput |
optional | Pagination (limit, offset); default limit 30. |
dateRange |
DateRangeInput |
optional | Filters created_at (time_from/time_to). Defaults to a server-configured window; maximum span enforced. |
wallet_id |
String |
required | Only conversions in this wallet; MAIN also matches conversions with no wallet assignment. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
mutation
create_conversion_order
Executes a conversion against a quote previously obtained with create_conversion_quote (its whole remaining amount unless a partial amount is given). By default waits up to 30 s for the conversion to leave new status. Admins may pass user_id.
create_conversion_order. Rate-limited (120 req / 60 s). HMAC signature required when the API key has it enabled.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
conversion_quote_id |
String |
required | ID of the caller's unexpired conversion quote. |
wallet_id |
String |
required | Wallet the conversion settles in; defaults to MAIN. Traders must be allowed to use it. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
mutation
create_conversion_quote
Prices a conversion between two currencies and stores a quote valid for ttl seconds, to be executed with create_conversion_order. With dry_run: on the quote is priced but not stored.
create_conversion_quote. Rate-limited (120 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
source_currency_id |
String |
required | Currency to sell (upper-cased). |
target_currency_id |
String |
required | Currency to receive (upper-cased). |
target_currency_amount |
Float |
optional | Amount to receive. Provide exactly one of source/target amount. |
source_currency_amount |
Float |
optional | Amount to spend. Provide exactly one of source/target amount. |
ttl |
Int |
optional | Quote lifetime in seconds; defaults to, and may not exceed, the instrument's max quote TTL. Over 60 s, the price is widened by recent price movement. |
dry_run |
ToggleSwitch |
optional | on returns a priced quote without storing it (it cannot be executed). Default off. |
instrument_id |
String |
optional | Price only on this instrument; otherwise an active, unrestricted instrument for the currency pair is used. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
Currencies
1 op
query
currencies
List of currencies, newest first. Anonymous callers see currencies not disabled for the default limit group; traders see only currencies available to them. Without page, all matches are returned.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
limit |
Int |
required | Page size; applied only together with page. Default 100. |
store_mode |
ToggleSwitch |
optional | Admins only: on returns every currency unfiltered. Default off. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
Currency Prices
2 ops
query
currency_prices
Current price of each base currency in the quote currency, from the cached price table (local, then oracle, then analytics source; reversed pairs are inverted). Same arguments as the currency_prices subscription.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
base_currencies |
[String!] |
required | Currencies to price; any without an available price are left out of the result. |
quote_currency |
String |
required | Currency the prices are expressed in. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
subscription
currency_prices
Streams prices of the given base currencies in the quote currency. Emits on every server publish cycle (interval set by platform settings); use the currency_prices query for a one-off snapshot.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
base_currencies |
[String!] |
required | Currencies to price; any without an available price are left out of each emit. |
quote_currency |
String |
required | Currency the prices are expressed in. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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://, graphql-ws protocol). Try It opens a WebSocket to this operation's endpoint and streams updates below; click Stop to end it.
Deposit Withdraw
4 ops
mutation
create_withdrawal_crypto
Withdraws crypto to an external address via an active payment route. The payment is created as new with approval pending and queued for auto-approval. Admins may pass user_id.
create_withdrawal_crypto. Rate-limited (30 req / 60 s). Requires KYC approval (unless the platform allows payments without KYC); blocked while withdrawals are frozen; HMAC signature required when the API key has it enabled.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
crypto_address |
String |
required | Destination address; validated against the route's network. |
amount |
Float |
required | Amount to withdraw; decimals may not exceed the currency precision. |
crypto_address_tag_type |
CryptoAddressTagType |
optional | Tag/memo type; required when crypto_address_tag_value is sent. |
crypto_network_fee_preference |
CryptoNetworkFeePreference |
optional | Network fee level used for the fee calculation. Default medium. |
crypto_address_tag_value |
String |
optional | Tag/memo value for networks that need one. |
mfa_token |
String |
optional | Verification code when the route or user requires one; not checked for API-key tokens. |
payment_route_id |
String |
required | Active payment route to use; if omitted, resolved from currency_id (and network/PSP). |
fees_included |
ToggleSwitch |
optional | on (default): the fee is deducted from amount. |
comment |
String |
optional | Free-text comment stored on the payment. |
travel_rule_properties |
TravelRulePropertiesArgs |
optional | Travel-rule counterparty data; recorded only when the travel rule is enabled on the platform. |
vasp_id |
String |
optional | Counterparty VASP ID added to the travel-rule record. |
wallet_id |
String |
optional | Source wallet. Default MAIN. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
mutation
create_withdrawal_fiat
Withdraws fiat to a bank account via an active payment route. The payment is created as new with approval pending and queued for auto-approval. Admins may pass user_id; it is ignored for traders.
create_withdrawal_fiat. Rate-limited (30 req / 60 s). Requires KYC approval (unless the platform allows payments without KYC); blocked while withdrawals are frozen; HMAC signature required when the API key has it enabled.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
amount |
Float |
required | Amount to withdraw. |
mfa_token |
String |
optional | Verification code when the route or user requires one; not checked for API-key tokens. |
properties |
[FiatDepositPropertyInput!] |
required | Name/value pairs (e.g. bank details) stored on the payment; empty values are skipped. Default []. |
payment_route_id |
String |
required | Active payment route to use; if omitted, resolved from currency_id (and transfer type/PSP). |
wallet_id |
String |
optional | Source wallet. Default MAIN. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
query deposit_address_crypto The caller's crypto deposit address for a currency/route: reuses the latest existing address, otherwise requests a new one from the PSP and waits up to ~20 s for it. Admins may pass user_id.
deposit_addresses_crypto. Rate-limited (10 req / 60 s, 3000 ms min gap). Requires KYC approval (unless the platform allows payments without KYC).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
currency_id |
String |
required | Crypto currency ID; non-crypto currencies are rejected. |
reference |
String |
optional | Optional reference; matched when reusing an address and stored on a newly created one. |
payment_route_id |
String |
required | Active route for this currency, whose network is used; if omitted, resolved from currency (and network/PSP). |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
query payments_routes Paginated list of payment routes (deposit/withdrawal methods), newest first. For traders, routes disabled by their limit group are excluded.
payments_routes. Rate-limited (60 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
payment_route_id |
String |
required | Exact payment route ID. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
Instruments
4 ops
subscription instrument_price Streams live price updates (bid/ask, 24h change, volume, depth VWAPs) for one instrument, or for all instruments when instrument_id is omitted. Only instruments in the platform's instrument list are emitted.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
instrument_id |
String |
optional | Instrument to stream; omit for all instruments. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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://, graphql-ws protocol). Try It opens a WebSocket to this operation's endpoint and streams updates below; click Stop to end it.
subscription
instrument_price_bar
Streams OHLCV price bars for one instrument at the given periodicity as they are published; pair with the instrument_price_bars query for history.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
instrument_id |
String |
required | Instrument to stream. |
periodicity |
InstrumentHistoryPeriodicity |
required | Bar interval (InstrumentHistoryPeriodicity). |
Response
| Field | Sub-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-demo.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-demo.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-demo.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://, graphql-ws protocol). Try It opens a WebSocket to this operation's endpoint and streams updates below; click Stop to end it.
query instrument_price_bars Historical OHLCV bars for an instrument, newest first. Without date_range it covers the last 100 bar intervals up to now; an unknown instrument returns an empty list.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
instrument_id |
String |
required | Instrument ID (exact). |
limit |
String |
optional | Maximum number of bars returned. Default 24. |
date_range |
DateRangeInput |
optional | Bar time window; time_to is capped at now, time_from defaults to 100 intervals before time_to. |
periodicity |
InstrumentHistoryPeriodicity |
optional | Bar interval. Default day. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
query instruments List of instruments, newest first. Anonymous callers see active, non-development instruments not disabled for the default limit group; traders see only active instruments available to their limit group.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
is_active |
ToggleSwitch |
optional | Filter by active flag (on/off). |
instrument_id |
String |
optional | Exact match; when set, only that instrument is returned and all other filters and visibility rules are skipped. |
search |
String |
optional | Case-insensitive substring of instrument ID + name, or exact match of a configured search alias. |
page |
Int |
optional | 1-based page number; limit is the page size. |
limit |
Int |
optional | Maximum results (page size when page is set). Default 100. |
sort |
SortInput |
optional | Sort by property and direction; applied only when both are given. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
Orders
9 ops
subscription all_orders Streams order updates. Traders receive only their own orders; admins receive orders of all users. Optionally limited to the listed instruments.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
instruments |
[String!] |
optional | Only emit orders for these instrument IDs; omit for all instruments. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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://, graphql-ws protocol). Try It opens a WebSocket to this operation's endpoint and streams updates below; click Stop to end it.
mutation cancel_all_orders Cancels all of the caller's open orders, optionally only those in one wallet. Orders are marked cancelled immediately and closed asynchronously; returns false on an internal error. Admins must pass user_id.
cancel_order. Rate-limited (60 req / 60 s, 1000 ms min gap).Inputs
Response
GraphQL Operation
mutation cancel_all_orders {
cancel_all_orders
}
Code Examples
curl -X POST 'https://vakotrade-demo.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-demo.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-demo.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
This operation takes no inputs.
mutation cancel_order Cancels one open order. The order is marked cancelled and closed asynchronously; returns true even if it could no longer be cancelled. Traders can cancel only their own orders.
cancel_order. Rate-limited (600 req / 60 s, 100 ms min gap).Inputs
| Name | Type | Required | Description | |
|---|---|---|---|---|
order_id |
String |
required | Not accepted by this mutation in code: its only arguments are user_id (admin only) and wallet_id (limit to one wallet; MAIN for the main wallet). |
ID of an open order; IDs not found among open orders fail with ORDER_NOT_FOUND. |
Response
GraphQL Operation
mutation cancel_order($order_id: String!) {
cancel_order(order_id: $order_id)
}
Code Examples
curl -X POST 'https://vakotrade-demo.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-demo.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-demo.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
query closed_orders The caller's closed orders, filterable by instrument, status, side, parent order, wallet and date. With no dateRange a server-configured default window ending now applies; wider ranges than the configured maximum are rejected. Admins may pass user_id.
closed_orders. Rate-limited (60 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
instrument_id |
String |
optional | Exact instrument ID. |
status |
[OrderStatus!] |
optional | Order statuses to include (any of). |
side |
OrderSide |
optional | buy or sell. |
pager |
PagerInput |
optional | Pagination (limit, offset); without it a server-configured page size applies. |
dateRange |
DateRangeInput |
optional | Time window (time_from/time_to). Defaults to a server-configured window; maximum span enforced. |
parent_order_id |
String |
optional | Only orders with this parent order ID (e.g. orders spawned by a stop order). |
wallet_id |
String |
required | Only orders in this wallet; MAIN also matches orders with no wallet assignment. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
mutation create_order Places a spot order. The order is validated and returned once accepted; matching happens asynchronously, and stop orders wait for their trigger. Admins may pass user_id.
create_order. Rate-limited (600 req / 60 s, 100 ms min gap). HMAC signature required when the API key has it enabled.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
instrument_id |
String |
required | Instrument to trade; development-mode instruments are rejected for traders. |
type |
OrderType |
required | limit, market, stop_market or stop_limit. |
price |
Float |
optional | Limit price; required for limit orders and checked against the instrument's price collar. |
stop_price |
Float |
optional | Trigger price; required for stop_market and stop_limit orders. |
side |
OrderSide |
required | buy or sell. |
time_in_force |
OrderTimeInForce |
required | gtc, gtd, ioc or fok. |
quantity |
Float |
required | Positive order size, in base or quote units according to quantity_mode. |
expires_at |
String |
optional | Expiry date-time; required for gtd and must be more than 5 s in the future. |
quantity_mode |
OrderQuantityMode |
optional | base (default) or quote: the unit of quantity. |
post_only |
ToggleSwitch |
optional | Post-only flag for limit orders (carried to stop orders for when they trigger); ignored for market orders. Cannot be combined with notes on stop orders. |
wallet_id |
String |
required | Wallet to trade from. Default MAIN. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
query estimate_order Pre-trade estimate (instrument, side, quantity, price, fees) for converting between two currencies with an order. Nothing is placed. Without price, a market order at the current bid/ask is estimated. Admins must pass user_id.
estimate_order.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
source_currency_id |
String |
required | Currency to spend. |
target_currency_id |
String |
required | Currency to receive. |
price |
Float |
optional | Limit price; if omitted, a market order at the cached bid/ask is estimated. |
target_currency_amount |
Float |
optional | Amount to receive. Provide exactly one of source/target amount. |
source_currency_amount |
Float |
optional | Amount to spend. Provide exactly one of source/target amount. |
instrument_id |
String |
optional | Instrument to use; otherwise the first active instrument for the pair not disabled for the caller's limit group. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
query open_orders The caller's open orders, filterable by instrument, status, side, parent order, wallet and date. No default date window is applied. Admins may pass user_id.
open_orders. Rate-limited (120 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
instrument_id |
String |
optional | Exact instrument ID. |
status |
[OrderStatus!] |
optional | Order statuses to include (any of). |
side |
OrderSide |
optional | buy or sell. |
pager |
PagerInput |
optional | Pagination (limit, offset); default limit 30. |
dateRange |
DateRangeInput |
optional | Filters created_at (time_from/time_to); no default window. |
parent_order_id |
String |
optional | Only orders with this parent order ID (e.g. orders spawned by a stop order). |
wallet_id |
String |
required | Only orders in this wallet; MAIN also matches orders with no wallet assignment. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
subscription orderbook Streams order book updates (buy and sell levels, best bid/ask, total volume) for one instrument as the platform publishes them.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
instrument_id |
String |
required | Instrument whose order book to stream. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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://, graphql-ws protocol). Try It opens a WebSocket to this operation's endpoint and streams updates below; click Stop to end it.
mutation
update_open_order
Amends an open limit, stop_limit or stop_market order (quantity, price, stop price, GTD expiry) after checking the available balance. Pushes the updated order on user_update. Admins must pass user_id.
create_order. Rate-limited (600 req / 60 s, 100 ms min gap).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
order_id |
String |
required | ID of the caller's open order. |
quantity |
Float |
required | New total quantity; must exceed the already executed quantity. |
price |
Float |
required | New limit price; required for limit orders, not allowed for stop_market. |
expires_at |
String |
optional | New expiry; applied only to gtd orders. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
Payments
3 ops
mutation create_payment_session Opens a hosted deposit/withdrawal session for a payment route and returns its ID. For PSPs that need one (Transfero, FVBank, C14, Rapyd, Ecommpay) it waits up to 15 s for the PSP's session ID; for other routes it returns a temporary session key.
payments. Rate-limited (15 req / 60 s, 5000 ms min gap). Requires approved KYC.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
payment_route_id |
String |
required | Payment route to open the session for. |
payment_type |
PaymentType |
required | deposit or withdrawal; for session-based PSPs the route must have the matching iframe URL configured. |
Response
GraphQL Operation
mutation create_payment_session($payment_route_id: String!, $payment_type: PaymentType!) {
create_payment_session(payment_route_id: $payment_route_id, payment_type: $payment_type)
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation create_payment_session($payment_route_id: String!, $payment_type: PaymentType!) { create_payment_session(payment_route_id: $payment_route_id, payment_type: $payment_type) }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation create_payment_session($payment_route_id: String!, $payment_type: PaymentType!) { create_payment_session(payment_route_id: $payment_route_id, payment_type: $payment_type) }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation create_payment_session($payment_route_id: String!, $payment_type: PaymentType!) { create_payment_session(payment_route_id: $payment_route_id, payment_type: $payment_type) }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation estimate_payment_fee Calculates the fee for a prospective deposit or withdrawal of the given amount on a payment route, using the caller's fee group. A mutation that only reads; nothing is created.
payments_fees. Rate-limited (60 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
user_id |
String |
optional | Admin only (required for admins); ignored for traders. |
payment_route_id |
String |
required | Active payment route; if omitted, resolved from currency_id (and network/PSP). |
type |
PaymentType |
required | deposit or withdrawal. |
amount |
Float |
required | Payment amount the fee is calculated for. |
crypto_network_fee_preference |
CryptoNetworkFeePreference |
optional | Network fee level for crypto routes. Default medium. |
Response
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-demo.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-demo.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-demo.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
query payments The caller's deposit and withdrawal history. With no dateRange a server-configured default window ending now applies; wider ranges than the configured maximum are rejected. Admins may pass user_id.
payments. Rate-limited (60 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
type |
PaymentType |
optional | deposit or withdrawal. |
currency_id |
String |
optional | Exact currency ID. |
dateRange |
DateRangeInput |
optional | Time window (time_from/time_to). Defaults to a server-configured window; maximum span enforced. |
pager |
PagerInput |
optional | Pagination (limit, offset); without a limit a server-configured page size applies. |
approval_status |
[PaymentApprovalStatus!] |
optional | Approval statuses to include (any of). |
status |
[PaymentStatus!] |
optional | Payment statuses to include (any of). |
wallet_id |
String |
optional | Only payments in this wallet; MAIN also matches payments with no wallet assignment. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
Trade
4 ops
query account_transactions The caller's ledger entries (debits and credits on their accounts). With no dateRange a server-configured default window ending now applies; wider ranges than the configured maximum are rejected. Admins may pass user_id.
account_transactions. Rate-limited (60 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
currency_id |
String |
optional | Exact currency ID. |
pager |
PagerInput |
optional | Pagination (limit, offset); default limit 30. |
dateRange |
DateRangeInput |
optional | Filters created_at (time_from/time_to). Defaults to a server-configured window; maximum span enforced. |
wallet_id |
String |
required | Only transactions on accounts of this wallet (exact match). |
type |
AccountTransactionType |
optional | debit or credit. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
query accounts_balances The caller's balances per account/currency. Without wallet_id, balances of all the caller's wallets are returned (internal wallets hidden); currencies disabled by the caller's limit group are excluded. Admins must pass user_id.
accounts_balances. Rate-limited (60 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
wallet_id |
String |
optional | Only balances of this wallet; traders must be allowed to view it. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
query
portfolio_history
Deprecated; use portfolio_history_v2. Portfolio value history as [timestamp, value] pairs from the analytics service, cached for 5 minutes; returns an empty list on error. Traders get their own; admins must pass user_id.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
currency_id |
String |
required | Currency the values are expressed in (e.g. BTC, ETH, USD). |
timestamp |
String |
required | Reference time: YYYY-MM-DD HH:mm:ss, ISO-8601, seconds or milliseconds as a string (normalized to ms). |
interval |
PortfolioHistoryInterval |
required | History interval: minute, hour, day, week, month, year or all. |
Response
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-demo.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-demo.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-demo.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
subscription user_update Streams real-time events for the caller. Each message sets the field for the object that changed: order, account, ledger entry, payment, conversion, notification or healthcheck (also vault and OTC events).
Inputs
Response
| Field | Sub-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 | Payload field (not an argument): one of the caller's orders was created or changed. |
account_transaction |
currency_id, type, amount, post_balance, order_id | Payload field (not an argument): a new ledger entry on the caller's accounts. |
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 | Payload field (not an argument): one of the caller's deposits/withdrawals was created or changed. |
account |
account_id, balance | Payload field (not an argument): an account of the caller changed. |
notification |
title, body, class, code, vars | Payload field (not an argument): a notification for the caller. |
healthcheck |
maintenance_message, maintenance_mode | Payload field (not an argument): a healthcheck message. |
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 | Payload field (not an argument): one of the caller's conversions changed. |
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-demo.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-demo.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-demo.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://, graphql-ws protocol). Try It opens a WebSocket to this operation's endpoint and streams updates below; click Stop to end it.
This operation takes no inputs.
Trading Fees
1 op
query trading_fees Paginated trading fee configurations per instrument and fee group, newest first. Results are not limited to the caller's own fee group.
trading_fees. Rate-limited (30 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
instrument_id |
String |
optional | Exact instrument ID. |
fee_group_id |
String |
optional | Exact fee group ID. |
pager |
PagerInput |
optional | Pagination (limit, offset); default limit 30. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
Settings
8 operations · service: https://vakotrade-demo.cryptosrvc.com/graphql
query
countries
Country list (name, code, phone code), unique by code and sorted by name. Pass search to filter.
Inputs
Response
| Field | Sub-fields | |
|---|---|---|
name |
scalar | Response field: country name. The only argument is search (case-insensitive substring of name or code). |
code |
scalar | Response field: country code. |
phone_code |
scalar | Response field: international dialling code. |
GraphQL Operation
query countries {
countries {
name
code
phone_code
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query countries { countries { name code phone_code } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query countries { countries { name code phone_code } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query countries { countries { name code phone_code } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
This operation takes no inputs.
mutation
create_kyc_user_data
Writes KYC property/value entries for the caller (max 100; values encrypted) and returns the updated entries. Traders cannot set kyc_status/kyc_message; identity data may auto-set status to submitted. Admins may pass user_id.
create_kyc_user_data. Admin calls may need second-admin approval (delayed_mutations).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
kyc_data |
[KycUserDataEntryInput!] |
required | Up to 100 kyc_property/kyc_value pairs; date_of_birth must be 18+; per-property length limits apply. |
user_id |
String |
required | Required by the schema; ignored for traders (own account used). |
Response
| Field | Sub-fields |
|---|---|
user_id |
scalar |
kyc_property |
scalar |
kyc_value |
scalar |
updated_at |
scalar |
GraphQL Operation
mutation create_kyc_user_data($kyc_data: [KycUserDataEntryInput!]!, $user_id: String!) {
create_kyc_user_data(kyc_data: $kyc_data, user_id: $user_id) {
user_id
kyc_property
kyc_value
updated_at
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation create_kyc_user_data($kyc_data: [KycUserDataEntryInput!]!, $user_id: String!) { create_kyc_user_data(kyc_data: $kyc_data, user_id: $user_id) { user_id kyc_property kyc_value updated_at } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation create_kyc_user_data($kyc_data: [KycUserDataEntryInput!]!, $user_id: String!) { create_kyc_user_data(kyc_data: $kyc_data, user_id: $user_id) { user_id kyc_property kyc_value updated_at } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation create_kyc_user_data($kyc_data: [KycUserDataEntryInput!]!, $user_id: String!) { create_kyc_user_data(kyc_data: $kyc_data, user_id: $user_id) { user_id kyc_property kyc_value updated_at } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query notification_settings Notification triggers enabled platform-wide, per channel (client, push, email, sms).
notification_settings.Inputs
Response
| Field | Sub-fields | |
|---|---|---|
client |
scalar | Response field, not an argument (query takes none): triggers enabled for in-app notifications. |
push |
scalar | Response field: triggers enabled for push notifications. |
email |
scalar | Response field: triggers enabled for email. |
sms |
scalar | Response field: triggers enabled for SMS. |
GraphQL Operation
query notification_settings {
notification_settings {
client
push
email
sms
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query notification_settings { notification_settings { client push email sms } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query notification_settings { notification_settings { client push email sms } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query notification_settings { notification_settings { client push email sms } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
This operation takes no inputs.
query products_enabled Product feature toggles (spot, derivatives, vaults, referrals, etc.) for the given client role.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
role |
ClientRole |
required | Client role: admin, trader or mobile. |
Response
GraphQL Operation
query products_enabled($role: ClientRole!) {
products_enabled(role: $role)
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query products_enabled($role: ClientRole!) { products_enabled(role: $role) }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query products_enabled($role: ClientRole!) { products_enabled(role: $role) }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query products_enabled($role: ClientRole!) { products_enabled(role: $role) }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query provinces Provinces/regions of a country, unique by province code and sorted by full name.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
country_code |
String |
required | Exact match on country code. |
Response
| Field | Sub-fields |
|---|---|
country_code |
scalar |
province_code |
scalar |
iso_region |
scalar |
full_name |
scalar |
short_name |
scalar |
Type |
scalar |
GraphQL Operation
query provinces($country_code: String!) {
provinces(country_code: $country_code) {
country_code
province_code
iso_region
full_name
short_name
Type
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query provinces($country_code: String!) { provinces(country_code: $country_code) { country_code province_code iso_region full_name short_name Type } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query provinces($country_code: String!) { provinces(country_code: $country_code) { country_code province_code iso_region full_name short_name Type } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query provinces($country_code: String!) { provinces(country_code: $country_code) { country_code province_code iso_region full_name short_name Type } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation restrictions_check Pre-flight check that the caller can access the platform. Returns true, or errors on maintenance mode, a geo-restricted location or a blacklisted IP.
Inputs
Response
GraphQL Operation
mutation restrictions_check {
restrictions_check
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation restrictions_check { restrictions_check }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation restrictions_check { restrictions_check }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation restrictions_check { restrictions_check }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
This operation takes no inputs.
mutation
update_kyc_user_data
Writes KYC property/value entries for the caller (max 100; values encrypted) and returns the updated entries. Same behaviour as create_kyc_user_data. Admins may pass user_id.
update_kyc_user_data. Admin calls may need second-admin approval (delayed_mutations).Inputs
| Name | Type | Required | Description | |
|---|---|---|---|---|
kyc_data |
[KycUserDataEntryInput!] |
required | Not accepted: restrictions_check takes no arguments. |
Up to 100 kyc_property/kyc_value pairs; date_of_birth must be 18+; traders cannot set kyc_status/kyc_message. |
user_id |
String |
required | Not accepted: restrictions_check takes no arguments. |
Required by the schema; ignored for traders (own account used). |
Response
| Field | Sub-fields |
|---|---|
user_id |
scalar |
kyc_property |
scalar |
kyc_value |
scalar |
updated_at |
scalar |
GraphQL Operation
mutation update_kyc_user_data($kyc_data: [KycUserDataEntryInput!]!, $user_id: String!) {
update_kyc_user_data(kyc_data: $kyc_data, user_id: $user_id) {
user_id
kyc_property
kyc_value
updated_at
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation update_kyc_user_data($kyc_data: [KycUserDataEntryInput!]!, $user_id: String!) { update_kyc_user_data(kyc_data: $kyc_data, user_id: $user_id) { user_id kyc_property kyc_value updated_at } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation update_kyc_user_data($kyc_data: [KycUserDataEntryInput!]!, $user_id: String!) { update_kyc_user_data(kyc_data: $kyc_data, user_id: $user_id) { user_id kyc_property kyc_value updated_at } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation update_kyc_user_data($kyc_data: [KycUserDataEntryInput!]!, $user_id: String!) { update_kyc_user_data(kyc_data: $kyc_data, user_id: $user_id) { user_id kyc_property kyc_value updated_at } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query
user_products_enabled
Product feature toggles for the given client role. The current build returns the same platform-wide toggles as products_enabled; nothing user-specific is applied.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
role |
ClientRole |
required | Client role: admin, trader or mobile. |
Response
GraphQL Operation
query user_products_enabled($role: ClientRole!) {
user_products_enabled(role: $role)
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query user_products_enabled($role: ClientRole!) { user_products_enabled(role: $role) }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query user_products_enabled($role: ClientRole!) { user_products_enabled(role: $role) }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query user_products_enabled($role: ClientRole!) { user_products_enabled(role: $role) }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
Referral
6 operations · service: https://vakotrade-demo.cryptosrvc.com/graphql
mutation claim_referral Links the caller to a referrer by claiming their referral code. Fails if already referred, self-referral, or past the claim window after registration. Admins may pass user_id.
claim_referral. Requires the referrals_enabled setting.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
referral_id |
String |
required | Referral code (UUID) to claim. |
user_id |
String |
optional | User claiming the code. Admin only; ignored for traders. |
Response
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-demo.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-demo.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-demo.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
mutation create_referral Creates a new referral code owned by the caller and returns it. Admins must pass user_id.
create_referral. Requires the referrals_enabled setting.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
user_id |
String |
optional | Owner of the code. Admin only; required for admins, ignored for traders. |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
query referrals Paginated list of the caller's referral codes, newest first.
referrals. Requires the referrals_enabled setting.Inputs
Response
| Field | Sub-fields | |
|---|---|---|
referral_id |
scalar | Exact match on referral code. |
GraphQL Operation
query referrals {
referrals {
referral_id
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.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-demo.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-demo.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
This operation takes no inputs.
query referrals_transactions_info Paginated referral reward records where the caller is the target user, newest first.
referrals_transactions_info. Requires the referrals_enabled setting.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
account_transaction_id |
String |
optional | Exact match on the linked account transaction ID. |
pager |
PagerInput |
optional | Pagination: limit (default 30) and offset (default 0). |
date_range |
DateRangeInput |
optional | Creation-time window: time_from / time_to (inclusive). |
search |
String |
optional | UUID: exact match on referral, user, transaction IDs; otherwise substring of reward type or email match. |
referral_id |
String |
optional | Exact match on referral code. |
reward_type |
ReferralRewardType |
optional | one_time, fee_commission, fee_cashback or rebate. |
target_user_id |
String |
optional | Admin only; ignored for traders (set to the caller). |
Response
| Field | Sub-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-demo.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-demo.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-demo.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
query referred_users_count Number of users who claimed the caller's referral codes. Admins must pass user_id.
referrals_history. Requires the referrals_enabled setting.Inputs
Response
GraphQL Operation
query referred_users_count {
referred_users_count
}
Code Examples
curl -X POST 'https://vakotrade-demo.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-demo.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-demo.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
This operation takes no inputs.
query referrer_total_reward_quoted Total referral rewards credited to the caller (live and archived), converted to the quote currency at current prices. Returns 0 when none. Admins must pass user_id.
referrals_history. Requires the referrals_enabled setting.Inputs
| Name | Type | Required | Description | |
|---|---|---|---|---|
quote_currency_id |
String |
required | Not accepted: the only argument is user_id (admin only). |
Currency to express the total in. |
Response
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-demo.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-demo.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-demo.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
Earn / Vaults
11 operations · service: https://vakotrade-demo.cryptosrvc.com/graphql
mutation
cancel_vault_transaction_request
Cancels a pending vault deposit/withdrawal request and pushes the change on user_update. Fails if the request is not found (for traders: not their own) or was already processed.
cancel_vault_transaction_request. Requires the vaults_enabled setting.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
request_id |
String |
required | ID of a pending vault transaction request. |
Response
GraphQL Operation
mutation cancel_vault_transaction_request($request_id: String!) {
cancel_vault_transaction_request(request_id: $request_id)
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation cancel_vault_transaction_request($request_id: String!) { cancel_vault_transaction_request(request_id: $request_id) }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation cancel_vault_transaction_request($request_id: String!) { cancel_vault_transaction_request(request_id: $request_id) }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation cancel_vault_transaction_request($request_id: String!) { cancel_vault_transaction_request(request_id: $request_id) }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query convert_currency_amount Converts an amount from one currency to another using the current cached price (ask), floored to the target currency's precision. Returns null when no price is available.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
base_currency_id |
String |
required | Currency of amount. |
quote_currency_id |
String |
required | Currency to convert into. |
amount |
Float |
required | Amount to convert. |
Response
GraphQL Operation
query convert_currency_amount($base_currency_id: String!, $quote_currency_id: String!, $amount: Float!) {
convert_currency_amount(base_currency_id: $base_currency_id, quote_currency_id: $quote_currency_id, amount: $amount)
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query convert_currency_amount($base_currency_id: String!, $quote_currency_id: String!, $amount: Float!) { convert_currency_amount(base_currency_id: $base_currency_id, quote_currency_id: $quote_currency_id, amount: $amount) }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query convert_currency_amount($base_currency_id: String!, $quote_currency_id: String!, $amount: Float!) { convert_currency_amount(base_currency_id: $base_currency_id, quote_currency_id: $quote_currency_id, amount: $amount) }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query convert_currency_amount($base_currency_id: String!, $quote_currency_id: String!, $amount: Float!) { convert_currency_amount(base_currency_id: $base_currency_id, quote_currency_id: $quote_currency_id, amount: $amount) }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation
create_vault_deposit
Deposits funds from a wallet into a vault; affects the caller's balance. Depending on the vault's policy it completes instantly (INSTANT_TRANSACTION_CREATED) or creates a pending request (VAULT_TRANSACTION_REQUESTED). Admins must pass user_id.
create_vault_deposit. Requires the vaults_enabled setting.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
vault_id |
String |
required | Vault to deposit into; must be active, within its effective dates and have deposits enabled. |
amount |
Float |
required | Amount to deposit; the vault's min/max deposit limits apply. |
user_id |
String |
optional | Admin only (required for admins); ignored for traders. |
wallet_id |
String |
optional | Wallet funding the deposit. Default MAIN. |
Response
| Field | Sub-fields |
|---|---|
message |
scalar |
status |
scalar |
GraphQL Operation
mutation create_vault_deposit($vault_id: String!, $amount: Float!, $user_id: String, $wallet_id: String) {
create_vault_deposit(vault_id: $vault_id, amount: $amount, user_id: $user_id, wallet_id: $wallet_id) {
message
status
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation create_vault_deposit($vault_id: String!, $amount: Float!, $user_id: String, $wallet_id: String) { create_vault_deposit(vault_id: $vault_id, amount: $amount, user_id: $user_id, wallet_id: $wallet_id) { message status } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation create_vault_deposit($vault_id: String!, $amount: Float!, $user_id: String, $wallet_id: String) { create_vault_deposit(vault_id: $vault_id, amount: $amount, user_id: $user_id, wallet_id: $wallet_id) { message status } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation create_vault_deposit($vault_id: String!, $amount: Float!, $user_id: String, $wallet_id: String) { create_vault_deposit(vault_id: $vault_id, amount: $amount, user_id: $user_id, wallet_id: $wallet_id) { message status } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
mutation create_vault_withdrawal Withdraws funds from a vault back to a wallet; affects the caller's balance. Completes instantly or creates a pending request depending on the vault's policy; an active lock-in period can block or defer it. Admins must pass user_id.
create_vault_withdrawal. Requires the vaults_enabled setting.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
vault_id |
String |
required | Vault to withdraw from; must be active and have withdrawals enabled. |
amount |
Float |
required | Amount to withdraw; vault min/max limits and the vault balance apply. |
user_id |
String |
optional | Admin only (required for admins); ignored for traders. |
use_all_funds |
Boolean |
optional | When true, withdraws the whole free vault balance instead of amount. |
wallet_id |
String |
optional | Wallet that receives the funds. Default MAIN. |
Response
| Field | Sub-fields |
|---|---|
message |
scalar |
status |
scalar |
data |
serial_id, vault_id, user_id, vault_transaction_id, vault_account_id, amount, balance_after, currency_id, transaction_type, transaction_class, comment, created_by, created_at, is_delayed, delayed_until, delayed_until_iso |
GraphQL Operation
mutation create_vault_withdrawal($vault_id: String!, $amount: Float!, $user_id: String, $use_all_funds: Boolean, $wallet_id: String) {
create_vault_withdrawal(vault_id: $vault_id, amount: $amount, user_id: $user_id, use_all_funds: $use_all_funds, wallet_id: $wallet_id) {
message
status
data {
serial_id
vault_id
user_id
vault_transaction_id
vault_account_id
amount
balance_after
currency_id
transaction_type
transaction_class
comment
created_by
created_at
is_delayed
delayed_until
delayed_until_iso
}
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"mutation create_vault_withdrawal($vault_id: String!, $amount: Float!, $user_id: String, $use_all_funds: Boolean, $wallet_id: String) { create_vault_withdrawal(vault_id: $vault_id, amount: $amount, user_id: $user_id, use_all_funds: $use_all_funds, wallet_id: $wallet_id) { message status data { serial_id vault_id user_id vault_transaction_id vault_account_id amount balance_after currency_id transaction_type transaction_class comment created_by created_at is_delayed delayed_until delayed_until_iso } } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """mutation create_vault_withdrawal($vault_id: String!, $amount: Float!, $user_id: String, $use_all_funds: Boolean, $wallet_id: String) { create_vault_withdrawal(vault_id: $vault_id, amount: $amount, user_id: $user_id, use_all_funds: $use_all_funds, wallet_id: $wallet_id) { message status data { serial_id vault_id user_id vault_transaction_id vault_account_id amount balance_after currency_id transaction_type transaction_class comment created_by created_at is_delayed delayed_until delayed_until_iso } } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation create_vault_withdrawal($vault_id: String!, $amount: Float!, $user_id: String, $use_all_funds: Boolean, $wallet_id: String) { create_vault_withdrawal(vault_id: $vault_id, amount: $amount, user_id: $user_id, use_all_funds: $use_all_funds, wallet_id: $wallet_id) { message status data { serial_id vault_id user_id vault_transaction_id vault_account_id amount balance_after currency_id transaction_type transaction_class comment created_by created_at is_delayed delayed_until delayed_until_iso } } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query enabled_vaults Vaults visible to the caller after applying their limit group's vault configuration (client customization). Disabled-currency vaults are removed after paging, so a page can be shorter than the limit.
vaults. Requires the vaults_enabled setting.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
vault_id |
String |
optional | Exact vault ID. |
currency_id |
String |
optional | Exact currency ID. |
is_active |
ToggleSwitch |
optional | Filter by active flag (on/off). |
withdrawal_enabled |
ToggleSwitch |
optional | Filter by withdrawals-enabled flag. |
deposit_enabled |
ToggleSwitch |
optional | Filter by deposits-enabled flag. |
search |
String |
optional | Substring match on vault ID, name or currency ID. |
pager |
PagerInput |
optional | Pagination (limit, offset); default limit 30. |
sort |
SortInput |
optional | Sort property (default serial_id) and direction (default DESC). |
Response
| Field | Sub-fields |
|---|---|
serial_id |
scalar |
vault_id |
scalar |
currency_id |
scalar |
name |
scalar |
annual_rate_percent |
scalar |
max_withdrawal_amount |
scalar |
max_deposit_amount |
scalar |
min_withdrawal_amount |
scalar |
min_deposit_amount |
scalar |
cut_off_time_seconds |
scalar |
lock_in_period_seconds |
scalar |
effective_date_from |
scalar |
effective_date_to |
scalar |
rate_type |
scalar |
is_active |
scalar |
withdrawal_enabled |
scalar |
deposit_enabled |
scalar |
last_interest_at |
scalar |
created_at |
scalar |
updated_at |
scalar |
total_balance |
scalar |
withdrawal_policy |
scalar |
withdrawal_delay_seconds |
scalar |
meta |
scalar |
level5_apy |
scalar |
currency |
type |
GraphQL Operation
query enabled_vaults($vault_id: String, $currency_id: String, $is_active: ToggleSwitch, $withdrawal_enabled: ToggleSwitch, $deposit_enabled: ToggleSwitch, $search: String, $pager: PagerInput, $sort: SortInput) {
enabled_vaults(vault_id: $vault_id, currency_id: $currency_id, is_active: $is_active, withdrawal_enabled: $withdrawal_enabled, deposit_enabled: $deposit_enabled, search: $search, pager: $pager, sort: $sort) {
serial_id
vault_id
currency_id
name
annual_rate_percent
max_withdrawal_amount
max_deposit_amount
min_withdrawal_amount
min_deposit_amount
cut_off_time_seconds
lock_in_period_seconds
effective_date_from
effective_date_to
rate_type
is_active
withdrawal_enabled
deposit_enabled
last_interest_at
created_at
updated_at
total_balance
withdrawal_policy
withdrawal_delay_seconds
meta
level5_apy
currency {
type
}
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query enabled_vaults($vault_id: String, $currency_id: String, $is_active: ToggleSwitch, $withdrawal_enabled: ToggleSwitch, $deposit_enabled: ToggleSwitch, $search: String, $pager: PagerInput, $sort: SortInput) { enabled_vaults(vault_id: $vault_id, currency_id: $currency_id, is_active: $is_active, withdrawal_enabled: $withdrawal_enabled, deposit_enabled: $deposit_enabled, search: $search, pager: $pager, sort: $sort) { serial_id vault_id currency_id name annual_rate_percent max_withdrawal_amount max_deposit_amount min_withdrawal_amount min_deposit_amount cut_off_time_seconds lock_in_period_seconds effective_date_from effective_date_to rate_type is_active withdrawal_enabled deposit_enabled last_interest_at created_at updated_at total_balance withdrawal_policy withdrawal_delay_seconds meta level5_apy currency { type } } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query enabled_vaults($vault_id: String, $currency_id: String, $is_active: ToggleSwitch, $withdrawal_enabled: ToggleSwitch, $deposit_enabled: ToggleSwitch, $search: String, $pager: PagerInput, $sort: SortInput) { enabled_vaults(vault_id: $vault_id, currency_id: $currency_id, is_active: $is_active, withdrawal_enabled: $withdrawal_enabled, deposit_enabled: $deposit_enabled, search: $search, pager: $pager, sort: $sort) { serial_id vault_id currency_id name annual_rate_percent max_withdrawal_amount max_deposit_amount min_withdrawal_amount min_deposit_amount cut_off_time_seconds lock_in_period_seconds effective_date_from effective_date_to rate_type is_active withdrawal_enabled deposit_enabled last_interest_at created_at updated_at total_balance withdrawal_policy withdrawal_delay_seconds meta level5_apy currency { type } } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query enabled_vaults($vault_id: String, $currency_id: String, $is_active: ToggleSwitch, $withdrawal_enabled: ToggleSwitch, $deposit_enabled: ToggleSwitch, $search: String, $pager: PagerInput, $sort: SortInput) { enabled_vaults(vault_id: $vault_id, currency_id: $currency_id, is_active: $is_active, withdrawal_enabled: $withdrawal_enabled, deposit_enabled: $deposit_enabled, search: $search, pager: $pager, sort: $sort) { serial_id vault_id currency_id name annual_rate_percent max_withdrawal_amount max_deposit_amount min_withdrawal_amount min_deposit_amount cut_off_time_seconds lock_in_period_seconds effective_date_from effective_date_to rate_type is_active withdrawal_enabled deposit_enabled last_interest_at created_at updated_at total_balance withdrawal_policy withdrawal_delay_seconds meta level5_apy currency { type } } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query
estimate_vault_interests
Estimated interest for placing amount in a vault, compounded daily at the vault's annual rate. Fixed-rate vaults use their lock-in period; other vaults need duration_seconds. Nothing is created.
estimate_vault_interests. Requires the vaults_enabled setting.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
vault_id |
String |
required | Vault to estimate for. |
amount |
Float |
required | Principal amount. |
duration_seconds |
Int |
optional | Holding period in seconds; required for non-fixed vaults, ignored for fixed-rate vaults. |
Response
GraphQL Operation
query estimate_vault_interests($vault_id: String!, $amount: Float!, $duration_seconds: Int) {
estimate_vault_interests(vault_id: $vault_id, amount: $amount, duration_seconds: $duration_seconds)
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query estimate_vault_interests($vault_id: String!, $amount: Float!, $duration_seconds: Int) { estimate_vault_interests(vault_id: $vault_id, amount: $amount, duration_seconds: $duration_seconds) }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query estimate_vault_interests($vault_id: String!, $amount: Float!, $duration_seconds: Int) { estimate_vault_interests(vault_id: $vault_id, amount: $amount, duration_seconds: $duration_seconds) }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query estimate_vault_interests($vault_id: String!, $amount: Float!, $duration_seconds: Int) { estimate_vault_interests(vault_id: $vault_id, amount: $amount, duration_seconds: $duration_seconds) }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query vaults_accounts Vault accounts (per-user vault balances), filterable by vault, wallet or search. Traders see only their own; admins may pass user_id.
vaults_accounts.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
vault_account_id |
String |
optional | Exact vault account ID. |
vault_id |
String |
optional | Exact vault ID. |
user_id |
String |
optional | Admin only; ignored for traders. |
search |
String |
optional | Exact vault/account/user ID (UUIDs), vault name substring, or currency ID prefix. |
pager |
PagerInput |
optional | Pagination (limit, offset); default limit 30. |
sort |
SortInput |
optional | Sort property (default serial_id) and direction (default DESC). |
wallet_id |
String |
optional | Exact wallet ID. |
Response
| Field | Sub-fields |
|---|---|
balance |
scalar |
created_at |
scalar |
created_at_iso |
scalar |
exposed_vault_balance |
scalar |
free_balance |
scalar |
serial_id |
scalar |
total_earned |
total_earned_quoted, total_earned |
today_earned |
today_earned_quoted, today_earned |
updated_at |
scalar |
updated_at_iso |
scalar |
user_id |
scalar |
vault |
serial_id, vault_id, currency_id, name, annual_rate_percent, max_withdrawal_amount, max_deposit_amount, min_withdrawal_amount, min_deposit_amount, cut_off_time_seconds, lock_in_period_seconds, effective_date_from, effective_date_to, rate_type, is_active, withdrawal_enabled, deposit_enabled, last_interest_at, created_at, updated_at, total_balance, withdrawal_policy, withdrawal_delay_seconds, meta, level5_apy, currency |
vault_account_id |
scalar |
vault_id |
scalar |
version |
scalar |
balance_quoted: balance_quoted (quote_currency_id: "") |
scalar |
GraphQL Operation
query vaults_accounts($vault_account_id: String, $vault_id: String, $user_id: String, $search: String, $pager: PagerInput, $sort: SortInput, $wallet_id: String) {
vaults_accounts(vault_account_id: $vault_account_id, vault_id: $vault_id, user_id: $user_id, search: $search, pager: $pager, sort: $sort, wallet_id: $wallet_id) {
balance
created_at
created_at_iso
exposed_vault_balance
free_balance
serial_id
total_earned {
total_earned_quoted
total_earned
}
today_earned {
today_earned_quoted
today_earned
}
updated_at
updated_at_iso
user_id
vault {
serial_id
vault_id
currency_id
name
annual_rate_percent
max_withdrawal_amount
max_deposit_amount
min_withdrawal_amount
min_deposit_amount
cut_off_time_seconds
lock_in_period_seconds
effective_date_from
effective_date_to
rate_type
is_active
withdrawal_enabled
deposit_enabled
last_interest_at
created_at
updated_at
total_balance
withdrawal_policy
withdrawal_delay_seconds
meta
level5_apy
currency {
type
}
}
vault_account_id
vault_id
version
balance_quoted: balance_quoted (quote_currency_id: "")
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query vaults_accounts($vault_account_id: String, $vault_id: String, $user_id: String, $search: String, $pager: PagerInput, $sort: SortInput, $wallet_id: String) { vaults_accounts(vault_account_id: $vault_account_id, vault_id: $vault_id, user_id: $user_id, search: $search, pager: $pager, sort: $sort, wallet_id: $wallet_id) { balance created_at created_at_iso exposed_vault_balance free_balance serial_id total_earned { total_earned_quoted total_earned } today_earned { today_earned_quoted today_earned } updated_at updated_at_iso user_id vault { serial_id vault_id currency_id name annual_rate_percent max_withdrawal_amount max_deposit_amount min_withdrawal_amount min_deposit_amount cut_off_time_seconds lock_in_period_seconds effective_date_from effective_date_to rate_type is_active withdrawal_enabled deposit_enabled last_interest_at created_at updated_at total_balance withdrawal_policy withdrawal_delay_seconds meta level5_apy currency { type } } vault_account_id vault_id version balance_quoted: balance_quoted (quote_currency_id: \"\") } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query vaults_accounts($vault_account_id: String, $vault_id: String, $user_id: String, $search: String, $pager: PagerInput, $sort: SortInput, $wallet_id: String) { vaults_accounts(vault_account_id: $vault_account_id, vault_id: $vault_id, user_id: $user_id, search: $search, pager: $pager, sort: $sort, wallet_id: $wallet_id) { balance created_at created_at_iso exposed_vault_balance free_balance serial_id total_earned { total_earned_quoted total_earned } today_earned { today_earned_quoted today_earned } updated_at updated_at_iso user_id vault { serial_id vault_id currency_id name annual_rate_percent max_withdrawal_amount max_deposit_amount min_withdrawal_amount min_deposit_amount cut_off_time_seconds lock_in_period_seconds effective_date_from effective_date_to rate_type is_active withdrawal_enabled deposit_enabled last_interest_at created_at updated_at total_balance withdrawal_policy withdrawal_delay_seconds meta level5_apy currency { type } } vault_account_id vault_id version balance_quoted: balance_quoted (quote_currency_id: "") } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query vaults_accounts($vault_account_id: String, $vault_id: String, $user_id: String, $search: String, $pager: PagerInput, $sort: SortInput, $wallet_id: String) { vaults_accounts(vault_account_id: $vault_account_id, vault_id: $vault_id, user_id: $user_id, search: $search, pager: $pager, sort: $sort, wallet_id: $wallet_id) { balance created_at created_at_iso exposed_vault_balance free_balance serial_id total_earned { total_earned_quoted total_earned } today_earned { today_earned_quoted today_earned } updated_at updated_at_iso user_id vault { serial_id vault_id currency_id name annual_rate_percent max_withdrawal_amount max_deposit_amount min_withdrawal_amount min_deposit_amount cut_off_time_seconds lock_in_period_seconds effective_date_from effective_date_to rate_type is_active withdrawal_enabled deposit_enabled last_interest_at created_at updated_at total_balance withdrawal_policy withdrawal_delay_seconds meta level5_apy currency { type } } vault_account_id vault_id version balance_quoted: balance_quoted (quote_currency_id: "") } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query vaults_average_user_apy The caller's average APY across vaults with a non-zero balance, weighted by balances converted to quote_currency_id. Returns 0 when there is no vault balance. Admins must pass user_id.
vaults. Requires the vaults_enabled setting.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
user_id |
String |
optional | Admin only (required for admins); ignored for traders. |
quote_currency_id |
String |
optional | Currency balances are converted to for weighting. Default USD. |
wallet_id |
String |
optional | Only vault accounts of this wallet. |
Response
GraphQL Operation
query vaults_average_user_apy($user_id: String, $quote_currency_id: String, $wallet_id: String) {
vaults_average_user_apy(user_id: $user_id, quote_currency_id: $quote_currency_id, wallet_id: $wallet_id)
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query vaults_average_user_apy($user_id: String, $quote_currency_id: String, $wallet_id: String) { vaults_average_user_apy(user_id: $user_id, quote_currency_id: $quote_currency_id, wallet_id: $wallet_id) }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query vaults_average_user_apy($user_id: String, $quote_currency_id: String, $wallet_id: String) { vaults_average_user_apy(user_id: $user_id, quote_currency_id: $quote_currency_id, wallet_id: $wallet_id) }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query vaults_average_user_apy($user_id: String, $quote_currency_id: String, $wallet_id: String) { vaults_average_user_apy(user_id: $user_id, quote_currency_id: $quote_currency_id, wallet_id: $wallet_id) }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query vaults_transactions Vault transactions (deposits, withdrawals, interest, manual), newest first by default. No default date window. Traders see only their own; admins may pass user_id.
vaults_transactions. Requires the vaults_enabled setting.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
vault_id |
String |
optional | Exact vault ID. |
user_id |
String |
optional | Admin only; ignored for traders. |
vault_transaction_id |
String |
optional | Exact vault transaction ID. |
transaction_type |
AccountTransactionType |
optional | credit or debit. |
transaction_class |
VaultsTransactionClass |
optional | deposit, withdrawal, interest or manual. |
search |
String |
optional | Exact user/vault/transaction ID (UUIDs); email, username, vault name or currency substring. |
currency_id |
String |
optional | Vault currency (exact). |
pager |
PagerInput |
optional | Pagination (limit, offset); default limit 30. |
date_range |
DateRangeInput |
optional | Filters created_at (time_from/time_to); no default window. |
sort |
SortInput |
optional | Sort property (default created_at) and direction (default DESC). |
wallet_id |
String |
optional | Exact wallet ID of the vault account. |
Response
| Field | Sub-fields |
|---|---|
vault_transaction_id |
scalar |
amount |
scalar |
currency_id |
scalar |
transaction_class |
scalar |
created_at_iso |
scalar |
is_delayed |
scalar |
delayed_until_iso |
scalar |
apy |
scalar |
vault |
annual_rate_percent, rate_type, lock_in_period_seconds |
GraphQL Operation
query vaults_transactions($vault_id: String, $user_id: String, $vault_transaction_id: String, $transaction_type: AccountTransactionType, $transaction_class: VaultsTransactionClass, $search: String, $currency_id: String, $pager: PagerInput, $date_range: DateRangeInput, $sort: SortInput, $wallet_id: String) {
vaults_transactions(vault_id: $vault_id, user_id: $user_id, vault_transaction_id: $vault_transaction_id, transaction_type: $transaction_type, transaction_class: $transaction_class, search: $search, currency_id: $currency_id, pager: $pager, date_range: $date_range, sort: $sort, wallet_id: $wallet_id) {
vault_transaction_id
amount
currency_id
transaction_class
created_at_iso
is_delayed
delayed_until_iso
apy
vault {
annual_rate_percent
rate_type
lock_in_period_seconds
}
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query vaults_transactions($vault_id: String, $user_id: String, $vault_transaction_id: String, $transaction_type: AccountTransactionType, $transaction_class: VaultsTransactionClass, $search: String, $currency_id: String, $pager: PagerInput, $date_range: DateRangeInput, $sort: SortInput, $wallet_id: String) { vaults_transactions(vault_id: $vault_id, user_id: $user_id, vault_transaction_id: $vault_transaction_id, transaction_type: $transaction_type, transaction_class: $transaction_class, search: $search, currency_id: $currency_id, pager: $pager, date_range: $date_range, sort: $sort, wallet_id: $wallet_id) { vault_transaction_id amount currency_id transaction_class created_at_iso is_delayed delayed_until_iso apy vault { annual_rate_percent rate_type lock_in_period_seconds } } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query vaults_transactions($vault_id: String, $user_id: String, $vault_transaction_id: String, $transaction_type: AccountTransactionType, $transaction_class: VaultsTransactionClass, $search: String, $currency_id: String, $pager: PagerInput, $date_range: DateRangeInput, $sort: SortInput, $wallet_id: String) { vaults_transactions(vault_id: $vault_id, user_id: $user_id, vault_transaction_id: $vault_transaction_id, transaction_type: $transaction_type, transaction_class: $transaction_class, search: $search, currency_id: $currency_id, pager: $pager, date_range: $date_range, sort: $sort, wallet_id: $wallet_id) { vault_transaction_id amount currency_id transaction_class created_at_iso is_delayed delayed_until_iso apy vault { annual_rate_percent rate_type lock_in_period_seconds } } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query vaults_transactions($vault_id: String, $user_id: String, $vault_transaction_id: String, $transaction_type: AccountTransactionType, $transaction_class: VaultsTransactionClass, $search: String, $currency_id: String, $pager: PagerInput, $date_range: DateRangeInput, $sort: SortInput, $wallet_id: String) { vaults_transactions(vault_id: $vault_id, user_id: $user_id, vault_transaction_id: $vault_transaction_id, transaction_type: $transaction_type, transaction_class: $transaction_class, search: $search, currency_id: $currency_id, pager: $pager, date_range: $date_range, sort: $sort, wallet_id: $wallet_id) { vault_transaction_id amount currency_id transaction_class created_at_iso is_delayed delayed_until_iso apy vault { annual_rate_percent rate_type lock_in_period_seconds } } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query vaults_transactions_requests Vault deposit/withdrawal requests (pending or processed), newest first by default. No default date window. Traders see only their own; admins may pass user_id.
vaults_transactions_requests. Requires the vaults_enabled setting.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
vault_id |
String |
optional | Exact vault ID. |
user_id |
String |
optional | Admin only; ignored for traders. |
transaction_type |
AccountTransactionType |
optional | credit or debit. |
transaction_class |
VaultsTransactionClass |
optional | deposit, withdrawal, interest or manual. |
search |
String |
optional | Exact user/vault/request ID (UUIDs), approved_by substring, or email. |
pager |
PagerInput |
optional | Pagination (limit, offset); default limit 30. |
date_range |
DateRangeInput |
optional | Filters created_at (time_from/time_to); no default window. |
sort |
SortInput |
optional | Sort property (default created_at) and direction (default DESC). |
currency_id |
String |
optional | Vault currency (exact). |
wallet_id |
String |
optional | Only requests in this wallet; MAIN also matches requests with no wallet assignment. |
Response
| Field | Sub-fields |
|---|---|
serial_id |
scalar |
request_id |
scalar |
user_id |
scalar |
vault_id |
scalar |
amount |
scalar |
transaction_class |
scalar |
status |
scalar |
approval_reason |
scalar |
approved_by |
scalar |
created_at_iso |
scalar |
updated_at_iso |
scalar |
approved_at |
scalar |
vault |
serial_id, vault_id, currency_id, name, annual_rate_percent, max_withdrawal_amount, max_deposit_amount, min_withdrawal_amount, min_deposit_amount, cut_off_time_seconds, lock_in_period_seconds, effective_date_from, effective_date_to, rate_type, is_active, withdrawal_enabled, deposit_enabled, last_interest_at, created_at, updated_at, total_balance, withdrawal_policy, withdrawal_delay_seconds, meta, level5_apy, currency |
apy |
scalar |
GraphQL Operation
query vaults_transactions_requests($vault_id: String, $user_id: String, $transaction_type: AccountTransactionType, $transaction_class: VaultsTransactionClass, $search: String, $pager: PagerInput, $date_range: DateRangeInput, $sort: SortInput, $currency_id: String, $wallet_id: String) {
vaults_transactions_requests(vault_id: $vault_id, user_id: $user_id, transaction_type: $transaction_type, transaction_class: $transaction_class, search: $search, pager: $pager, date_range: $date_range, sort: $sort, currency_id: $currency_id, wallet_id: $wallet_id) {
serial_id
request_id
user_id
vault_id
amount
transaction_class
status
approval_reason
approved_by
created_at_iso
updated_at_iso
approved_at
vault {
serial_id
vault_id
currency_id
name
annual_rate_percent
max_withdrawal_amount
max_deposit_amount
min_withdrawal_amount
min_deposit_amount
cut_off_time_seconds
lock_in_period_seconds
effective_date_from
effective_date_to
rate_type
is_active
withdrawal_enabled
deposit_enabled
last_interest_at
created_at
updated_at
total_balance
withdrawal_policy
withdrawal_delay_seconds
meta
level5_apy
currency {
type
}
}
apy
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query vaults_transactions_requests($vault_id: String, $user_id: String, $transaction_type: AccountTransactionType, $transaction_class: VaultsTransactionClass, $search: String, $pager: PagerInput, $date_range: DateRangeInput, $sort: SortInput, $currency_id: String, $wallet_id: String) { vaults_transactions_requests(vault_id: $vault_id, user_id: $user_id, transaction_type: $transaction_type, transaction_class: $transaction_class, search: $search, pager: $pager, date_range: $date_range, sort: $sort, currency_id: $currency_id, wallet_id: $wallet_id) { serial_id request_id user_id vault_id amount transaction_class status approval_reason approved_by created_at_iso updated_at_iso approved_at vault { serial_id vault_id currency_id name annual_rate_percent max_withdrawal_amount max_deposit_amount min_withdrawal_amount min_deposit_amount cut_off_time_seconds lock_in_period_seconds effective_date_from effective_date_to rate_type is_active withdrawal_enabled deposit_enabled last_interest_at created_at updated_at total_balance withdrawal_policy withdrawal_delay_seconds meta level5_apy currency { type } } apy } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query vaults_transactions_requests($vault_id: String, $user_id: String, $transaction_type: AccountTransactionType, $transaction_class: VaultsTransactionClass, $search: String, $pager: PagerInput, $date_range: DateRangeInput, $sort: SortInput, $currency_id: String, $wallet_id: String) { vaults_transactions_requests(vault_id: $vault_id, user_id: $user_id, transaction_type: $transaction_type, transaction_class: $transaction_class, search: $search, pager: $pager, date_range: $date_range, sort: $sort, currency_id: $currency_id, wallet_id: $wallet_id) { serial_id request_id user_id vault_id amount transaction_class status approval_reason approved_by created_at_iso updated_at_iso approved_at vault { serial_id vault_id currency_id name annual_rate_percent max_withdrawal_amount max_deposit_amount min_withdrawal_amount min_deposit_amount cut_off_time_seconds lock_in_period_seconds effective_date_from effective_date_to rate_type is_active withdrawal_enabled deposit_enabled last_interest_at created_at updated_at total_balance withdrawal_policy withdrawal_delay_seconds meta level5_apy currency { type } } apy } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query vaults_transactions_requests($vault_id: String, $user_id: String, $transaction_type: AccountTransactionType, $transaction_class: VaultsTransactionClass, $search: String, $pager: PagerInput, $date_range: DateRangeInput, $sort: SortInput, $currency_id: String, $wallet_id: String) { vaults_transactions_requests(vault_id: $vault_id, user_id: $user_id, transaction_type: $transaction_type, transaction_class: $transaction_class, search: $search, pager: $pager, date_range: $date_range, sort: $sort, currency_id: $currency_id, wallet_id: $wallet_id) { serial_id request_id user_id vault_id amount transaction_class status approval_reason approved_by created_at_iso updated_at_iso approved_at vault { serial_id vault_id currency_id name annual_rate_percent max_withdrawal_amount max_deposit_amount min_withdrawal_amount min_deposit_amount cut_off_time_seconds lock_in_period_seconds effective_date_from effective_date_to rate_type is_active withdrawal_enabled deposit_enabled last_interest_at created_at updated_at total_balance withdrawal_policy withdrawal_delay_seconds meta level5_apy currency { type } } apy } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
query vaults_transactions_total_sum The caller's vault interest earnings (today, 7 days, 30 days, all time) converted to quote_currency_id, with a per-vault breakdown. Admins may pass user_id; without it, all users are included.
vaults_transactions. Requires the vaults_enabled setting.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
vault_id |
String |
optional | Only this vault. |
quote_currency_id |
String |
required | Currency the totals are expressed in. |
pager |
PagerInput |
optional | Paginates the per-vault breakdown (default limit 30); totals cover only the returned page. |
wallet_id |
String |
optional | Exact wallet ID of the vault account. |
Response
| Field | Sub-fields |
|---|---|
vaults_transactions_30d_total_sum |
scalar |
vaults_transactions_7d_total_sum |
scalar |
vaults_transactions_today_total_sum |
scalar |
vaults_transactions_total_sum |
scalar |
GraphQL Operation
query vaults_transactions_total_sum($vault_id: String, $quote_currency_id: String!, $pager: PagerInput, $wallet_id: String) {
vaults_transactions_total_sum(vault_id: $vault_id, quote_currency_id: $quote_currency_id, pager: $pager, wallet_id: $wallet_id) {
vaults_transactions_30d_total_sum
vaults_transactions_7d_total_sum
vaults_transactions_today_total_sum
vaults_transactions_total_sum
}
}
Code Examples
curl -X POST 'https://vakotrade-demo.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query vaults_transactions_total_sum($vault_id: String, $quote_currency_id: String!, $pager: PagerInput, $wallet_id: String) { vaults_transactions_total_sum(vault_id: $vault_id, quote_currency_id: $quote_currency_id, pager: $pager, wallet_id: $wallet_id) { vaults_transactions_30d_total_sum vaults_transactions_7d_total_sum vaults_transactions_today_total_sum vaults_transactions_total_sum } }","variables":{}}'
import requests
url = "https://vakotrade-demo.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query vaults_transactions_total_sum($vault_id: String, $quote_currency_id: String!, $pager: PagerInput, $wallet_id: String) { vaults_transactions_total_sum(vault_id: $vault_id, quote_currency_id: $quote_currency_id, pager: $pager, wallet_id: $wallet_id) { vaults_transactions_30d_total_sum vaults_transactions_7d_total_sum vaults_transactions_today_total_sum vaults_transactions_total_sum } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://vakotrade-demo.cryptosrvc.com/graphql", {
method: "POST",
headers: {
"Authorization": `Bearer ${YOUR_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query vaults_transactions_total_sum($vault_id: String, $quote_currency_id: String!, $pager: PagerInput, $wallet_id: String) { vaults_transactions_total_sum(vault_id: $vault_id, quote_currency_id: $quote_currency_id, pager: $pager, wallet_id: $wallet_id) { vaults_transactions_30d_total_sum vaults_transactions_7d_total_sum vaults_transactions_today_total_sum vaults_transactions_total_sum } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
Derivatives
29 operations across 6 areas · service: https://margin-trading-service.cryptosrvc.com/graphql
History
2 ops
query
margin_funding_fees
Funding fees charged or paid on the caller's margin positions, newest first (by updated_at). Each row includes the position's instrument and margin currency. With no wallet_id, fees from all of the caller's wallets are returned. Admins may pass user_id.
derivatives_funding_history.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
sort |
SortInput |
optional | field and direction; when no field is given, results sort by updated_at descending. |
pager |
PagerInput |
optional | Pagination: limit (default 30) and offset (default 0). |
dateRange |
DateRangeInput |
optional | Filters on the fee's updated_at: time_from / time_to, format YYYY-MM-DD HH:mm:ss. |
margin_position_id |
String |
optional | Exact match on the position the fee was charged on. |
wallet_id |
String |
optional | Exact match on wallet. When omitted, no wallet filter is applied. |
Response
| Field | Sub-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.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.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.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
query
margin_funding_rates_history
Historical long/short funding rates per instrument strategy, newest first. For traders the raw_*_funding_rate fields are overwritten with the published rates so the markup is not disclosed.
derivatives_funding_history.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
margin_instrument_strategy_id |
String |
optional | Exact match on the instrument strategy. When omitted, rates for all strategies are returned. |
pager |
PagerInput |
optional | Pagination: limit (default 30) and offset (default 0). |
dateRange |
DateRangeInput |
optional | Filters on the rate's updated_at: time_from / time_to, format YYYY-MM-DD HH:mm:ss. |
Response
| Field | Sub-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.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.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.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
Instruments
6 ops
query
derivatives_enabled
Whether derivatives trading is enabled (on/off) for the caller, taken from the caller's margin limit group, or the default limit group when none is assigned. Takes no arguments.
derivatives_instruments. Traders only; other roles get an error.Inputs
Response
GraphQL Operation
query derivatives_enabled {
derivatives_enabled
}
Code Examples
curl -X POST 'https://margin-trading-service.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.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.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
This operation takes no inputs.
query
margin_currencies
Paginated, filterable list of margin currencies, sorted by currency_id ascending unless sort is given.
Inputs
| Name | Type | Required | Description | |
|---|---|---|---|---|
is_active |
ToggleSwitch |
optional | Not accepted: this operation defines no arguments in code. | on / off; exact match on the currency's active flag. When omitted, both are returned. |
pager |
PagerInput |
optional | Not accepted: this operation defines no arguments in code. | Pagination: limit (default 30) and offset (default 0). |
Response
| Field | Sub-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.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.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.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
subscription
margin_instrument_price_bar
Streams live OHLC price-bar updates for one instrument at the given periodicity. Pair with the margin_instrument_price_bars query for history.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
instrument_id |
String |
required | Margin instrument ID to stream bars for (required). |
periodicity |
MarginInstrumentHistoryPeriodicity |
required | Bar size: minute, minute5, minute10, minute15, minute30, hour, hour4, hour8, day, week, month (required). |
Response
| Field | Sub-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.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.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.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://, graphql-ws protocol). Try It opens a WebSocket to this operation's endpoint and streams updates below; click Stop to end it.
query
margin_instrument_price_bars
Historical OHLC price bars for one instrument, newest first. Without date_range.time_from the window covers the last 100 bars; time_to is capped at the current time.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
instrument_id |
String |
required | Margin instrument ID (required). |
limit |
Int |
optional | Maximum number of bars returned. Default 1000. |
date_range |
DateRangeInput |
optional | time_from / time_to, format YYYY-MM-DD HH:mm:ss. Defaults: time_to = now, time_from = 100 bars before time_to. |
periodicity |
MarginInstrumentHistoryPeriodicity |
optional | Bar size (minute … month). Default day. |
Response
| Field | Sub-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: Int, $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.cryptosrvc.com/graphql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"query margin_instrument_price_bars($instrument_id: String!, $limit: Int, $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.cryptosrvc.com/graphql"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
}
payload = {
"query": """query margin_instrument_price_bars($instrument_id: String!, $limit: Int, $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.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: Int, $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
query
margin_instruments
Paginated, searchable list of margin instruments, sorted by margin_instrument_id unless sort is given. Non-admins do not see instruments disabled in their limit group (the default group when anonymous); that filter runs after paging, so a page can be short.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
is_active |
ToggleSwitch |
optional | on / off; exact match on the instrument's active flag. When omitted, both are returned. |
pager |
PagerInput |
optional | Pagination: limit (default 30) and offset (default 0). |
search |
String |
optional | Substring match on margin_instrument_id, name, class or meta. |
Response
| Field | Sub-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.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.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.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
query
margin_trading_config
The caller's margin trading settings: margin currency, margin call and liquidation levels (from the caller's fee group, or the default group), margin mode (always cross), whether limit orders may be placed while the market is closed, and the max TP/SL levels per position.
Inputs
Response
| Field | Sub-fields | |
|---|---|---|
margin_currency |
scalar | Returned field, not an input: the caller's margin currency, taken from their fee group. |
margin_call_level |
scalar | Returned field, not an input: margin call level from the caller's fee group (0 if unset). |
liquidation_level |
scalar | Returned field, not an input: liquidation level from the caller's fee group (0 if unset). |
add_limit_orders_when_market_closed |
scalar | Returned field, not an input: whether limit orders are accepted while the market is closed (platform setting). |
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.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.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.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
This operation takes no inputs.
Orders
3 ops
query
closed_margin_orders
Paginated, filterable history of the caller's closed margin orders (filled, cancelled, rejected), newest first by default. Traders see the MAIN wallet unless wallet_id is given. Admins may pass user_id.
closed_derivatives_orders. Rate-limited (100 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
search |
String |
optional | Substring match on margin_order_id, instrument_id, user_id, margin_position_id or batch_id. |
pager |
PagerInput |
optional | Pagination: limit (default 30) and offset (default 0). |
sort |
SortInput |
optional | field and direction; serial_id descending is always applied as the final ordering. |
user_id |
String |
optional | Admin only; ignored for traders (forced to the caller). |
dateRange |
DateRangeInput |
optional | Filters on the order's updated_at: time_from / time_to, format YYYY-MM-DD HH:mm:ss. |
side |
MarginPositionSide |
optional | Exact match: buy or sell. |
status |
MarginOrderStatus |
optional | Exact match on order status (e.g. open, completed, cancelled, rejected). |
time_in_force |
MarginOrderTimeInForce |
optional | Exact match: fok, ioc, gtc or gtd. |
type |
MarginOrderType |
optional | Exact match: market or limit. |
instrument_id |
String |
optional | Exact match on a single instrument. |
instruments_ids |
[String!] |
optional | Matches any of the listed instrument IDs. |
wallet_id |
String |
optional | Exact match on wallet. Traders default to MAIN; admins see all wallets when omitted. |
Response
| Field | Sub-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.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.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.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
subscription margin_order_update Streams the caller's margin order updates (created, edited, cancelled, executed, expired) for one wallet. One emit per order change.
open_derivatives_orders.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
wallet_id |
String |
optional | Wallet to stream. Default MAIN. |
Response
| Field | Sub-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.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.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.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://, graphql-ws protocol). Try It opens a WebSocket to this operation's endpoint and streams updates below; click Stop to end it.
query
open_margin_orders
Paginated, filterable list of the caller's open (working) margin orders, newest first by default. Traders see the MAIN wallet unless wallet_id is given. Admins may pass user_id.
open_derivatives_orders. Rate-limited (100 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
search |
String |
optional | Substring match on margin_order_id, instrument_id, user_id, margin_position_id or batch_id. |
pager |
PagerInput |
optional | Pagination: limit (default 30) and offset (default 0). |
sort |
SortInput |
optional | field and direction; serial_id descending is always applied as the final ordering. |
user_id |
String |
optional | Admin only; ignored for traders (forced to the caller). |
dateRange |
DateRangeInput |
optional | Filters on the order's created_at: time_from / time_to, format YYYY-MM-DD HH:mm:ss. |
side |
MarginPositionSide |
optional | Exact match: buy or sell. |
status |
MarginOrderStatus |
optional | Exact match on order status (e.g. open, completed, cancelled, rejected). |
time_in_force |
MarginOrderTimeInForce |
optional | Exact match: fok, ioc, gtc or gtd. |
type |
MarginOrderType |
optional | Exact match: market or limit. |
instrument_id |
String |
optional | Exact match on a single instrument. |
instruments_ids |
[String!] |
optional | Matches any of the listed instrument IDs. |
wallet_id |
String |
optional | Exact match on wallet. Traders default to MAIN; admins see all wallets when omitted. |
Response
| Field | Sub-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.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.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.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
Performance
4 ops
query user_closed_orders_stats Aggregate stats over the caller's closed orders in a date range, excluding cancelled and rejected orders: long/short counts, average order sizes, long/short volume and total trading fees.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
user_id |
String |
optional | Admin only and required for admins; ignored for traders (forced to the caller). |
instrument_ids |
[String!] |
optional | Restrict to these instrument IDs. When omitted, all instruments are included. |
date_range |
DateRangeInput |
optional | Filters on the order's updated_at: time_from / time_to, format YYYY-MM-DD HH:mm:ss. Defaults to the last 30 days. |
wallet_id |
String |
optional | Wallet to report on. Default MAIN. |
Response
| Field | Sub-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.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.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.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
query user_closed_positions_stats Stats over the caller's positions closed in a date range, split into long, short and all positions: wins/losses, win rate, average duration (seconds), total PnL (spread PnL + funding fees) and per-side instrument ranking by PnL.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
user_id |
String |
optional | Admin only and required for admins; ignored for traders (forced to the caller). |
instrument_ids |
[String!] |
optional | Restrict to these instrument IDs. When omitted, all instruments are included. |
date_range |
DateRangeInput |
optional | Filters on the position's close time (end_ts): time_from / time_to, format YYYY-MM-DD HH:mm:ss. Defaults to the last 30 days. |
wallet_id |
String |
optional | Wallet to report on. Default MAIN. |
Response
| Field | Sub-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.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.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.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
query user_pnl_ranking Realised PnL per instrument (position PnL plus funding fees) for positions the caller closed in a date range, sorted by PnL. Instruments with zero PnL are omitted.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
user_id |
String |
optional | Admin only and required for admins; ignored for traders (forced to the caller). |
instrument_ids |
[String!] |
optional | Restrict to these instrument IDs. When omitted, all instruments are included. |
date_range |
DateRangeInput |
optional | Filters on the position's close time (end_ts): time_from / time_to, format YYYY-MM-DD HH:mm:ss. Defaults to the last 30 days. |
sort |
SortDirection |
optional | ASC or DESC by PnL. Default DESC. |
wallet_id |
String |
optional | Wallet to report on. Default MAIN. |
Response
| Field | Sub-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.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.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.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
query user_trading_performace Time series of the caller's cumulative PnL (aggregated across instruments, including trading and funding fees), one point per hour or day, newest first. Hourly periodicity is limited to 31 days. Source data is cached for up to 120 s.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
user_id |
String |
optional | Admin only and required for admins; ignored for traders (forced to the caller). |
instrument_ids |
[String!] |
optional | Restrict to these instrument IDs. Inactive or deleted instruments are always skipped. |
date_range |
DateRangeInput |
optional | time_from / time_to, format YYYY-MM-DD HH:mm:ss; rounded outward to whole periods. Pass both bounds explicitly. |
limit |
Int |
optional | Accepted (default 1000) but not used by the calculation. |
periodicity |
UserTradingPerformancePeriodicity |
optional | hour or day. Default day. |
wallet_id |
String |
optional | Wallet to report on. Default MAIN. |
Response
| Field | Sub-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.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.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.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
Positions
5 ops
query
closed_margin_positions
Paginated, filterable history of the caller's closed margin positions, newest first by default. Traders see the MAIN wallet unless wallet_id is given. Admins may pass user_id.
closed_derivatives_positions.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
search |
String |
optional | Substring match on margin_position_id, instrument_id, user_id or close_reason. |
pager |
PagerInput |
optional | Pagination: limit (default 30) and offset (default 0). |
sort |
SortInput |
optional | field and direction; serial_id descending is always applied as the final ordering. total_pnl is supported. |
user_id |
String |
optional | Admin only; ignored for traders (forced to the caller). |
dateRange |
DateRangeInput |
optional | Filters on the position's close time (end_ts): time_from / time_to, format YYYY-MM-DD HH:mm:ss. |
side |
MarginPositionSide |
optional | Exact match: buy or sell. |
instrument_id |
String |
optional | Exact match on a single instrument. |
instruments_ids |
[String!] |
optional | Matches any of the listed instrument IDs. |
wallet_id |
String |
optional | Exact match on wallet. Traders default to MAIN; admins see all wallets when omitted. |
Response
| Field | Sub-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.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.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.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
subscription margin_orderbook Streams order book updates for one margin instrument. Anonymous callers get the plain book; authenticated traders get the book priced with their fee-group / volume-tier markup.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
instrument_id |
String |
required | Margin instrument ID (required); unknown IDs are rejected. |
Response
| Field | Sub-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.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.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.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://, graphql-ws protocol). Try It opens a WebSocket to this operation's endpoint and streams updates below; click Stop to end it.
subscription open_margin_position_update Streams updates to the caller's open margin positions for one wallet: full position snapshots on changes and lighter PnL-only updates between them. PnL updates stop once a position is closing.
open_derivatives_positions.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
wallet_id |
String |
optional | Wallet to stream. Default MAIN. |
Response
| Field | Sub-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.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.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.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://, graphql-ws protocol). Try It opens a WebSocket to this operation's endpoint and streams updates below; click Stop to end it.
query
open_margin_positions
Paginated, filterable list of the caller's open margin positions with live pnl / total_pnl from current prices, newest first by default. Traders see the MAIN wallet unless wallet_id is given. Admins may pass user_id.
open_derivatives_positions. Rate-limited (100 req / 60 s).Inputs
| Name | Type | Required | Description |
|---|---|---|---|
search |
String |
optional | Substring match on margin_position_id, instrument_id, user_id or close_reason. |
pager |
PagerInput |
optional | Pagination: limit (default 30) and offset (default 0). |
sort |
SortInput |
optional | field and direction; pnl and total_pnl sort on live PnL. serial_id descending is always applied as the final ordering. |
user_id |
String |
optional | Admin only; ignored for traders (forced to the caller). |
dateRange |
DateRangeInput |
optional | Filters on the position's open time (start_ts): time_from / time_to, format YYYY-MM-DD HH:mm:ss. |
side |
MarginPositionSide |
optional | Exact match: buy or sell. |
instrument_id |
String |
optional | Exact match on a single instrument. |
instruments_ids |
[String!] |
optional | Matches any of the listed instrument IDs. |
wallet_id |
String |
optional | Exact match on wallet. Traders default to MAIN; admins see all wallets when omitted. |
Response
| Field | Sub-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.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.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.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
subscription user_balance_position Streams the caller's margin account balance for one wallet (equity, free balance, PnL, used/reserved margin, margin ratio, margin call and liquidation levels) whenever it changes.
open_derivatives_positions.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
wallet_id |
String |
optional | Wallet to stream. Default MAIN. |
Response
| Field | Sub-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.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.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.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://, graphql-ws protocol). Try It opens a WebSocket to this operation's endpoint and streams updates below; click Stop to end it.
Trade
9 ops
mutation
cancel_all_margin_orders
Cancels all of the caller's open limit orders in one wallet and releases their reserved margin. Returns true; market orders are not affected.
cancel_derivatives_order.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
wallet_id |
String |
optional | Wallet whose orders are cancelled. Default MAIN. Traders cannot target internal wallets. |
Response
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.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.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.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
mutation
cancel_margin_order
Cancels one open limit order, moves it to closed orders with status cancelled and releases its reserved margin. Only limit orders can be cancelled; traders can cancel only their own. Returns true.
cancel_derivatives_order.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
margin_order_id |
String |
required | ID of the open limit order to cancel (required). |
Response
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.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.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.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
mutation
close_all_margin_positions
Closes every open position of the caller in one wallet, each with a market order in the opposite direction. Returns true. Admins must pass user_id.
create_derivatives_order.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
wallet_id |
String |
optional | Wallet whose positions are closed. Default MAIN. Traders cannot target internal wallets. |
Response
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.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.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.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
mutation
close_margin_position
Closes all or part of an open position with a market order in the opposite direction. amount takes precedence over percentage. Rejected if the remainder would fall below the instrument's minimum quantity. Returns true.
create_derivatives_order.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
margin_position_id |
String |
required | ID of the open position to close (required). |
percentage |
Percentage |
optional | Share to close: percent25, percent50, percent75, percent100 or custom. Default percent100. |
amount |
Float |
optional | Exact quantity to close; overrides percentage. Cannot exceed the position amount. |
wallet_id |
String |
optional | Wallet holding the position. Default MAIN. Traders cannot target internal wallets. |
Response
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.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.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.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
mutation
create_margin_order
Places a market or limit margin order. Market orders reserve margin up front and fail if available margin is insufficient. Limit orders need price and are capped per instrument. Returns the created order. Admins must pass user_id.
create_derivatives_order.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
quantity |
Float |
required | Order size in base units (required); rounded to the instrument step and checked against its min/max quantity. |
instrument_id |
String |
required | Margin instrument ID (required). Rejected if disabled for the caller's limit group. |
leverage |
Int |
required | Leverage (required); must be within the instrument's allowed range. |
side |
MarginPositionSide |
required | buy or sell (required). |
type |
MarginOrderType |
required | market or limit (required). |
price |
Float |
optional | Limit price; required for limit orders, ignored for market. Subject to price-collar and distance-from-market checks. |
stop_loss |
Float |
optional | Stop-loss price; must be on the correct side of the market / limit price. |
take_profit |
Float |
optional | Take-profit price; must be on the correct side of the market / limit price. |
expires_at |
String |
optional | Expiry, YYYY-MM-DD HH:mm:ss; required when time_in_force is gtd, and must be more than 30 s in the future. |
all_in |
ToggleSwitch |
optional | on sizes the pre-trade margin check from all available margin. The order's quantity itself is not changed. |
wallet_id |
String |
optional | Wallet to trade from. Default MAIN. Traders cannot use internal wallets. |
time_in_force |
MarginOrderTimeInForce |
optional | Market: ioc (default) or fok. Limit: gtc (default), gtd, or ioc. fok and limit ioc only where the instrument enables them. |
Response
| Field | Sub-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.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.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.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
mutation
edit_margin_order
Edits an open limit order's leverage, quantity, price, TP/SL and GTD expiry. Omitted TP/SL values are cleared. A leverage change is also applied to the caller's other limit orders on the instrument. Returns true. Admins must pass user_id (the order owner).
create_derivatives_order.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
margin_order_id |
String |
required | ID of the open limit order to edit (required). Only limit orders can be edited. |
leverage |
Int |
required | New leverage (required). Rejected if an open position on the instrument and wallet has a different leverage. |
quantity |
Float |
required | New quantity (required); rounded to the instrument step and checked against min/max quantity. |
price |
Float |
optional | New limit price; effectively required. Subject to price-collar and distance-from-market checks. |
stop_loss |
Float |
optional | New stop-loss price. Omit or send null to remove it. |
take_profit |
Float |
optional | New take-profit price. Omit or send null to remove it. |
expires_at |
String |
optional | New expiry, YYYY-MM-DD HH:mm:ss; applied only to gtd orders and must be more than 30 s in the future. |
Response
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.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.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.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
query estimate_margin_user_position Pre-trade estimate for a prospective order: order value, fee and fee breakdown, required and available margin, and min/max position size. Nothing is placed or reserved. Admins must pass user_id.
estimate_derivatives_order.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
instrument_id |
String |
required | Margin instrument ID (required). |
quantity |
Float |
required | Order size in base units (required). |
leverage |
Int |
required | Leverage to estimate with (required). |
side |
MarginPositionSide |
required | buy or sell (required). |
limit_price |
Float |
optional | Reference price for the estimate; when omitted, ask (buy) or bid (sell) is used. 0 is rejected. |
use_cached_price |
ToggleSwitch |
optional | on uses the last stored price instead of the order-book VWAP for quantity. |
wallet_id |
String |
optional | Wallet to estimate against. Default MAIN. Traders cannot use internal wallets. |
Response
| Field | Sub-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 |
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
}
}
}
Code Examples
curl -X POST 'https://margin-trading-service.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 } } }","variables":{}}'
import requests
url = "https://margin-trading-service.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 } } }""",
"variables": {},
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://margin-trading-service.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 } } }`,
variables: {},
}),
});
const data = await response.json();
console.log(data);Try It
subscription
margin_user_update
Streams account notifications for the caller's wallet, such as margin-call and liquidation alerts (title, body, trigger).
open_derivatives_positions.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
wallet_id |
String |
optional | Wallet to stream. Default MAIN. |
Response
| Field | Sub-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.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.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.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://, graphql-ws protocol). Try It opens a WebSocket to this operation's endpoint and streams updates below; click Stop to end it.
mutation update_open_margin_position Updates an open position's leverage and its take-profit / stop-loss. A leverage change is also applied to the caller's open limit orders on that instrument and wallet. Returns the updated position.
update_open_derivatives_position.Inputs
| Name | Type | Required | Description |
|---|---|---|---|
margin_position_id |
String |
required | ID of the open position to update (required). |
leverage |
Int |
required | Leverage (required; send the current value to keep it). Must be within the instrument's range. |
stop_loss |
Float |
optional | Stop-loss price; omit to keep the current value, null to remove. Must be on the correct side of the market. |
take_profit |
Float |
optional | Take-profit price; omit to keep the current value, null to remove. Must be on the correct side of the market. |
Response
| Field | Sub-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.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.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.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);