The first step to add a new exchange.
yarn add-exchange
Before configuring the generator, the basics.
- Trading Features
- The account types that trading is enabled on this exchange:
Spot
Margin
Derivatives
- The account types that trading is enabled on this exchange:
- API Features (that the exchange provides)
- Order Editting
- Does the exhange API provides a method for editing orders?
- Position Indentifier
- Does the exhange API provides a
uid
forpositions
?
- Does the exhange API provides a
- Order Editting
Let's do it.
yarn add-exchange
<image-1-here>
<image-2-here>
Configure your new exchange and voilà.
If your exchangeId
was 'bitfinex', you should end up with this:
src/exchanges/bitfinex
├── Bitfinex.ts
├── BitfinexAuthed.ts
├── BitfinexHttp.ts
├── bitfinexSpecs.ts
├── enums
│ └── delete-me.txt
├── errors
│ └── delete-me.txt
├── modules
│ ├── authed
│ └── public
└── schemas
├── IBitfinexKeySchema.ts
├── IBitfinexMarketSchema.ts
└── IBitfinexSymbolSchema.ts
First, implement an http class.
It should sign requests and send them the way the exchange expects.
Examples:
Here we need to configure and the types
related to the exchange.
They should completely describe the data model for all Exchange API methods.
- Bittrex:
- Bitfinex:
- Bittrex:
- Bitfinex:
Implement all the public API methods:
Examples:
-
Bittrex
-
Bitfinex
Here, all the authenticated methods:
Examples: