Skip to content
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

add calculate_short_proceeds_up #123

Merged
merged 3 commits into from
Jun 4, 2024
Merged

Conversation

dpaiton
Copy link
Member

@dpaiton dpaiton commented Jun 4, 2024

Resolved Issues

Partially addresses #29 and #21

Description

These are steps towards implementing a parity implementation of open short as well as targeted short.

  • Add a function to calc short proceeds & round up, which is used in the Open Short flow.
  • Modifies calculate short proceeds down to look more like the up version.

Since these functions are implemented on State, we preferentially use State member variables (e.g. vault_share_price) instead of passing arguments.

The short proceeds is given by:

$$ P_{\text{short}}(\Delta y) = \tfrac{\Delta y \cdot c_{1}}{c_{0} \cdot c} + \tfrac{\Delta y}{c} \cdot \phi_{f} - \Delta z(\Delta y) $$

@dpaiton dpaiton changed the title Dpaiton/calc short proceeds add calc short proceeds up and derivative Jun 4, 2024
@dpaiton dpaiton changed the title add calc short proceeds up and derivative add calculate_short_proceeds_up and derivative Jun 4, 2024
@dpaiton dpaiton marked this pull request as ready for review June 4, 2024 16:24
@dpaiton dpaiton changed the title add calculate_short_proceeds_up and derivative add calculate_short_proceeds_up Jun 4, 2024
@dpaiton dpaiton merged commit f7205da into main Jun 4, 2024
8 checks passed
@dpaiton dpaiton deleted the dpaiton/calc-short-proceeds branch June 4, 2024 17:41
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