Skip to content

Conversation

@dpaiton
Copy link
Contributor

@dpaiton dpaiton commented Jan 10, 2025

Description

The primary contributions in this PR are:

  1. update the minimum share reserves after short from z_min + max(zeta, 0) + e/c to z_min + max(zeta, e/c, 0). This update is justified because the checks are performed independently, and thus the reserves do not need to account for share reserves plus exposure. Just whichever is larger.
  2. update the approximate absolute max short to account for the fact that opening a short reduces exposure. Here is the updated logic:

image
image

Other changes:

  • updated a handful of functions to return FixedPoint::<I256> instead of FixedPoint::<U256>. This cleaned up the logic in the max short functions.
  • fuzz_sol_calculate_max_long gets a tolerance -- it was intermittently failing in PRs. Later we should fix this, as requested in Max long & short failures in fuzz testing #136

@dpaiton dpaiton force-pushed the dpaiton/fix-max-short-tests branch 2 times, most recently from 6e4d09b to 8f7f5a3 Compare January 10, 2025 23:07
@sentilesdal sentilesdal force-pushed the dpaiton/max-short-test branch from 36c400e to 1f2eb62 Compare January 22, 2025 19:02
Base automatically changed from dpaiton/max-short-test to main January 22, 2025 21:25
@sentilesdal sentilesdal force-pushed the dpaiton/fix-max-short-tests branch from 33c1a9b to 201b048 Compare January 22, 2025 21:27
Copy link
Contributor

@sentilesdal sentilesdal left a comment

Choose a reason for hiding this comment

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

went through this PR in detail IRL with @dpaiton. Looks good, nothing broken, better than it was before. Approved.

@sentilesdal sentilesdal merged commit a49624d into main Jan 22, 2025
8 checks passed
@sentilesdal sentilesdal deleted the dpaiton/fix-max-short-tests branch January 22, 2025 22:04
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.

3 participants