What is a hook on CenturionDEX?
Last modified:
A hook is an external smart contract that a pool can call at specific execution points. Hooks let developers customize pool behavior without modifying CenturionDEX core contracts.
Why hooks exist
Hooks make pool-level logic programmable. Instead of one fixed rule set for every pool, developers can opt into custom behavior for specific pools while keeping shared settlement and accounting in the protocol.
Common examples include:
- Dynamic fee policies
- Incentive and rebate logic
- Custom access controls or allowlists
- On-chain analytics and accounting extensions
Where hooks run
A hook can run before and/or after key pool actions such as:
- Pool initialization
- Liquidity add/remove updates
- Swaps
- Donations
The exact callback surface depends on the hook implementation and pool configuration.
Risk model
Hooks increase flexibility, but they also increase integration risk because custom logic can change execution behavior in ways that are not obvious from the interface alone.
Before using a hook:
- Review the hook contract code and audits
- Verify deployment addresses per network
- Start with small test transactions
- Pay attention to in-app hook warnings