[GET] GET Spot exchange limit orders

Allow user to get their orders with particular ticker Query params

Table of Contents

Changelogs

Version

Date

Changes by

Description of change

V1.0

Jul 18, 2024

Que Nguyen

  • Added Table of Contents.

  • Added Changelogs.

Order Resource

OrderId number

订单唯一标识符

Order unique Identifier

订单唯一标识符

Status text - enum (Active - Completed - Cancelled)

状态 文本 - 枚举(有效 - 已完成 - 取消)

Order status

订单类型

OrderId number

订单唯一标识符

Order unique Identifier

订单唯一标识符

Side text - enum (Buy - Sell)

订单方 文本类型 - 枚举(买方 - 卖方)

Order side enum

订单方枚举

Type text

订单类型

Order type: Limit

订单类型:限制

TimeInForce text

有效时间

Time in force:

有效时间 - 在进行交易时使用的一种特殊指标,用于指示订单在执行或到期前将保持多长时间有效

  • GTC: Good till Cancel - 取消前有效

Price number

价格

Order Price

订单价格

Quantity number

数量

Order’s quantity

订单数量

ActiveQuantity number

有效数量

Order’s active quantity

订单有效数量

FilledQuantity number

已完成订单量

Order’s filled quantity

已完成订单量

Currency text

货币

Currency code

货币代码

CreatedTime datetime

创建时间

Order’s created time

订单创建时间

FilledTime datetime

完成时间

Order’s filled time

订单完成时间

CancelledTime datetime

取消时间

Order’s cancellation time

订单取消时间

{ "OrderId": 1677, "Status": "Active", "TickerId": "MY.24.GTM.t", "Side": "Buy", "Type": "Limit", "TimeInForce": "GTC", "Price": 100, "Quantity": 10, "ActiveQuantity": 5, "FilledQuantity": 5, "Currency": "USD", "CreatedTime": "2024-07-24T04:10:24.44Z", "FilledTime": "2024-07-24T06:10:24.44Z", "CancelledTime": null }

API Definition

GET /public/v2/exchange/spot/limit-orders

Request

Headers

Content-Type

application/json

Authorization

Bearer {{access_token}}

Query Parameters

TickerId (required) text

绿证行情唯一标识符 (必须)

Ticker Unique Identifier

绿证行情唯一标识符,可类比“股票代码”,组成格式: “国家代码.生效年.能源类型.注册处”

Status (optional) text

状态(可选)文本

Order status

订单状态

Side (optional) text - enum (Buy - Sell)

订单方(可选)文本 - 枚举(买方 - 卖方)

Order Side

订单方

CurrentPage (optional) integer

The page number to retrieve the next set of inverters. The number has to be greater than 1, and will default to 1.

ItemsPerPage (optional) integer

The maximum number of inverter brands to return per page. This number can range from 10 to 100 and defaults to 100.

curl --location 'https://uat-api.redex.eco/public/v2/exchanges/spots/limit-orders?Status=Active&Side=Buy&TickerId=MY.24.SLR.i&CurrentPage=1&ItemsPerPage=1' \ --header 'accept: application/json' \ --header 'Authorization: Bearer {{access_token}}'

 

Response

Response Body

Data object collection - Order Resource

A collection of objects - Order Resource

Errors list of error objects

Please see "Getting Started - #Error Object" for more details

请查看Getting Started - #Error Object以获得更多信息。

Meta pagination resource

Return Pagination Resource

返回分页信息

StatusCode integer

Http Status codes standard. Example 200, 201, 400, 422.

http状态码,如200,201,400, 422

Message text

Response message: Success or error message.

返回成功或错误的信息。

200 Success

{ "Data": [ { "OrderId": 1677, "Status": "Active", "TickerId": "MY.24.GTM.t", "Side": "Buy", "Type": "Limit", "TimeInForce": "GTC", "Price": 100, "Quantity": 10, "ActiveQuantity": 10, "FilledQuantity": 0, "Currency": "USD", "CreatedTime": "2024-07-24T04:10:24.44Z", "FilledTime": null, "CancelledTime": null }, { "OrderId": 1577, "Status": "Completed", "TickerId": "SG.24.SLR.t", "Side": "Buy", "Type": "Limit", "TimeInForce": "GTC", "Price": 100, "Quantity": 100, "ActiveQuantity": 50, "FilledQuantity": 50, "Currency": "USD", "CreatedTime": "2024-06-24T04:10:24.44Z", "FilledTime": "2024-06-24T05:10:24.44Z", "CancelledTime": null }, { "OrderId": 1477, "Status": "Cancelled", "TickerId": "MY.24.GTM.t", "Side": "Sell", "Type": "Limit", "TimeInForce": "GTC", "Price": 100, "Quantity": 10, "ActiveQuantity": 10, "FilledQuantity": 0, "Currency": "USD", "CreatedTime": "2024-07-24T04:10:24.44", "FilledTime": null, "CancelledTime": "2024-07-25T04:10:24.44" } ], "StatusCode": 200, "Errors": null, "Meta": { "CurrentPage": 1, "TotalPage": 1, "TotalItems": 2, "ItemsPerPage": 10 }, "Message": "Success" }

 

400 Bad Request

 

422 Unprocessable Entity

 

 

Rate limit

Rate Limit Algorithm: Fixed Window

In fixed window rate limiting, a fixed time window (e.g., one minute, one hour) is used to track the number of requests or actions allowed within that window. Requests exceeding the limit are either rejected or throttled until the window resets.

Rate Limiting Overview

Our API employs rate limiting to ensure fair usage and protect the performance and availability of the service. Combination of Global Policy and Operation Policy

Global Policy

  • Rate Limit: 3000 requests per 5 minute(s)

  • Renewal Period: 300 second(s)

  • Key: IP Address

  • Increment Condition: Any Request

Operation Policy

  • Rate Limit: 60requests per 1 minute(s)

  • Renewal Period: 60 second(s)

  • Key: accound-id business account Id.

  • Increment Condition: Any Request.

Rate Limit Details

  1. Rate Limit by Key:

    1. Key: This ensures that rate limits are applied uniquely for each business account id.

    2. Request Limit: Each key is allowed to make up to 60 requests per minute.

    3. Reset Interval: The limit resets every 60 seconds.

  2. Response Headers:

    1. Retry-After: Sent when the rate limit is exceeded, indicating how long to wait before making another request.

Exceeding the Rate Limit

When the rate limit is exceeded, the API will return a 429 Too Many Requests status code. The response will include a Retry-After header specifying the number of seconds to wait before making a new request.

Example Response When Rate Limit is Exceeded