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

improve error handling in targeted_long for too-big and too-small targets #40

Open
dpaiton opened this issue Apr 9, 2024 · 1 comment
Assignees

Comments

@dpaiton
Copy link
Member

dpaiton commented Apr 9, 2024

There are bounds on the target_rate argument that are not observed presently. The rate upper bound is obvious -- they should not be targeting a rate that is greater than the current fixed rate, since longs can only reduce the rate. The lower bound is trickier -- in addition to the base amount being bound by the output of calculate_maximum_long, we can assume that there is a point near zero where the fixed rate is too small.

As of now if you provide pathological arguments for target_rate it will throw errors that are not sufficiently informative; it would be better to check that the target_rate argument is within a reasonable bounds.

@dpaiton
Copy link
Member Author

dpaiton commented Apr 9, 2024

delvtech/hyperdrive#956 partially addresses this by adding a check if the target_rate is above the current_rate (which means we would want a targeted short).

@dpaiton dpaiton closed this as completed May 1, 2024
@dpaiton dpaiton reopened this May 1, 2024
@ryangoree ryangoree transferred this issue from delvtech/hyperdrive May 1, 2024
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

No branches or pull requests

1 participant