Replies: 1 comment
-
From serum discord: Thaddeus on #10
Thaddeus — 03/24/2021
Thanks! Thaddeus armaniferrante | Will never DM — 03/24/2021
Thaddeus — 03/24/2021 |
Beta Was this translation helpful? Give feedback.
-
From serum discord: Thaddeus on #10
Thaddeus — 03/24/2021
Thanks! Thaddeus armaniferrante | Will never DM — 03/24/2021
Thaddeus — 03/24/2021 |
Beta Was this translation helpful? Give feedback.
-
In order to provide L3 diffs (order open, change, fill, done) I need to process accounts notifications for the same slot in batch and that requires a little bit of client syncing and potential delay. I've also noticed that sometimes notification for the same slot but different accounts are returned with multi seconds delays (for example bids account notification then few seconds passes and event queue account notification), not sure why is that, perhaps Serum Node being busy?
When RPC: add ability to subscribe to multiple accounts notifications -
accountsSubscribe
solana-labs/solana#12237 is implemented (subscribing to multiple accounts notifications) it should be resolved so there's one notification message for multiple accounts for single slot.I'm using
confirmed/singleGossip
commitment level when subscribing to Solana's RPC account notifications as usingrecent/processed
isn't reliable due to potentially frequent forks that mess up with calculating diffs for L3 data (it uses bids,asks and event queue accounts data to create the diff).Drawback of it is that notifications can be lagging vs 'recent' commitment but more reliable on the other hand. There's a way to switch serum-vial to use
recent/processed
commitment, but when validating L3 diffs it's rather frequently invalid, it does not happen forconfirmed
. Anyways if there would be a way to detect that node has performed a rollback(moved from the local fork to majority fork) via RPC sub, then I could reset local state, but as far as I know that is not possible now.The way subscriptions work is by subscribing to market name not market address, that makes it impossible to handle both depreciated and current markets via single serum-vial server (one would have to run two instances one for v2 one for v3 for example), would it be better to use market address instead? I picked market name as it's more user friendly & human readable but perhaps it's not the best choice.
Handling real-time notifications for event queue account is rather resource intensive, but even what is more important it's consuming a lot of bandwidth (due to its size and frequent updates), not sure if there's a way to improve that somehow? Upside of using real-time notifications vs REST pooling is faster detection of fill/trades/cancellations etc.
It would be great is someone could review the mapping logic that maps raw accounts data to normalized messages and diffs - it's located in https://github.com/tardis-dev/serum-vial/blob/master/src/data_mapper.ts - from my testing both L2 and L3 data match what is visible in DEX UI, but perhaps there are some edge cases that aren't covered, not sure.
It would be great is someone could review normalized messages format if all necessary fields are there etc https://github.com/tardis-dev/serum-vial#data-messages. I'm sending price & size as strings to prevent potential precision issues (due to node.js not having decimal type), but perhaps that's an overkill, not sure.
Is trade message detected correctly here https://github.com/tardis-dev/serum-vial/blob/master/src/data_mapper.ts#L235 ? I know serum-ts is using
maker===true
,serum-rest-server
is usingmaker===false
which is also what I'm using (trade is a fill from the liquidity taker order perspective)Beta Was this translation helpful? Give feedback.
All reactions