def recov.dom

cswap-bend-cli@0.1.0.0 · policy/bar.bend:53

import cswap-bend-cli@0.1.0.0/policy/bar.bend as Bar
import Base
import cswap-bend-cli@0.1.0.0/policy/types.bend as T

53# Dominance over the active account.
54def recov.dom(+h: Maybe<&2, Nat>, +ah: Maybe<&2, Nat>, +thr: Nat) -> Bool:
55  match h ah:
56    case None{} _:
57      False{}
58    case Some{x} Some{a}:
59      Nat.is_gt(x, Nat.add(Nat.mul(2n, a), 300n))
60    case Some{x} None{}:
61      Nat.is_gt(x, Nat.sub(T.full(), thr))

Uses (8)

Used by (1)