DucaturFw / ducor-backend

Ducatur Oracles Backend
3 stars 3 forks source link

Implement CCXT as main crypto exchange provider #11

Closed zlumer closed 6 years ago

zlumer commented 6 years ago

https://github.com/ccxt/ccxt

CCXT has a big (and constantly updating) list of cryptocurrency exchanges. We need to move from our self-made nonsense to their battle-tested API (17k commits & 225 contributors).

All cryptoexchange-specific modifications should be pushed to their repo if possible. Custom workarounds can be implemented on our side if necessary.

Implementation

For now we focus only on symbol tickers.

Main entry point for crypto providers is IDataProvider https://github.com/DucaturFw/ducor-backend/blob/15ad4f4fceb8bffcb296d2c54f9d1e6bae483f12/src/IDataProvider.ts#L3

https://github.com/DucaturFw/ducor-backend/blob/15ad4f4fceb8bffcb296d2c54f9d1e6bae483f12/src/IOracleData.ts#L1-L12

First step would be to add a single exchange as IDataProvider, using CCXT. Implementation details:

  1. Add ccxt lib as project dependency.
  2. Create Bitfinex IDataProvider.
  3. Implement Bitfinex symbol ticker provider using ccxt.exchanges.bifinex.fetchTicker().