Hooks Reference

Explore our GitHub repositoryopen in new window containing reference mathematical implementations, in Javascript and Python, for supported Balancer hook types. Designed to assist developers and integrators in understanding the underlying swap calculations, these implementations can be imported as a packages into your project or serve as a reference for your own implementation.

For more details about Balancer V3 Hooks implementation see Hooks Core Concepts.

Supported Hook Types

Stable Surge Hook

function getMaxSurgeFeePercentage(address pool) external view returns (uint256);

event ThresholdSurgePercentageChanged(address indexed pool, uint256 newSurgeThresholdPercentage);

function getSurgeThresholdPercentage(address pool) external view returns (uint256);

event MaxSurgeFeePercentageChanged(address indexed pool, uint256 newMaxSurgeFeePercentage);
  • API Support: Can use the filter: includeHooks: [STABLE_SURGE], to include all pools using this hook type:
query MyQuery {
  aggregatorPools(
    where: {chainIn: SEPOLIA, includeHooks: [STABLE_SURGE], protocolVersionIn: 3}
  ) {
    address
    type
    hook {
      dynamicData {
        maxSurgeFeePercentage
        surgeThresholdPercentage
      }
    }
  }
}