def from_block
cswap-bend-cli@0.1.0.0 · daemon/config.bend:189
import cswap-bend-cli@0.1.0.0/daemon/config.bend as Config
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
189def from_block(+b: Json.Json) -> Cfg:
190 Cfg{field_centi(b, "threshold", 9000, 5000, 9990), field_secs(b, "intervalSeconds", 60, 15, 3600), field_secs(b, "cooldownSeconds", 300, 0, 86400),
191 field_centi(b, "hysteresisPct", 1000, 0, 5000), strategy_of(Json.get("strategy", b), "best"), truthy(Json.get("includeApiKeyAccounts", b), False{}),
192 (field_centi(b, "unhealthyTicks", 300, 100, 10000) / 100 : U32), models_of(Json.get("model", b))}