agent0
agent0 copied to clipboard
add guardrails to open long & short preventing double max
in our fuzz tests we should prevent allowing two max longs/shorts in row
lets put a check in the interface before calling rust funcs; if bond & share are at certain levels (e.g. close to equal for max long) then we directly return FixedPoint(0) without bothering with the rust func. Similar for max short
we should also catch neg interest in crash reporting and see if it's because max long was too big (calc_max has noise, this results from two max trades in a row)