Convert Trade
ConvertTradeCreate
POST /viewer/trade
Description
- create convert trade
- the generated API key needs to add scopes about order create
Request
Request Parameters
Name | Type | Require | Description | Example |
---|---|---|---|---|
quote_id | string | true | quote id | "97611740-1ae5-4989-812d-2cb1566fd0f3" |
account_type | string | false | account type,default FUND | "FUND" |
- support http parameter transmission method: application/json
- quote_id get from ConvertQuote interface
- account_type should be one of
FUND
,SPOT
, andALL
, and the default value isFUND
- if you set account_type to
ALL
, the system will give priority to using funds in theFUND
account, and if the account is not enough, the difference will be made up from theSPOT
account
Response
- Viewer
- JSON Schema
Loading ....
{
"title": "ConvertTrade",
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "trade id",
"examples": [
11873
]
},
"from_asset": {
"type": "string",
"description": "asset symbol",
"examples": [
"USDT"
]
},
"to_asset": {
"type": "string",
"description": "asset symbol",
"examples": [
"BTC"
]
},
"ts": {
"type": "number",
"description": "trade timestamp",
"examples": [
1741857252000
]
},
"px": {
"type": "string",
"description": "price",
"examples": [
"0.00000578"
]
},
"from_sz": {
"type": "string",
"description": "from size",
"examples": [
"10.5"
]
},
"to_sz": {
"type": "string",
"description": "to size",
"examples": [
"0.00006078"
]
},
"state": {
"type": "string",
"description": "trade state",
"enum": [
"PENDING",
"FULLFILLED",
"FAILED"
],
"examples": [
"FULLFILLED"
]
},
"acct_type": {
"type": "string",
"description": "account type",
"enum": [
"SPOT",
"FUND",
"ALL"
],
"examples": [
"FUND"
]
},
"quote_id": {
"type": "string",
"description": "quote id",
"examples": [
"97611740-1ae5-4989-812d-2cb1566fd0f3"
]
}
},
"additionalProperties": false
}
GetConvertTrades
GET /viewer/trades
Description
- get convert trade history
- the generated API key needs to add scopes about trade read
Request
Request Parameters
Name | Type | Require | Description | Example |
---|---|---|---|---|
page_token | string | false | request page after this page token | |
limit | number | false | Default 100, Max 200 |
- support two http parameter transmission methods: application/json and query params
- page_token is the page number, which is based on decimal numbers and is encoded through base64.
Response
- Viewer
- JSON Schema
Loading ....
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ConvertTrades",
"type": "array",
"items": {
"type": "object",
"title": "ConvertTrade",
"properties": {
"id": {
"type": "number",
"description": "trade id",
"examples": [
11873
]
},
"from_asset": {
"type": "string",
"description": "asset symbol",
"examples": [
"USDT"
]
},
"to_asset": {
"type": "string",
"description": "asset symbol",
"examples": [
"BTC"
]
},
"ts": {
"type": "number",
"description": "trade timestamp",
"examples": [
1741857252000
]
},
"px": {
"type": "string",
"description": "price",
"examples": [
"0.00000578"
]
},
"from_sz": {
"type": "string",
"description": "from size",
"examples": [
"10.5"
]
},
"to_sz": {
"type": "string",
"description": "to size",
"examples": [
"0.00006078"
]
},
"state": {
"type": "string",
"description": "trade state",
"enum": [
"PENDING",
"FULLFILLED",
"FAILED"
],
"examples": [
"FULLFILLED"
]
},
"acct_type": {
"type": "string",
"description": "account type",
"enum": [
"SPOT",
"FUND",
"ALL"
],
"examples": [
"FUND"
]
},
"quote_id": {
"type": "string",
"description": "quote id",
"examples": [
"97611740-1ae5-4989-812d-2cb1566fd0f3"
]
}
}
},
"additionalItems": false
}
GetConvertTradeDetail
GET /viewer/trade
Description
- get convert trade detail
- the generated API key needs to add scopes about trade read
Request
Request Parameters
Name | Type | Require | Description | Example |
---|---|---|---|---|
id | number | false | Either id or quote_id is required | 11873 |
quote_id | string | false | Either id or quote_id is required | "97611740-1ae5-4989-812d-2cb1566fd0f3" |
- support two http parameter transmission methods: application/json and query params
- id and quote_id are mutually exclusive, only one of them can be passed on
- quote_id get from ConvertQuote interface
Response
- Viewer
- JSON Schema
Loading ....
{
"title": "ConvertTrade",
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "trade id",
"examples": [
11873
]
},
"from_asset": {
"type": "string",
"description": "asset symbol",
"examples": [
"USDT"
]
},
"to_asset": {
"type": "string",
"description": "asset symbol",
"examples": [
"BTC"
]
},
"ts": {
"type": "number",
"description": "trade timestamp",
"examples": [
1741857252000
]
},
"px": {
"type": "string",
"description": "price",
"examples": [
"0.00000578"
]
},
"from_sz": {
"type": "string",
"description": "from size",
"examples": [
"10.5"
]
},
"to_sz": {
"type": "string",
"description": "to size",
"examples": [
"0.00006078"
]
},
"state": {
"type": "string",
"description": "trade state",
"enum": [
"PENDING",
"FULLFILLED",
"FAILED"
],
"examples": [
"FULLFILLED"
]
},
"acct_type": {
"type": "string",
"description": "account type",
"enum": [
"SPOT",
"FUND",
"ALL"
],
"examples": [
"FUND"
]
},
"quote_id": {
"type": "string",
"description": "quote id",
"examples": [
"97611740-1ae5-4989-812d-2cb1566fd0f3"
]
}
},
"additionalProperties": false
}