Skip to content

hyperdrive 0.20.1; fix checkpoint exposure bug - #207

Merged
sentilesdal merged 6 commits into
mainfrom
dpaiton/remove-checkpoint-exposure
Jan 22, 2025
Merged

sentilesdal merged 6 commits into
mainfrom
dpaiton/remove-checkpoint-exposure

Conversation

@dpaiton

@dpaiton dpaiton commented Dec 18, 2024

Copy link
Copy Markdown
Contributor

A Hyperdrive update from this time last year (delvtech/hyperdrive#692) reworked exposure such that the state long_exposure variable included exposure adjustments from any current trade, without representing negative exposure. For example, here is the latest code for long exposure in open short. This update did not get fully propagated to the short side of the rust SDK. The long side can remain unchanged since negative checkpoint exposure can net out future longs, which is not accounted for in the state.long_exposure variable.

This PR implements the fix. I will do a round of updating test tolerances once the remaining max short fixes are implemented.

The commits are organized to separate meaningful changes from regex propagation.

@dpaiton dpaiton changed the title remove checkpoint exposure hyperdrive 0.20.1; fix checkpoint exposure bug Dec 18, 2024
Comment thread crates/hyperdrive-math/src/short/max.rs Outdated
@dpaiton
dpaiton force-pushed the dpaiton/remove-checkpoint-exposure branch 3 times, most recently from f578aaa to c2dcff6 Compare December 18, 2024 17:59
@dpaiton
dpaiton marked this pull request as ready for review December 18, 2024 17:59
@dpaiton
dpaiton force-pushed the dpaiton/remove-checkpoint-exposure branch from c2dcff6 to ea954c9 Compare December 19, 2024 20:51
@dpaiton dpaiton mentioned this pull request Dec 20, 2024
7 tasks
@dpaiton

dpaiton commented Jan 22, 2025

Copy link
Copy Markdown
Contributor Author

Per conversations with @jalextowle, the checkpoint exposure is ok to leave alone in the Long flow. This PR only updates the short flow to avoid double counting exposure.

@sentilesdal sentilesdal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@sentilesdal
sentilesdal merged commit db760a3 into main Jan 22, 2025
@sentilesdal
sentilesdal deleted the dpaiton/remove-checkpoint-exposure branch January 22, 2025 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants