Conversation
|
Would it be possible to add a high level overview of what this PR is about? Curious to understand it better |
|
dex/src/state.rs
Outdated
| } | ||
| } | ||
|
|
||
| impl<'a, H: QueueHeader> Index<usize> for Queue<'a, H> { |
There was a problem hiding this comment.
Is this used in this batch of changes?
dex/src/state.rs
Outdated
| Err(DexErrorCode::EventQueueTooSmall)? | ||
| } | ||
| let account_flags = if consume_events_authority.is_some() { | ||
| (AccountFlag::Initialized | AccountFlag::EventQueue | AccountFlag::IncludeTakerMetadata) |
There was a problem hiding this comment.
Given that IncludeTakerMetadata can only be used with a consume events atuhority, we can remove IncludeTakerMeatadata and just re-use the CrankAuthorityRequired flag.
| fee_tier: FeeTier, | ||
| client_order_id: Option<NonZeroU64>, | ||
| }, | ||
| MakerFill { |
There was a problem hiding this comment.
Using this MakerFill doesn't actually do anything because the EventView is not what is stored in the EventQueue account. It's just a view of its data. So to add a field, one has to update the Event struct in a non breaking way.
This PR fixes some of the bugs present from the crank authority PR and adds the public key of the taker's open orders account to every maker fill.
This is useful because this can allow for a downstream program that composes with Serum to simultaneously process a taker and maker fill in the same transaction. It is very helpful to have both parties on the trade fill when initializing a perpetual swap or an option for example.