rootedsquare / market_center

Center to collect market data from cryptocurrency exchanges and distribute it over UDS(Unix Domain Sockets) using GoEx

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Market Center

HitCount

A center to collect market data from cryptocurrency exchanges and distribute it over UDS(Unix Domain Sockets) using GoEx, it design for multi-strategy in one server, especial hft(high frequency trading)

NOT Support Windows

Why market center

Some exchanges has limitation for REST api, limit access frequency by IP or Account.

Usually we start some strategies in one server(description followed), Exchange 2 maybe ban your server IP because too many request.

trandition

So we could use a market center as a router to avoid limitation(description followed) market_center

APIs

Ref to Client

params

  • exchangeName: exchange name, ref to Supports
  • currencyPair: currency pair, format with _, like BTC_USDT
  • period: market data update period, unit ms
  • contractType: future/swap contract type
  • GetSupportList() []
  • SubscribeSpotTicker(exchangeName, currencyPair, period) (error)
  • SubscribeSpotDepth(exchangeName, currencyPair, period) (error)
  • SubscribeSpotTrade(exchangeName, currencyPair) (error)
  • GetSpotTicker(exchangeName, currencyPair) (*Ticker, error)
  • GetSpotDepth(exchangeName, currencyPair) (*Depth, error)
  • GetSpotTrade(exchangeName, currencyPair) (*Trade, error)
  • SubscribeFutureTicker(exchangeName, contractType, currencyPair, period) (error)
  • SubscribeFutureDepth(exchangeName, contractType, currencyPair, period) (error)
  • SubscribeFutureTrade(exchangeName, contractType, currencyPair) (error)
  • GetFutureTicker(exchangeName, contractType, currencyPair) (*Ticker, error)
  • GetFutureDepth(exchangeName, contractType, currencyPair) (*Depth, error)
  • GetFutureTrade(exchangeName, contractType, currencyPair) (*Trade, error)

Support Exchanges

SPOT

  • poloniex.com
  • bitstamp.net
  • huobi.pro
  • bitfinex.com
  • okex.com_v3
  • binance.com
  • bittrex.com
  • bithumb.com
  • gdax.com
  • gate.io
  • coinex.com
  • zb.com
  • fcoin.com
  • fcoin.com_margin
  • big.one
  • hitbtc.com

FUTURE

  • bitmex.com
  • okex.com_future
  • okex.com_swap
  • hbdm.com
  • coinbene.com
  • fmex.com

Proxy

center will get proxy setting from system environment, key word is HTTP_PROXY. if you want to use proxy for center, set HTTP_PROXY=socks5://127.0.0.1:1080 or export HTTP_PROXY=socks5://127.0.0.1:1080

Client

golang client https://github.com/goex-top/market_center_client

fmz js client https://github.com/goex-top/market_center_client_fmz

Why UDS

benchmark compare between USD and TCP/IP loopback

How UDS

观星者

观星者

About

Center to collect market data from cryptocurrency exchanges and distribute it over UDS(Unix Domain Sockets) using GoEx


Languages

Language:Go 98.3%Language:Makefile 1.7%