We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
get_max_long
1 parent 90981f4 commit 516c95aCopy full SHA for 516c95a
1 file changed
crates/hyperdrive-math/src/long.rs
@@ -165,6 +165,15 @@ impl State {
165
}
166
167
168
+ // Ensure that the final result is less than the absolute max and clamp
169
+ // to the budget.
170
+ if max_base_amount >= absolute_max_base_amount {
171
+ panic!("Reached absolute max bond amount in `get_max_long`.");
172
+ }
173
+ if max_base_amount >= budget {
174
+ return budget;
175
176
+
177
max_base_amount
178
179
0 commit comments