Skip to content

Commit 890b000

Browse files
Plumblynlv-hack
andauthored
FTX Exchange Implemented (#663)
* Added parsing of fees for Kraken exchange ParseOrder method in the ExchangeKrakenAPI class will now parse the fee from the response and set it in the order result. * Added margin properties * Exchange Identifier Added a exchange property to the ticker model to be able to identify what exchange it came from. * Base FTX Implementation Added the base implementation for the FTX exchange. * Added onGetMarketSymbolsAsync Implemented onGetMarketSynbolsAsync method for FTX exchange * Added OnGetMarketSymbolsMetadataAsync Implemented OnGetMarketSymbolsMetadataAsync for FTX exchange Modified ,methods to exclude to futures symbols * Added Websocket base URL * Added signing of requests in FTX exchange Added method for creating the appropriate signature on the request so that it can authenticate against the private API for the FTX exchange Implemented the OnGetAmountsAsync method for the FTX exchange. * added OnGetOpenOrderDetailsAsync * Implemented onGetHistoricalTrades FTX Implemented ongetHistoricaltrades for the FTX exchange. * onGetHistoricalTrade changes Modified onGetHistoricalTrade to use utility method for parsing. * Update ExchangeFTXAPI.cs Moved methods into alphabetical order * working progress on OnGetOrderDetailsAsync * Update ExchangeFTXAPI.cs Implemented websocket connection for retrieving ticker information. * Update ExchangeFTXAPI.cs Refined websocket ticker implementation to make use of utility functions for parsing. * added OnGetAmountsAvailableToTradeAsync Using https://docs.ftx.com/#get-coins * Update ExchangeFTXAPI.cs * checks for future coins * Update ExchangeFTXAPI.cs Implemented onPlaceOrderAsync for FTX exchange. * Update ExchangeFTXAPI.cs Added remaining overrides of methods required to be implemented to FTX exchange Added implementation of OnCancelOrderAsync Added implementation of OnGetCandleAsync * Update ExchangeFTXAPI.cs Implemented getOrderBook for FTX exchange. * Update ExchangeFTXAPI.cs Implemented GetCompletedOrders method for FTX exchange * Update ExchangeFTXAPI.cs Implemented GetTickersAsync method for FTX * Updated FTX Implementation Fixed minor issues in some of the methods Modified order of methods so they are alphabetical Removed debug test class. * Update README.md Added FTX to supported exchanges * Update ExchangeFTXAPI.cs Modified OnGetOrderDetailsAsync for ftx exchange to include isClientOrderId parameter * Update ExchangeSharp.csproj Removed unused Models folder * Revert "Added margin properties" This reverts commit 161bbba. * Update to Exchange Implementations Modified exchange tickers to include the name of the exchange it came from for all exchange implementations. Added PostOnly parameter to place order method for FTX implementation. Modified GetOrderDetails for FTX implementation so that it handles retrieval via client order ids. Removed unnecessary exclusion in project file * Update ExchangeGeminiAPI.cs Fixed issue with reference to the exchange name in Gemini when creating a ticker instance. Co-authored-by: nlv-hack <nv.varnas@gmail.com>
1 parent bb8a5d5 commit 890b000

20 files changed

+547
-7
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ The following cryptocurrency exchanges are supported:
4141
| Bybit | x | x | R | Has public method for Websocket Positions
4242
| Coinbase | x | x | T R |
4343
| Digifinex | x | x | R B |
44+
| FTX | x | x | T |
4445
| Gemini | x | x | T R B |
4546
| HitBTC | x | x | R |
4647
| Huobi | x | x | R B |

src/ExchangeSharp/API/Exchanges/Aquanow/ExchangeAquanowAPI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected override async Task<IEnumerable<KeyValuePair<string, ExchangeTicker>>>
5656
JToken bestPriceSymbol = await MakeJsonRequestAsync<JToken>($"/bestprice?symbol={symbol}", MarketUrl);
5757
decimal bid = bestPriceSymbol["bestBid"].ConvertInvariant<decimal>();
5858
decimal ask = bestPriceSymbol["bestAsk"].ConvertInvariant<decimal>();
59-
ExchangeTicker ticker = new ExchangeTicker { MarketSymbol = symbol, Bid = bid, Ask = ask, ApiResponse = bestPriceSymbol };
59+
ExchangeTicker ticker = new ExchangeTicker { Exchange = Name, MarketSymbol = symbol, Bid = bid, Ask = ask, ApiResponse = bestPriceSymbol };
6060
tickers.Add(new KeyValuePair<string, ExchangeTicker>(symbol, ticker));
6161
}
6262
return tickers;

src/ExchangeSharp/API/Exchanges/BitBank/ExchangeBitBankAPI.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ protected override async Task<IEnumerable<KeyValuePair<string, ExchangeTicker>>>
4949
var data = token[GlobalMarketSymbolToExchangeMarketSymbolAsync(symbol)];
5050
var ticker = new ExchangeTicker()
5151
{
52+
Exchange = Name,
5253
ApiResponse = token,
5354
Ask = data["sell"].ConvertInvariant<decimal>(),
5455
Bid = data["buy"].ConvertInvariant<decimal>(),

src/ExchangeSharp/API/Exchanges/Bitfinex/ExchangeBitfinexAPI.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ protected override async Task<IEnumerable<KeyValuePair<string, ExchangeTicker>>>
166166
var market = marketsBySymbol[marketSymbol.ToLowerInvariant()];
167167
tickers.Add(new KeyValuePair<string, ExchangeTicker>(marketSymbol, new ExchangeTicker
168168
{
169+
Exchange = Name,
169170
MarketSymbol = marketSymbol,
170171
ApiResponse = token,
171172
Ask = array[3].ConvertInvariant<decimal>(),

src/ExchangeSharp/API/Exchanges/Bittrex/ExchangeBittrexAPI_WebSocket.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ async Task innerCallback(string json)
141141
DateTime timestamp = CryptoUtility.UnixTimeStampToDateTimeMilliseconds(ticker["T"].ConvertInvariant<long>());
142142
var t = new ExchangeTicker
143143
{
144+
Exchange = Name,
144145
MarketSymbol = marketName,
145146
ApiResponse = ticker,
146147
Ask = ask,

src/ExchangeSharp/API/Exchanges/Digifinex/ExchangeDigifinexAPI.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ private async Task<ExchangeTicker> ParseTickerAsync(JToken x)
185185

186186
return new ExchangeTicker
187187
{
188+
Exchange = Name,
188189
ApiResponse = t,
189190
Ask = t["sell"].ConvertInvariant<decimal>(),
190191
Bid = t["buy"].ConvertInvariant<decimal>(),

0 commit comments

Comments
 (0)