├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 executium 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cryptocurrency Combination Spread Data 2 | ![spread](https://i.imgur.com/2YVmoPZ.jpg) 3 | 4 | **Table of Contents** 5 | 6 | - [General Information](#general-information) 7 | - [HTTP Return Codes](#http-return-codes) 8 | - [Demo](#demo) 9 | - [Limits](#limits) 10 | - [API Information](#api-information) 11 | - [Fetch Spread Candlestick Data](#fetch-spread-candlestick-data) (public/fetch-spread-data) 12 | - [Symbols Supported](#symbols-supported) (system/symbols) 13 | - [Match Pair](#match-pair) (public/match-pair) 14 | 15 | 16 | ## General Information - [`View Demo`](https://marketdata.executium.com/spread-data-demo/) 17 | This repository is provided to give access to developers who wish to pull down the executium `spread` data. This repository is provided as a standalone focused project. It is part of the executium REST API version 2. 18 | 19 | * The base for public `marketdata` is : **`marketdata.executium.com`** 20 | * All endpoints return either a JSON object or array. 21 | * Data returned is limited according to subscription. 22 | * Timestamp fields vary and are labeled to their corresponding contents of **milliseconds** or **time** 23 | 24 | ## HTTP Return Codes 25 | 26 | * HTTP `4XX` return codes are used for malformed requests where the issue exists with the sender. 27 | * HTTP `418` return code is used when an IP has been banned automatically for continuing to send requests after receiving `429` codes. 28 | * HTTP `422` return code is applied when a user input is unexpected. 29 | * HTTP `429` return code is used when breaking a request rate limit. 30 | * HTTP `5XX` return codes are used for internal errors. 31 | 32 | ## Demo 33 | There is a useful [online demo provided by executium here](https://marketdata.executium.com/spread-data-demo/) 34 | 35 | ![spread](https://i.imgur.com/zKTjg21.jpg) 36 | 37 | ### Live Spread Graphs 38 | With executium we offer up the ability to watch real-time spreads on higher subscription tiers. 39 | 40 | ![live spreads](https://i.imgur.com/aEPxTxV.gif) 41 | 42 | ## Limits 43 | You are only able to pull the current days candle data based on 1 minute ticks. For more history please see your executium account. 44 | 45 | ## Fetch Spread Candlestick Data 46 | Spreads are calculated as Ask-Bid for price, and Ask/Bid for ratio. 47 | 48 | ``` 49 | POST /api/v2/public/fetch-spread-data 50 | ``` 51 | 52 | **Parameters:** 53 | Name | MinLength | Required | Default | Description 54 | ------------ | ------------ | ------------ | ------------ | ------------ 55 | combination | 1 | YES | | Provide a valid combination such as `binance-btcusdt+bitmax-btcusdc`. The `+` acts as a join for the combination. The order is ascending by time. 56 | latestonly | | NO | | Set as `true` to activate. Useful to pull when you are only looking to update the latest point 57 | 58 | 59 | **Successful Response Payload:** 60 | ```javascript 61 | 62 | 63 | "data":[ 64 | { 65 | "price":{ 66 | "open":9.14, 67 | "close":9.52, 68 | "high":9.52, 69 | "low":8.23, 70 | "time":"1594294380000" 71 | }, 72 | "ratio":{ 73 | "open":1.001, 74 | "close":1.001, 75 | "high":1.001, 76 | "low":1.0009, 77 | "time":"1594294380000" 78 | } 79 | } 80 | ], 81 | 82 | ``` 83 | 84 | ## Symbols 85 | All symbols listed and supported on executium. This `endpoint` also accepts `GET`, you can filter the data using the `exchange` parameter, for example `GET /api/v2/system/symbols?exchange=bifinex`. 86 | 87 | To get a working code you need to combine the `exchange` with the `id`. For example `binance-ethbtc` is a combination of the two. So `binance-ethbtc+bitfinex-ethbtc` would provide the candle data for that combination. 88 | 89 | ``` 90 | POST /api/v2/system/symbols 91 | ``` 92 | 93 | **Parameters:** 94 | Name | MinLength | Required | Default | Description 95 | ------------ | ------------ | ------------ | ------------ | ------------ 96 | exchange | | NO | | Filter the data by exchange. 97 | 98 | 99 | **Successful Response Payload:** 100 | ```javascript 101 | { 102 | "data": { 103 | "binance": [ 104 | { 105 | "id": "ethbtc", 106 | "symbol": "ETH/BTC", 107 | "quote": "BTC", 108 | "base": "ETH", 109 | "min": 0.000001, 110 | "pp": 6, 111 | "pa": 3 112 | }, 113 | { 114 | "id": "ltcbtc", 115 | "symbol": "LTC/BTC", 116 | "quote": "BTC", 117 | "base": "LTC", 118 | "min": 0.000001, 119 | "pp": 6, 120 | "pa": 2 121 | }, 122 | ... 123 | ... 124 | ... 125 | "bitfinex": [ 126 | { 127 | "id": "btcusd", 128 | "symbol": "BTC/USD", 129 | "quote": "USD", 130 | "base": "BTC", 131 | "min": 0.000009999999999999999, 132 | "pp": 5, 133 | "pa": -1 134 | }, 135 | { 136 | "id": "ltcusd", 137 | "symbol": "LTC/USD", 138 | "quote": "USD", 139 | "base": "LTC", 140 | "min": 0.000009999999999999999, 141 | "pp": 5, 142 | "pa": -1 143 | }, 144 | ... 145 | ... 146 | 147 | 148 | ``` 149 | 150 | ## Match Pairs 151 | This system is provided to give insight into a `pairing` and where you can also trade it. For this endpoint we accept both `POST` and `GET`. An example of `GET` would be `https://marketdata.executium.com/api/v2/public/match-pair?code=btcusdt,btcusd`. 152 | 153 | ``` 154 | POST /api/v2/public/match-pair 155 | ``` 156 | 157 | **Parameters:** 158 | Name | MinLength | Required | Default | Description 159 | ------------ | ------------ | ------------ | ------------ | ------------ 160 | code | 1 | YES | | Provide a pair such as `btcusdt` to discover where else you can trade the pairing `btcusdt`. Comma delimited list acceptable upto 10. Exclude the exchange code from your query and request just the pair like shown. 161 | limit | | NO | 10 | 162 | pagenumber | | NO | 1 | 163 | 164 | 165 | **Successful Response Payload:** 166 | ```javascript 167 | 168 | 169 | { 170 | "data": { 171 | 172 | "BTCUSDT": { 173 | "pair": "btcusdt", 174 | "count": 14, 175 | "active": [ 176 | "Binance", 177 | "Bitfinex", 178 | "Bitmart", 179 | "Bitmax", 180 | "Bittrex", 181 | "Ftx", 182 | "Gateio", 183 | "Huobipro", 184 | "Kraken", 185 | "Kucoin", 186 | "Liquid", 187 | "Okex", 188 | "Poloniex", 189 | "Upbit" 190 | ], 191 | "detail": { 192 | "binance": { 193 | "id": "btcusdt", 194 | "symbol": "BTC/USDT", 195 | "quote": "USDT", 196 | "base": "BTC", 197 | "min": 0.01, 198 | "pp": 2, 199 | "pa": 6 200 | }, 201 | "bitfinex": { 202 | "id": "btcusdt", 203 | "symbol": "BTC/USDT", 204 | "quote": "UST", 205 | "base": "BTC", 206 | "min": 0.000009999999999999999, 207 | "pp": 5, 208 | "pa": -1 209 | }, 210 | ... 211 | ... 212 | ... 213 | 214 | }, 215 | "possible_combinations": 196 216 | }, 217 | "BTCUSD": { 218 | "pair": "btcusd", 219 | "count": 11, 220 | "active": [ 221 | "Bitfinex", 222 | "Bitflyer", 223 | "Bitmex", 224 | "Bitstamp", 225 | "Bittrex", 226 | "Coinbase", 227 | "Coinbasepro", 228 | "Ftx", 229 | "Itbit", 230 | "Kraken", 231 | "Liquid" 232 | ], 233 | "detail": { 234 | "bitfinex": { 235 | "id": "btcusd", 236 | "symbol": "BTC/USD", 237 | "quote": "USD", 238 | "base": "BTC", 239 | "min": 0.000009999999999999999, 240 | "pp": 5, 241 | "pa": -1 242 | }, 243 | ... 244 | ... 245 | ... 246 | } 247 | } 248 | 249 | 250 | ``` 251 | 252 | --------------------------------------------------------------------------------