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

chainsync safe closeout #1616

Merged
merged 5 commits into from
Jul 22, 2024
Merged

chainsync safe closeout #1616

merged 5 commits into from
Jul 22, 2024

Conversation

dpaiton
Copy link
Contributor

@dpaiton dpaiton commented Jul 19, 2024

Chainsync uses calc_close_* for estimating closeout value, which could fail if the pool is in a situation where positions cannot be closed. We ware working on a general solution for this here: delvtech/hyperdrive-rs#153

This PR is a temporary solution that approximates the closeout value using spot price.

Copy link

codecov bot commented Jul 19, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 81.55%. Comparing base (9062a60) to head (66d101a).
Report is 82 commits behind head on main.

Files with missing lines Patch % Lines
...c/agent0/chainsync/analysis/calc_position_value.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1616      +/-   ##
==========================================
+ Coverage   81.52%   81.55%   +0.03%     
==========================================
  Files          98       98              
  Lines        7263     7265       +2     
==========================================
+ Hits         5921     5925       +4     
+ Misses       1342     1340       -2     
Flag Coverage Δ
unittests 81.55% <93.33%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@slundqui slundqui left a comment

Choose a reason for hiding this comment

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

LGTM, but this is assuming the equation itself is correct in estimating PNL.

@dpaiton dpaiton enabled auto-merge (squash) July 19, 2024 22:16
@dpaiton dpaiton disabled auto-merge July 22, 2024 17:12
@dpaiton dpaiton merged commit af22b45 into main Jul 22, 2024
5 checks passed
@dpaiton dpaiton deleted the dpaiton/safe-closeout branch July 22, 2024 17:29
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