agent0 icon indicating copy to clipboard operation
agent0 copied to clipboard

add guardrails to open long & short preventing double max

Open dpaiton opened this issue 1 year ago • 2 comments

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)

dpaiton avatar Jan 17 '24 17:01 dpaiton