Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
84 lines (67 sloc) 3.08 KB

Introduction

Below you can find API documentation for our /v1/stats REST API.

This API is reached via a HTTP GET and returns a JSON response.

Environments

Production (MainNet)

https://api.expotrading.com/v1/stats/expo

Staging (Kovan)

https://api.stage.expotrading.com/v1/stats/expo

Response Details

This endpoint returns a JSON array of markets and their respective volumes in the past 24 hours.

{
  "markets": {
    "sETH_2/15-ETH": {
      "baseVolume24hr": "3.808295578675732863",
      "quoteVolume24hr": "2.172265359566635091",
      "lastPrice": "0.587526918162196187"
    },
    "sETH_2/15-DAI": {
      "baseVolume24hr": "34.271447509413197040",
      "quoteVolume24hr": "2279.237300525398703088",
      "lastPrice": "66.396549589039952746"
    },
    "LETH_2/15-ETH": {
      "baseVolume24hr": "0.352012626845134342",
      "quoteVolume24hr": "0.170000000000000101",
      "lastPrice": "0.482937221666171912"
    },
    "LETH_2/15-DAI": {
      "baseVolume24hr": "61.134221753192250198",
      "quoteVolume24hr": "3316.799176441708035857",
      "lastPrice": "54.239491183887992633"
    },
    "sETH_1/30-ETH": {
      "baseVolume24hr": "44.624048221413668261",
      "quoteVolume24hr": "31.051474928057441282",
      "lastPrice": "0.711940612919140058"
    },
    "sETH_1/30-DAI": {
      "baseVolume24hr": "41.032899971235365742",
      "quoteVolume24hr": "3360.142850104527751417",
      "lastPrice": "81.688245977525136947"
    },
    "LETH_1/30-ETH": {
      "baseVolume24hr": "28.038781752075416963",
      "quoteVolume24hr": "12.046438399613819536",
      "lastPrice": "0.431989833701752036"
    },
    "LETH_1/30-DAI": {
      "baseVolume24hr": "19.908509837816981196",
      "quoteVolume24hr": "1000.000000000000035975",
      "lastPrice": "50.229776520011634514"
    }
  }
}

Markets Details

When this endpoint is hit, it will iterate through every active position and calculate the market of the past 24 hours. The baseVolume24hr of the market is denoted in the margin token, and the quoteVolume24hr of the market is denoted in the respective quote currency. The lastPrice is the latest trade price denoted in the quote currency. If there has been no volume in the past 24 hours, the lastPrice is the last trade that was executed in that market.

Ex: for a margin token sETH, it would return two markets: sETH-ETH and sETH-DAI, respectively.

For sETH-ETH: baseVolume24hr is denoted in sETH and quoteVolume24hr is denoted in ETH in natural units. lastPrice is the price of sETH in ETH.

For sETH-DAI: baseVolume24hr is in sETH and quoteVolume24hr is denoted in DAI in natural units. lastPrice is the price of sETH in DAI.

Market Object

field name description
baseVolume24hr total volume of margin token transacted in the past 24 hours, denoted in natural units.
quoteVolume24hr total volume of quote token transacted in the past 24 hours, denoted in natural units.
lastPrice last trade price in market.