Algo.need.of: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/policy/algo.bend as Algo Lines 45-49 of cswap-bend-cli@0.1.0.0/policy/algo.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/policy/algo.bend&start_line=45&end_line=49 import Base import cswap-bend-cli@0.1.0.0/policy/safe.bend as SF # The least headroom a target needs: drain-first and a proactive automatic # switch must land below the threshold; an at-limit switch or a rotation takes # any headroom. def need.of(+algo: SF.Algo, +via: Via, +a: Nat, +thr: Nat) -> Nat: need.under(drain(algo) || (via.auto(via) && Nat.is_gt(a, 0n)), thr) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_gt https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/policy/algo.bend&name=Via https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/policy/algo.bend&name=drain https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/policy/algo.bend&name=need.under https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/policy/algo.bend&name=via.auto https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/policy/safe.bend&name=Algo