mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 03:35:51 +00:00
inc'd feedback
This commit is contained in:
@@ -2,15 +2,13 @@
|
|||||||
|
|
||||||
In addition to providing data about the XRP Ledger network and its accounts and transactions, XRP Charts also provides [XRP market data](https://xrpcharts.ripple.com/#/xrp-markets) from external exchanges. This tutorial describes how to have your exchange and its XRP trade and order book data listed on XRP Charts.
|
In addition to providing data about the XRP Ledger network and its accounts and transactions, XRP Charts also provides [XRP market data](https://xrpcharts.ripple.com/#/xrp-markets) from external exchanges. This tutorial describes how to have your exchange and its XRP trade and order book data listed on XRP Charts.
|
||||||
|
|
||||||
To enable XRP Charts to list your exchange, complete the following tasks:
|
To enable XRP Charts to list your exchange, you'll need to make the following data available. Your exchange may have existing RESTful API endpoints that can deliver this data. If so, there may be little to no development effort required on your part to complete tasks 1 and 2.
|
||||||
|
|
||||||
1. [Provide a Recently Executed Trades RESTful API endpoint](#provide-a-recently-executed-trades-endpoint).
|
1. [Provide a Recently Executed Trades RESTful API endpoint](#provide-a-recently-executed-trades-endpoint).
|
||||||
|
|
||||||
2. [Provide a Current Order Book RESTful API endpoint](#provide-a-current-order-book-endpoint).
|
2. [Provide a Current Order Book RESTful API endpoint](#provide-a-current-order-book-endpoint).
|
||||||
|
|
||||||
3. [Send an exchange listing request to XRP Charts](#send-an-exchange-listing-request-to-xrp-charts).
|
Then, you'll need to [send an exchange listing request to XRP Charts](#send-an-exchange-listing-request-to-xrp-charts).
|
||||||
|
|
||||||
Your exchange may have existing RESTful API endpoints that can deliver data in the formats described in this document. If so, there may be little to no development effort required on your part to complete tasks 1 and 2.
|
|
||||||
|
|
||||||
If you have any questions about endpoint specifications, contact xxx@xxxxx.com. ***TODO: do we want to provide a way for them to contact us for dev support?***
|
If you have any questions about endpoint specifications, contact xxx@xxxxx.com. ***TODO: do we want to provide a way for them to contact us for dev support?***
|
||||||
|
|
||||||
@@ -21,7 +19,7 @@ Provide a RESTful API endpoint that returns the most recent 500-1,000 individual
|
|||||||
|
|
||||||
To ensure that it doesn't miss a trade, XRP Charts queries the endpoint frequently, between every 5 and 30 seconds, aiming to get responses that have overlapping trade data. Ensure that any rate limit enforced by your endpoint can accommodate this query frequency. XRP Charts records unique trade data only, even if it gets overlapping trades.
|
To ensure that it doesn't miss a trade, XRP Charts queries the endpoint frequently, between every 5 and 30 seconds, aiming to get responses that have overlapping trade data. Ensure that any rate limit enforced by your endpoint can accommodate this query frequency. XRP Charts records unique trade data only, even if it gets overlapping trades.
|
||||||
|
|
||||||
If XRP Charts needs to query your endpoint at a frequency that exceeds your rate limit, XRP Charts may request that you adjust the rate limit or provide the `last_tid` parameter. ***TODO: okay to state this? accurate?***
|
If XRP Charts needs to query your endpoint at a frequency that exceeds your rate limit, XRP Charts may request that you adjust the rate limit or provide the `last_tid` parameter.
|
||||||
|
|
||||||
|
|
||||||
### Request Format
|
### Request Format
|
||||||
@@ -34,7 +32,7 @@ GET {api_base_url}/v1/trades
|
|||||||
|
|
||||||
#### Authentication
|
#### Authentication
|
||||||
|
|
||||||
We prefer to work with a publicly accessible endpoint.
|
XRP Charts prefers to work with a publicly accessible endpoint.
|
||||||
|
|
||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
@@ -51,13 +49,11 @@ Provide parameters that help XRP Charts filter trades returned in the response.
|
|||||||
|
|
||||||
A successful response must be a JSON array of objects, one for each trade. The parameter field names are examples. You can use other names. Your endpoint doesn't have to provide the optional parameters, but they are useful.
|
A successful response must be a JSON array of objects, one for each trade. The parameter field names are examples. You can use other names. Your endpoint doesn't have to provide the optional parameters, but they are useful.
|
||||||
|
|
||||||
***TODO: `tid` should be required, is that right? Or is there some other way to determine uniqueness?***
|
|
||||||
|
|
||||||
| Field | Type | Description |
|
| Field | Type | Description |
|
||||||
|:------------|:-----------------|:--------------------------------------------|
|
|:------------|:-----------------|:--------------------------------------------|
|
||||||
| `price` | String or Number | Exchange rate of the trade. |
|
| `price` | String or Number | Exchange rate of the trade. |
|
||||||
| `amount` | String or Number | Amount of XRP bought or sold. |
|
| `amount` | String or Number | Amount of XRP bought or sold. |
|
||||||
| `timestamp` | String | Time at which the trade was executed in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) or [Unix time](https://en.wikipedia.org/wiki/Unix_time) format. ***TODO: just making sure - either format okay?*** |
|
| `timestamp` | String | Time at which the trade was executed in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) date-time format or [Unix time](https://en.wikipedia.org/wiki/Unix_time) format. |
|
||||||
| `tid` | Integer | _(Optional)_ Unique identifier of the trade. Ideally, make this a sequential integer. |
|
| `tid` | Integer | _(Optional)_ Unique identifier of the trade. Ideally, make this a sequential integer. |
|
||||||
| `type` | String | _(Optional)_ Type of trade. For example, valid values can include `buy` and `sell`. |
|
| `type` | String | _(Optional)_ Type of trade. For example, valid values can include `buy` and `sell`. |
|
||||||
| `size` | String or Number | _(Optional)_ Amount of counter currency traded. |
|
| `size` | String or Number | _(Optional)_ Amount of counter currency traded. |
|
||||||
@@ -66,8 +62,6 @@ A successful response must be a JSON array of objects, one for each trade. The p
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
***TODO: examples below okay - esp use of `limit` in URL and `count` in response message?***
|
|
||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -77,26 +71,28 @@ GET https://api.example.com/v1/trades?market=xrp_btc&last_tid=75208825&limit=500
|
|||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```json
|
||||||
[
|
{
|
||||||
{
|
"trades":[
|
||||||
"tid":75209326,
|
{
|
||||||
"type":"buy",
|
"tid":75209326,
|
||||||
"price":"0.57201",
|
"type":"buy",
|
||||||
"amount":"4954.0744",
|
"price":"0.57201",
|
||||||
"size":"2833.7801",
|
"amount":"4954.0744",
|
||||||
"timestamp":"2018-10-01T12:35:11.000Z"
|
"size":"2833.7801",
|
||||||
},
|
"timestamp":"2018-10-01T12:35:11.000Z"
|
||||||
...
|
},
|
||||||
{
|
...
|
||||||
"tid":75208826,
|
{
|
||||||
"type":"sell",
|
"tid":75208826,
|
||||||
"price":"0.57201",
|
"type":"sell",
|
||||||
"amount":"4954.0744",
|
"price":"0.57201",
|
||||||
"size":"2833.7801",
|
"amount":"4954.0744",
|
||||||
"timestamp":"2018-10-01T12:31:16.000Z"
|
"size":"2833.7801",
|
||||||
}
|
"timestamp":"2018-10-01T12:31:16.000Z"
|
||||||
|
}
|
||||||
|
],
|
||||||
"count":"500"
|
"count":"500"
|
||||||
]
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -105,7 +101,7 @@ GET https://api.example.com/v1/trades?market=xrp_btc&last_tid=75208825&limit=500
|
|||||||
|
|
||||||
Provide a RESTful API endpoint that returns data about the current order book in a particular market.
|
Provide a RESTful API endpoint that returns data about the current order book in a particular market.
|
||||||
|
|
||||||
XRP Charts will query this endpoint about every 30 seconds. ***TODO: does this frequency vary based on data retrieved?***
|
XRP Charts will query this endpoint about every 30 seconds.
|
||||||
|
|
||||||
|
|
||||||
### Request Format
|
### Request Format
|
||||||
@@ -118,7 +114,7 @@ GET {api_base_url}/v1/orderbook
|
|||||||
|
|
||||||
#### Authentication
|
#### Authentication
|
||||||
|
|
||||||
We prefer to work with a publicly accessible endpoint.
|
XRP Charts prefers to work with a publicly accessible endpoint.
|
||||||
|
|
||||||
#### Parameter
|
#### Parameter
|
||||||
|
|
||||||
@@ -131,13 +127,13 @@ Provide the following parameter. The parameter field name is an example. You can
|
|||||||
|
|
||||||
### Response Format
|
### Response Format
|
||||||
|
|
||||||
A successful response must be a JSON object that includes a timestamp and arrays of current bids and asks. The response does not need to provide the entire order book, but rather just enough data to provide a good idea of the current liquidity available in the market. The parameter field names are examples. You can use other names.
|
A successful response must be a JSON object that includes a timestamp and arrays of current bids and asks. The response does not need to provide the entire order book, but rather just enough data to provide a good idea of the current XRP liquidity available in the market. The parameter field names are examples. You can use other names.
|
||||||
|
|
||||||
| Field | Type | Description |
|
| Field | Type | Description |
|
||||||
|:------------|:-----------------|:--------------------------------------------|
|
|:------------|:-----------------|:--------------------------------------------|
|
||||||
| `timestamp` | String | Time at which the response was sent in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) or [Unix time](https://en.wikipedia.org/wiki/Unix_time) format. ***TODO: just making sure - either format okay?*** |
|
| `timestamp` | String | Time at which the response was sent in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) date-time format or [Unix time](https://en.wikipedia.org/wiki/Unix_time) format. |
|
||||||
| `bids` | Array of objects | Bids in the order book. Each object in the array must provide the offered `price` and `amount` of XRP available at that price. |
|
| `bids` | Array of objects | Bids in the order book. Each object in the array must provide the offered `price` and `amount` available at that price. |
|
||||||
| `asks` | Array of objects | Asks in the order book. Each object in the array must provide the offered `price` and `amount` of XRP available at that price. |
|
| `asks` | Array of objects | Asks in the order book. Each object in the array must provide the offered `price` and `amount` available at that price. |
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|||||||
Reference in New Issue
Block a user