You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want an easy-to-use fn that always returns a valid long that is maximally profitable. For example:
if fixed_rate > variable_rate {
target_rate = variable_rate;
agent.open_long(hyperdrive.max_valid_long(agent.budget, target_rate);}
The max_valid_long fn would be guaranteed to be valid, and return a long that is as close to the target as possible without exceeding it. In the event that the long to achieve the target rate produces an insolvent pool, it will return the maximum long.
This is different from the existing calculate_targeted_long, which will throw an error if the long to hit the target_rate produces an insolvent pool.
The text was updated successfully, but these errors were encountered:
dpaiton
changed the title
Wrap max long & targeted long to something like calculate_max_valid_long_with_budget_and_rate_constraints
Wrap max long & targeted long to something like calculate_max_valid_long(max_budget, target_rate)Apr 5, 2024
We want an easy-to-use fn that always returns a valid long that is maximally profitable. For example:
The
max_valid_long
fn would be guaranteed to be valid, and return a long that is as close to the target as possible without exceeding it. In the event that the long to achieve the target rate produces an insolvent pool, it will return the maximum long.This is different from the existing
calculate_targeted_long
, which will throw an error if the long to hit thetarget_rate
produces an insolvent pool.The text was updated successfully, but these errors were encountered: