Logbook

Hook spec

Knot on the bench
Knothook spec

Lifecycle events

Eight events: beforeDeposit, afterDeposit, beforeBorrow, afterBorrow, beforeRepay, afterRepay, beforeLiquidate, afterLiquidate. Each is a u8 in the executor's run_composition instruction.

Decision tree

Hooks return Accept, Accept-with-SideEffect, or Reject. Side-effects are bounded: OverrideMaxLtvBps, OverrideRateBps, DelayLiquidationSlots, EmitInstruction. A single Reject halts the lifecycle and surfaces the reason string to the operator.