-
Notifications
You must be signed in to change notification settings - Fork 217
[Binance] Support for execution reports / UserTrades / fills #246
[Binance] Support for execution reports / UserTrades / fills #246
Conversation
Keepalive not handled yet, some debug code still in place and the user trades currently duplicate non-user trades AND ignore currency filters.
…east). Fix some connection edge cases
I've been running with this for some time, with no problems. Anyone got a review in them? |
Still no reviews for this? |
Anyone? |
@Flemingjp, I want to get started on the next phase of this: unifying execution report support for the exchanges where we already provide it to create an L1 API. There's not much here that's controversial. Can we merge it on the basis of a simple code review? |
@Flemingjp , I can't wait any longer and am now turning this into generic support across Binance, Bitfinex and Coinbase Pro, with more to come. That code is now ready to push but I don't want to complicate this PR it I don't have to; I'd rather submit the next bit as a separate PR. If this isn't merged soon it's going to become another monster PR with useful features that never gets merged because it's too big for anyone to review, and we're going to be frozen regarding Binance in the same way as we are with Bitmex. I am probably going to start looking at Bitmex next (#267, #244 and ensuring consistency with this), but I can't do anything about that either until this is merged. I suggest either you and I make a decision on this now, or we call upon a couple of other regular contributors to agree on it, because if not, I can't afford to keep spending the time balancing two divergent code sets. |
See #274 for details of the generic API I'm working on which builds on this. |
@badgerwithagun Apologies for the delay - are you still wanting this merged to help support your L2 api additions? |
Yes please! Once this and the Bitfinex one are in, I'll be able to publicise my dev branch so I can get feedback on progress. |
Thanks @Flemingjp . |
This follows the same pattern as #160 did for GDAX. Execution reports are now fetched from Binance if you connect with an API key. That makes the following available:
L2 (Generic) API
StreamingMarketDataService.getTrades(...)
: now returns bothUserTrade
andTrade
instances. As with the existing solution for GDAX, these are duplicated (see #230L1 API
The following are available if you cast your
StreamingMarketDataService
toBinanceStreamingMarketDataService
:BinanceStreamingMarketDataService.getRawExecutionReports()
: full raw details of all trades on all currencies, order creations and order fills. This is the raw Binance API (and is thus subject to change if the Binance API itself changes).BinanceStreamingMarketDataService.getUserTrades()
: Execution reports filtered down to just trades and converted toUserTrade
.BinanceStreamingMarketDataService.getUserTrades(CurrencyPair)
: As above, but filtered to a specific currency.I think there's an argument for supporting the latter two as part of the generic API. Thoughts?