delvtech / hyperdrive-rs

Rust SDK for the Hyperdrive AMM.
https://docs.rs/crate/hyperdrive-math/latest
Apache License 2.0
2 stars 0 forks source link

create `calc_targeted_close_short` #125

Open dpaiton opened 5 months ago

wakamex commented 5 months ago

This may not require a new function from scratch. If the market impact of closing a short is the same as opening a long, then we may be able to piggyback on calc_targeted_long to tell us how much of a short we can close. This is currently the logic used in lpandarb.py, so I'm pretty sure it's the case, otherwise the LP and Arb bot wouldn't work.