-
Notifications
You must be signed in to change notification settings - Fork 67
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
Track trading times for user and liquidity orders separately #172
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
crates/solver/src/driver.rs
Outdated
@@ -170,7 +170,12 @@ impl Driver { | |||
rated_settlement: RatedSettlement, | |||
) -> Result<TransactionReceipt> { | |||
let settlement = rated_settlement.settlement; | |||
let traded_orders = settlement.traded_orders().cloned().collect::<Vec<_>>(); | |||
let user_orders = settlement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, OK. So the solution is easy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Happy there is a simple solution.
That being said, I would request a change where we have metrics for both user orders and liquidity orders (so we can keep track of how many those trade as well). Since we pass in the full order to order_settled
we can just differentiate on is_liquidity_order
.
It's not as easy as that. Only |
This would be my suggestion. The other advantages of this are:
Not sure how others feel about this though. |
It makes sense to me. If we do this we should come up with a good textual description of what it means to be a liquidity order since that will be part of the public api. |
I'm all for it. 👍 |
a6d9c41
to
51f74fd
Compare
Since |
Codecov Report
@@ Coverage Diff @@
## main #172 +/- ##
==========================================
- Coverage 64.71% 64.42% -0.29%
==========================================
Files 190 189 -1
Lines 39045 38772 -273
==========================================
- Hits 25268 24980 -288
- Misses 13777 13792 +15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I think there is one tiny edge case. Approving as either I am mistaken about the edge case or assume it will be resolved.
ee80d29
to
d68d924
Compare
The introduction of more liquidity orders made the "Average Trade Time" panel less meaningful since we don't really care about taking forever to match liquidity orders.
Now we only update those metrics with settled user orders to better gauge what the actual UX is like.
Test Plan
CI
Edit after merge: I confused order matching quota with time to trade. 🤦♂️
This PR actually only updated the matching quota. Time to trade gets covered in this PR
I left the incorrect original title of this PR to stay consistent with the title of the commit referencing this PR.