Use Case & Applications
Monitors and limits token outflows to prevent catastrophic asset loss during exploits, creating a delay window for emergency response. Critical for lending protocols with token reserves (Compound, Aave, Morpho), liquidity pools and DEXs, treasury management systems and DAOs, yield aggregators, and cross-chain bridges holding tokens in escrow. By limiting outflow rates, protocols gain valuable time to respond to security incidents and activate circuit breakers, even if complete prevention isn’t possible.Explanation
Implements percentage-based limit on token outflows in a single transaction:forkPreTx()/forkPostTx(): Capture token balance before and after transactionregisterCallTrigger(): Trigger on every transaction without specifying particular function signature- Calculate percentage of tokens withdrawn in transaction
- Revert if withdrawal percentage exceeds configured threshold
Code Example
Full examples with tests available in the Phylax Assertion Examples Repository.

