Binance orders #194
Labels
data-layer
real-time and historical data processing and storage
integration
external stack and/or lib augmentations
testing
Now that #190 is ready to land (once y'all glance at it) we've got a much more explicit api for supporting order management and thus live trading.
The big crypto boi in town is of course the new
binance
backend and, from a glance at their api it should be mostly a cinch to implement.This needs a readme / write up (coming soon) but the basic gist is this:
@tractor.context
(yes the new bidir streaming api) endpoint namedtrades_dialogue()
which sets up a 2 way stream for both accepting order requests from the EMS (execution management system, or "clearing system" which runs in theemsd
sub-daemon) and delivering user account trade events back frombinance
to the ems. Examples of this endpoint include:.clearing._paper_engine.trades_dialogue()
which shows how to start the context and spawn a secondary task, athandle_order_requests()
which handles the inbound order requests from theemsd
brokers.ib.trades_dialogue()
endpoint which basically shows the same design (also has a inbound handling task) but also has the support for *relaying ib trade events back to theemsd
as is shown in this loop..clear._messages
module; the sequencing and flow of which is currently only documented in the comments above each message set -> this all needs to be further documented in a readme (like i said, coming soon 😂).binance
has 2 main sets of endpoints that are likely to be needed to get support going:.submit_limit()
andsubmit_cancel()
methods seen in the other mentioned backendslistenKey
which you actually use to gen a dynamic endpoint from the looks of itThe crash course on the 2 sets of message types:
piker
client dialogue msgs are in the set ofCancel
,Order
, andStatus
these are purely piker related client <->emsd
messages that provide a uniform/simpler layer for abstracting across ems servicesemsd
<->brokerd
dialogues (which take place with thetrades_dialogue()
mentioned above) are the messages in this set which include a few extra messages for order request acks, positions, individual fills, and errors. For now as long as we stick to the pydantic fields everything should just work; if we need to modify / extend the messages that's also just fine 😎.Hopefully this is enough to get going 😂
The text was updated successfully, but these errors were encountered: