Skip to main content
GET
/
trades
Fetch trades by markets, wallets and/or orders
curl --request GET \
  --url https://sandbox.api.btdx.io/trades \
  --header 'authorization: <authorization>'
{
  "_meta": {
    "_count": 123,
    "_page": {
      "_pageNumber": 123,
      "_pageSize": 123,
      "_totalElements": 123,
      "_totalPages": 123
    }
  },
  "trades": [
    {
      "id": "<string>",
      "walletId": "<string>",
      "market": {
        "_ref": "<string>",
        "_ids": [
          "<string>"
        ]
      },
      "order": {
        "_ref": "<string>",
        "_ids": [
          "<string>"
        ]
      },
      "outcomeId": "<string>",
      "price": 123,
      "stake": 123,
      "profitLoss": 123,
      "createdAt": "2023-11-07T05:31:56Z",
      "modifiedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "orders": [
    {
      "id": "<string>",
      "market": {
        "_ref": "<string>",
        "_ids": [
          "<string>"
        ]
      },
      "outcomeId": "<string>",
      "outcomeTitle": "<string>",
      "price": 123,
      "stake": 123,
      "stakeUnmatched": 123,
      "stakeVoided": 123,
      "reference": "<string>"
    }
  ],
  "markets": [
    {
      "id": "<string>",
      "name": "<string>",
      "published": true,
      "suspended": true,
      "lockAt": "2023-11-07T05:31:56Z",
      "settledAt": "2023-11-07T05:31:56Z",
      "event": {
        "_ref": "<string>",
        "_ids": [
          "<string>"
        ]
      }
    }
  ],
  "events": [
    {
      "id": "<string>",
      "eventGroup": {
        "_ref": "<string>",
        "_ids": [
          "<string>"
        ]
      },
      "name": "<string>",
      "code": "<string>",
      "expectedStartTime": "2023-11-07T05:31:56Z",
      "active": true
    }
  ],
  "eventGroups": [
    {
      "id": "<string>",
      "name": "<string>",
      "subcategory": {
        "_ref": "<string>",
        "_ids": [
          "<string>"
        ]
      }
    }
  ],
  "subcategories": [
    {
      "id": "<string>",
      "name": "<string>",
      "category": {
        "_ref": "<string>",
        "_ids": [
          "<string>"
        ]
      }
    }
  ],
  "categories": [
    {
      "id": "<string>",
      "name": "<string>"
    }
  ]
}

Headers

authorization
string
required

Header with the accessToken for the current session

Query Parameters

marketIds
string[]

list of market ids

walletIds
string[]

list of wallet ids

orderIds
string[]

list of order ids

fromCreatedAt
string<date-time>

beginning of the creation date range filter (inclusive)

toCreatedAt
string<date-time>

end of the creation date range filter (inclusive)

page
integer
default:0

Zero-based page index (0..N)

size
integer
default:20

The size of the page to be returned

sort
string[]

Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Response

OK

_meta
object
trades
object[]
orders
object[]
markets
object[]
events
object[]
eventGroups
object[]
subcategories
object[]
categories
object[]