Skip to content

a machine readable json document containing metadata for crypto currency trading

Notifications You must be signed in to change notification settings

npomfret/crypto-exchange-metadata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

crypto-exchange-metadata

A machine readable json document containing exchange metadata for crypto currency trading.

Supported data points include:

  • currency symbols
  • market symbols
  • minimum order sizes
  • order price precision
  • order quantity precision
  • trade fees
  • withdrawal fees
  • deposit fees

Supported exchanges include:

  • anxpro
  • binance
  • bitbay
  • bitfinex
  • bitmarket
  • bitstamp
  • bittrex
  • btcmarkets
  • cex
  • coinfloor
  • dsx
  • gdax
  • gemini
  • kraken
  • poloniex
  • therock
  • quadrigacx
  • quoinex
  • wex

File format

Where possible efforts are made to keep things readable by humans. Maps are kept in alphabetical order, percentages are expressed as percentages rather than decimals.

Fields starting with a double underscore (eg __notes: "....) are not machine readable and should be regarded as comments.

Naming conventions

Always use the symbols that the exchanges use, including capitalization.

We arbitrarily used the terms base currency and counter currency to represent names of the symbols in a currency pair.
So a BTC/USD market would (typically) have the base currency of BTC and counter currency of USD. That means a bid order would result in buying BTC for USD.

Some exchanges reverse these symbols in their market names. Some swap the terms base and counter, and some use different terms altogether. There doesn't appear to be any consistency.

Exchange name

Self explanatory. Lower case, taken from the exchange url.

Markets

The market symbols are specific to the exchanges, there is no common language for these.

For each market in an exchange the following data points are modelled:

  • price-precision: the number of digits that can come after the decimal point in the market price

  • quantity-precision: the number of digits that can come after the decimal point in the order quantity for a market

  • minimum-order-size: self explanitory... it expressed with a currency to avoid ambiguity

    "markets": {
      "BTCCAD": {
        "quantity-precision": 8,
        "minimum-order-size": "BTC 0.01",
        "price-precision": 5
      },

Minimum order sizes are typically expressed in units of the base currency:

      "BCC-BTC": {
        "minimum-order-size": "BCC 0.00035"        
      },

If the minimum order size is in units of the counter currency then it is represented in the same format:

      "BCC-BTC": {
        "minimum-order-size": "BTC 0.00003"        
      },

If there is a different minimum order size based on the direction of the order, is is represented as such:

      "BCC-BTC": {
        "minimum-order-size": [
          "BCC 0.00035",
          "BTC 0.00003"
        ]
      },

In this example the minimum bid size is 0.00035BCC and the minimum ask size is 0.00003BTC. note: this format will be clarified soon.

Fees

Trading fees, deposit fees and withdrawal fees are modelled.

Where possible a note is added with a url that leads to the exchange documentation about the fees. Also, if the fees are available via the API this is noted.

Absolute fees are represented as a number where there ambiguity in the currency (such as a withdrawal fee):

  "anxpro": {
    "withdrawl-fees": {
      "BTC": 0.002,

Percentages are represented as such, eg:

    "trading-fees": {
      "USDTUSD": {
        "taker": "0.2%",
        "maker": "0.2%"
      }
    }

If there is a sensible default fee it can be expressed as such:

    "trading-fees": {
      "default": {
        "taker": "0.26%",
        "maker": "0.16%"
      },
      "USDTUSD": {
        "taker": "0.2%",
        "maker": "0.2%"
      }
    }

Where the exchange offers multiple options for a fee, these are expressed as a map:

    "withdrawl-fees": {
        "PLN": {
          "Wire bank transfer": 4,
          "ATM withdrawal (100 - 1000 PLN)": 10,
          "ATM withdrawal (2000 PLN)": 20
        }

Where a fee has a fixed and percentage part, these are represented as a map, eg:

    "withdrawl-fees": {
      "HKD": {
        "options": [
          {
            "Bank Wire": {
              "fixed": 250,
              "rate": "1.00%"
            }
          }
        ]
      },

In the case where an exchange supports a currency, but that currency cannot be withdrawn it is represented as such:

    "withdrawal-fees": {
      "USD": "n/a",

Whats not supported (yet)

wildcards: to represent all Ethereum markets it might be nice to use ETH*.

maximum order sizes

Order types: market / limit / hidden / stop loss etc.

Fee discounts: these are relative to the user's exchange account and so can be included. They can usually be got via the an API call, or calculated from the users activity.

Symbol translations: each exchange uses its own symbols for both currencies and markets.

Lending: only spot markets are supported.

currency precision: useful for withdrawals or showing what funds are needed to execute an order.

Finally...

PRs welcome!

About

a machine readable json document containing metadata for crypto currency trading

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published