-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] High-level service planning #2
Comments
High-level plan for services responsible for market-making logic:
|
This comment attempts to outline the responsibility of each service in a typical user interaction.
Comments |
Thanks for writing this up @hrharder, I don't have any significant issues with this high level definition. I have do have one question though. It specifically relates to the following bullet but it does seem applicable at other points:
How would |
As I understand it, the Hot Wallet notifies the dealer right afer updating the database |
I made a small drawing to picture what's going on, some of the details are missing,
Questions:
7.3:
and 7.6:
9:
|
I want to change the end stage of our order processing in v2. Since the Hedger will be operating over epochs, I'd rather store the filled orders in redis, which at epoch end will be accessed by the Hedger and cleared. This eliminates grpc dependency and also allows epoch status to be used in pricing, e.g. if we have a lot of sells on a given pair during an epoch that hasn't been handled yet, we could offer better prices on the other side so we could match against ourselves. |
@gchaincl is correct -- the idea is this would be a request/response pattern over gRPC where the hot-wallet (or whatever other service is taking action). Because most stateful data will be in a DB the messages can be very simple -- likely just including the relevant quote ID and a status code. We will certainly need some more clarity around this soon. |
@gchaincl
That is correct -- right now my thinking is the dealer will alert the order-watcher that a new transaction has been submitted and must be monitored. We could potentially make this the responsibility of whatever service actually submits the Tx.
I'm not sure -- this might be a good idea however. One thing I was not a huge fan of in the current system is how many services access the DB. Personally I like the pattern of the dealer being this central service and orchestrator, in which case it seems to make sense for the dealer to do most of the (or all of) the DB interactions. What do you think? |
This sounds fine -- however, I'm personally in the boat that we should move away from redis as a catch-all DB, and only use it as a cache. I would like to keep one main table in something like SQL or similar where each entry is a "quote", but it stores all relevant information, including the hedge trade. In your mind, is redis the key word here, or rather just storing the filled orders in /some/ DB (not necessarily redis)? |
Yes although in this case the function is very 'cache-like' so I think redis might be the best choice. Since this is being accessed by the service we'd like to performance optimize the most whatever the fastest read option is should work |
Sounds good -- as long as any relevant data from hedge trades eventually gets stored in the persistent DB I think that is okay. For example, the timestamp, exchange order ID, size/price/side of the hedge trade should be associated with the quote ID after we're done with it. Would you agree? |
I agree. We can expose gRPC methods so that HotWallet and Maker can update the DB via Dealer |
Perfect. |
Overview
This issue will serve as a place to discuss and outline the high-level plans for the various services required to implement the Zaidan Dealer JSONRPC.
Description
The text was updated successfully, but these errors were encountered: