Trading Data

Market data, instruments, pairs, prices, and trade history

Trading Data Collection

This guide covers retrieving market data, instruments, pairs, prices, and trade history.

Overview

Before trading, you need to understand available markets and their properties. This involves:

  1. Fetching available instruments (assets)
  2. Fetching trading pairs and their constraints
  3. Retrieving price data
  4. Viewing trade history

Prerequisites

  • Authenticated session (JWT or API key)
  • CanRead permission

Step 1: List Available Instruments

Retrieve all tradable instruments.

Endpoint: GET /api/rest/v1/instruments

Request

curl -X GET "https://api.t-dx.com/api/rest/v1/instruments" \
  -H "Authorization: Bearer <access-token>"

Query Parameters

This endpoint supports standard pagination, sorting, and filtering.

Response (200 OK)

{
  "result": [
    {
      "id": "7a3fae7e-5a17-4931-821c-54b021f643da",
      "symbol": "BTC",
      "type": "TYPE_CRYPTO_CURRENCY",
      "decimals": 8,
      "blockchain": "bitcoin",
      "nativeCurrency": true,
      "depositEnabled": true,
      "withdrawalEnabled": true,
      "createdAt": "2023-01-01T00:00:00Z",
      "updatedAt": "2023-01-01T00:00:00Z"
    },
    {
      "id": "8b4gbf8f-6b28-5042-932d-65c132g754eb",
      "symbol": "CHF",
      "type": "TYPE_CURRENCY",
      "decimals": 2,
      "depositEnabled": true,
      "withdrawalEnabled": true,
      "createdAt": "2023-01-01T00:00:00Z",
      "updatedAt": "2023-01-01T00:00:00Z"
    }
  ],
  "pagination": {
    "cursors": {
      "self": "eyJTb3J0cyI6W10sIkZpbHRlcnMiOltdLCJJc0ZpcnN0Ijp0cnVlfQ==",
      "first": "eyJTb3J0cyI6W10sIkZpbHRlcnMiOltdLCJJc0ZpcnN0Ijp0cnVlfQ==",
      "last": "",
      "next": "",
      "previous": ""
    }
  }
}

Instrument Types

TypeDescription
TYPE_CURRENCYFiat currency (CHF, EUR, USD)
TYPE_CRYPTO_CURRENCYCryptocurrency (BTC, ETH)
TYPE_STOCKTokenized equity
TYPE_DEBTDebt instrument
TYPE_FUND_SHARESFund shares

Step 2: List Trading Pairs

Retrieve all available trading pairs with their constraints.

Endpoint: GET /api/rest/v1/pairs

Request

curl -X GET "https://api.t-dx.com/api/rest/v1/pairs" \
  -H "Authorization: Bearer <access-token>"

Response (200 OK)

{
  "result": [
    {
      "id": "79b1db24-7dc8-45d1-ab77-44318f872a8e",
      "baseId": "7a3fae7e-5a17-4931-821c-54b021f643da",
      "quoteId": "8b4gbf8f-6b28-5042-932d-65c132g754eb",
      "symbol": "BTC/CHF",
      "status": "STATUS_OPEN",
      "tradable": true,
      "otcTradable": true,
      "minOrderQuantity": "0.0001",
      "maxOrderQuantity": "100",
      "priceDecimalPoints": 2,
      "priceTicks": "0.01",
      "quantityDecimalPoints": 8,
      "quantityTicks": "0.00000001",
      "referencePrice": "45000.00",
      "createdAt": "2023-01-01T00:00:00Z",
      "updatedAt": "2023-01-01T00:00:00Z"
    }
  ],
  "pagination": {
    "cursors": {
      "self": "eyJTb3J0cyI6W10sIkZpbHRlcnMiOltdLCJJc0ZpcnN0Ijp0cnVlfQ==",
      "first": "eyJTb3J0cyI6W10sIkZpbHRlcnMiOltdLCJJc0ZpcnN0Ijp0cnVlfQ==",
      "last": "",
      "next": "",
      "previous": ""
    }
  }
}

Understanding Pair Constraints

FieldMeaningExample
minOrderQuantityMinimum order size0.0001 BTC
maxOrderQuantityMaximum order size100 BTC
priceDecimalPointsPrice precision2 → 45000.00
priceTicksMinimum price increment0.01
quantityDecimalPointsQuantity precision8 → 0.00000001
quantityTicksMinimum quantity increment0.00000001

Step 3: Get Current Prices

Retrieve current market prices.

Endpoint: GET /api/rest/v1/prices

Request

curl -X GET "https://api.t-dx.com/api/rest/v1/prices" \
  -H "Authorization: Bearer <access-token>"

Response (200 OK)

{
  "result": [
    {
      "pairId": "79b1db24-7dc8-45d1-ab77-44318f872a8e",
      "bid": "44950.00",
      "ask": "45050.00",
      "last": "45000.00",
      "timestamp": "2024-01-15T14:30:00Z"
    }
  ],
  "pagination": {
    "hasNextPage": false,
    "cursor": ""
  }
}

Step 4: Get Public Marketplace Trades

View recent public trades for a pair.

Endpoint: GET /api/rest/v1/marketplace/trades

Request

curl -X GET "https://api.t-dx.com/api/rest/v1/marketplace/trades?pairId=79b1db24-7dc8-45d1-ab77-44318f872a8e&limit=50" \
  -H "Authorization: Bearer <access-token>"

Query Parameters

This endpoint supports standard pagination and sorting.

ParameterTypeRequiredDescription
pairIdUUIDYesPair ID to get trades for

Response (200 OK)

{
  "result": [
    {
      "id": "trade-uuid-1",
      "pairId": "79b1db24-7dc8-45d1-ab77-44318f872a8e",
      "side": "SIDE_BUY",
      "quantity": "0.25",
      "originalQuantity": "0.50",
      "cumulativeQuantity": "0.25",
      "price": "45000.00",
      "grossAmount": "11250.00",
      "isTaker": true,
      "executedAt": "2024-01-15T14:29:55Z",
      "createdAt": "2024-01-15T14:29:55Z",
      "updatedAt": "2024-01-15T14:29:55Z"
    },
    {
      "id": "trade-uuid-2",
      "pairId": "79b1db24-7dc8-45d1-ab77-44318f872a8e",
      "side": "SIDE_SELL",
      "quantity": "0.10",
      "originalQuantity": "0.10",
      "cumulativeQuantity": "0.10",
      "price": "44995.00",
      "grossAmount": "4499.50",
      "isTaker": false,
      "executedAt": "2024-01-15T14:29:30Z",
      "createdAt": "2024-01-15T14:29:30Z",
      "updatedAt": "2024-01-15T14:29:30Z"
    }
  ],
  "pagination": {
    "hasNextPage": false,
    "cursor": ""
  }
}

Marketplace Trade Fields (Anonymized)

FieldTypeDescription
idUUIDTrade identifier
pairIdUUIDTrading pair ID
sideenumSIDE_BUY or SIDE_SELL
quantitydecimalQuantity in this trade
originalQuantitydecimalOriginal order quantity
cumulativeQuantitydecimalTotal executed quantity
pricedecimalExecution price
grossAmountdecimalAmount in quote currency
isTakerbooleanWhether this was a taker trade
executedAttimestampExecution time
createdAttimestampCreation time
updatedAttimestampLast update time

Step 5: Get Your Trade History

View your own executed trades.

Endpoint: GET /api/rest/v1/trades

Request

curl -X GET "https://api.t-dx.com/api/rest/v1/trades?subAccountId=7376524e-6b6b-4137-9719-7e07a7709804" \
  -H "Authorization: Bearer <access-token>"

Query Parameters

This endpoint supports standard pagination, sorting, and filtering.

ParameterTypeDescription
subAccountIdUUIDFilter by sub-account (optional)

Supported filters: side, pair_id

Response (200 OK)

{
  "result": [
    {
      "id": "9120c519-9b22-4afe-9c73-998638d83e4a",
      "orderId": "2312bb39-a624-4785-aaf7-49b09034b560",
      "pairId": "79b1db24-7dc8-45d1-ab77-44318f872a8e",
      "subAccountId": "7376524e-6b6b-4137-9719-7e07a7709804",
      "clientAccountId": "8aee564e-2eb1-4a57-b686-05476c2cfd93",
      "userId": "c43f7356-ad91-48bf-b647-96aa3ec59cf2",
      "side": "SIDE_BUY",
      "quantity": "0.50",
      "originalQuantity": "1.00",
      "cumulativeQuantity": "0.50",
      "price": "45000.00",
      "grossAmount": "22500.00",
      "transactionFee": "22.50",
      "transactionFeeRate": "0.001",
      "swissStampTax": "3.38",
      "swissStampTaxRate": "0.00015",
      "isTaker": true,
      "executedAt": "2024-01-15T10:30:00Z",
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "cursors": {
      "self": "eyJTb3J0cyI6W10sIkZpbHRlcnMiOltdLCJJc0ZpcnN0Ijp0cnVlfQ==",
      "first": "eyJTb3J0cyI6W10sIkZpbHRlcnMiOltdLCJJc0ZpcnN0Ijp0cnVlfQ==",
      "last": "",
      "next": "",
      "previous": ""
    }
  }
}

Trade Fields

FieldTypeDescription
idUUIDTrade identifier
orderIdUUIDParent order ID
pairIdUUIDTrading pair ID
subAccountIdUUIDSub-account ID
clientAccountIdUUIDClient account ID
userIdUUIDUser who created the order
sideenumSIDE_BUY or SIDE_SELL
quantitydecimalQuantity matched in this trade
originalQuantitydecimalOriginal order quantity
cumulativeQuantitydecimalTotal executed quantity of the order
pricedecimalExecution price
grossAmountdecimalAmount in quote currency (quantity × price)
transactionFeedecimal (optional)Trading fee
transactionFeeRatedecimal (optional)Fee rate applied
swissStampTaxdecimal (optional)Swiss stamp tax if applicable
swissStampTaxRatedecimal (optional)Stamp tax rate
isTakerbooleanWhether this was a taker trade
executedAttimestampExecution time
createdAttimestampCreation time
updatedAttimestampLast update time

Step 6: Get Trade Volumes

Get aggregated trade volumes by pair over a date range.

Endpoint: GET /api/rest/v1/trade-volumes

Request

curl -X GET "https://api.t-dx.com/api/rest/v1/trade-volumes?startDate=2024-01-01T00:00:00Z&endDate=2024-01-31T23:59:59Z" \
  -H "Authorization: Bearer <access-token>"

Query Parameters

This endpoint supports standard pagination and sorting.

ParameterTypeRequiredDescription
startDatetimestampYesStart of date range
endDatetimestampYesEnd of date range

Response (200 OK)

{
  "result": [
    {
      "pairId": "79b1db24-7dc8-45d1-ab77-44318f872a8e",
      "symbol": "BTC/CHF",
      "volume": "125.50",
      "participants": {
        "volume": "62.75",
        "maxDaily": "12.50"
      },
      "venue": {
        "volume": "62.75",
        "maxDaily": "15.00"
      }
    }
  ],
  "pagination": {
    "cursors": {
      "self": "eyJTb3J0cyI6W10sIkZpbHRlcnMiOltdLCJJc0ZpcnN0Ijp0cnVlfQ==",
      "first": "eyJTb3J0cyI6W10sIkZpbHRlcnMiOltdLCJJc0ZpcnN0Ijp0cnVlfQ==",
      "last": "",
      "next": "",
      "previous": ""
    }
  }
}

TradeVolume Fields

FieldTypeDescription
pairIdUUIDTrading pair ID
symbolstringPair symbol (e.g., "BTC/CHF")
volumedecimalTotal volume across all parties
participantsobjectParticipant volume data
participants.volumedecimalTotal participant volume over the range
participants.maxDailydecimalLargest daily participant volume
venueobjectVenue volume data
venue.volumedecimalTotal venue volume over the range
venue.maxDailydecimalLargest daily venue volume

Step 7: Get a Specific Trade

Endpoint: GET /api/rest/v1/trades/{id}

Request

curl -X GET "https://api.t-dx.com/api/rest/v1/trades/9120c519-9b22-4afe-9c73-998638d83e4a" \
  -H "Authorization: Bearer <access-token>"

Response (200 OK)

{
  "result": {
    "id": "9120c519-9b22-4afe-9c73-998638d83e4a",
    "orderId": "2312bb39-a624-4785-aaf7-49b09034b560",
    "pairId": "79b1db24-7dc8-45d1-ab77-44318f872a8e",
    "subAccountId": "7376524e-6b6b-4137-9719-7e07a7709804",
    "clientAccountId": "8aee564e-2eb1-4a57-b686-05476c2cfd93",
    "userId": "c43f7356-ad91-48bf-b647-96aa3ec59cf2",
    "side": "SIDE_BUY",
    "quantity": "0.50",
    "originalQuantity": "1.00",
    "cumulativeQuantity": "0.50",
    "price": "45000.00",
    "grossAmount": "22500.00",
    "transactionFee": "22.50",
    "transactionFeeRate": "0.001",
    "swissStampTax": "3.38",
    "swissStampTaxRate": "0.00015",
    "isTaker": true,
    "executedAt": "2024-01-15T10:30:00Z",
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-01-15T10:30:00Z"
  }
}

Error Scenarios

StatusCodeDescription
401UNAUTHENTICATEDInvalid or expired token
404NOT_FOUNDPair, instrument, or trade not found

Related




  © 2025 Taurus SA. All rights reserved.