Skip to content

Implemented get_max_long for a post-netting world#569

Merged
jalextowle merged 7 commits intoinfinite-chocolatefrom
jalextowle/rust/get_max_long
Aug 25, 2023
Merged

Implemented get_max_long for a post-netting world#569
jalextowle merged 7 commits intoinfinite-chocolatefrom
jalextowle/rust/get_max_long

Conversation

@jalextowle
Copy link
Copy Markdown
Contributor

@jalextowle jalextowle commented Aug 25, 2023

Fixes: #228, #464, #503, #536.

This PR implements a get_max_long function that gets the maximum long that a trader can open. We check the upper endpoint and then use Newton's method to iteratively approximate the maximum long that satisfies our solvency constraint and the trader's budget.

@jalextowle jalextowle changed the base branch from main to infinite-chocolate August 25, 2023 01:24
@jalextowle jalextowle force-pushed the jalextowle/rust/get_max_long branch from c42eefd to 4622226 Compare August 25, 2023 01:36
@jalextowle jalextowle marked this pull request as ready for review August 25, 2023 03:48
Comment thread crates/hyperdrive-math/src/hyperdrive_math/long.rs Outdated
Copy link
Copy Markdown
Contributor

@jrhea jrhea left a comment

Choose a reason for hiding this comment

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

well done, just a couple of nits

Comment thread crates/hyperdrive-math/src/hyperdrive_math/long.rs Outdated
Comment thread crates/hyperdrive-math/src/hyperdrive_math/long.rs
Comment thread crates/hyperdrive-math/src/hyperdrive_math/long.rs
Comment thread crates/hyperdrive-math/src/hyperdrive_math/long.rs
@jalextowle jalextowle merged commit 2cb79c1 into infinite-chocolate Aug 25, 2023
@jalextowle jalextowle deleted the jalextowle/rust/get_max_long branch August 25, 2023 06:06
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