-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix: Short Sandwich #537
fix: Short Sandwich #537
Conversation
Hyperdrive Gas Benchmark
This comment was automatically generated by workflow using github-action-benchmark. |
6110827
to
e4334e4
Compare
- For `test__calculateMaxLong__matureShort`, I ultimately settled for a relatively large bound. There are a few strategies that can be used to increase it's performance. First, we should see if adding a stricter constraint on the spot price improves the worst-case performance of `calculateMaxLong`. Second, we can try some of the tricks outlined in this thread: https://math.stackexchange.com/questions/508199/newtons-method-why-is-there-slow-convergence-with-a-high-multiplicity. - For `test_long_multiblock_round_trip_end_of_checkpoint`, the failure occurs rarely, so we can merge without fixing it in this PR. This issue is tracked here: #582. I'll address this issue in an immediate follow-up PR.
de26ef7
to
02f3874
Compare
d92328e
to
9c2dc75
Compare
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.
This is really good. Just a few comments. On the testing side, i think it would be good to add a path independence test that shows that you can close trades in a different order and still get the same result. i actually tested a few cases when i reviewed this the first time around.
Also, here is a desmos that shows the short sandwhich problem:
https://www.desmos.com/calculator/trao96oozf
and here is the zeta adjustment:
Fixes: #426.
Aside from implementing the zeta adjustment, this PR also includes significant improvements to both
get_max_long
andget_max_short
.