# Hooker Protocol: Shared Keeper Infrastructure via Liquidity Hooking
## Abstract
Hooker is a decentralized infrastructure protocol that transforms swap activity into a shared keeper network. By enabling protocols to attach custom logic ("hooks") when providing liquidity, Hooker automates on-chain maintenance—such as oracle updates, interest accruals, and emissions—without the need for bots, off-chain coordination, or third-party networks. Protocols save on gas, streamline upkeep, and convert their liquidity positions into execution power. This whitepaper outlines the architecture, economic model, and integration pathways for Hooker as a new primitive in automated protocol infrastructure.
## Introduction
Protocols across DeFi rely on periodic or condition-based keeper operations to maintain system health: oracle updates, interest accruals, emission tracking, and more. Today, these operations are delegated to external keeper networks (Chainlink Automation, Gelato, Keep3r) which require infrastructure coordination, token payments, and per-protocol gas costs.
Hooker introduces a paradigm shift: use user-triggered swap flows in liquidity pools as the backbone for system upkeep. Protocols register on-chain hook contracts when they provide liquidity. These hooks are executed automatically on user interactions, and are deregistered when liquidity is removed. This creates a permissionless, composable, and cost-efficient automation layer.
## Architecture

*Illustration of how a user swap triggers the core pool hook, followed by all active protocol-specific hooks.*
### Pool-Level Design
Each Hooker Pool consists of:
- A core AMM mechanism (Uniswap-style, or custom)
- A single global `PoolHook` contract
- A registry of protocol-specific hook contracts
### Hook Registration
When a protocol adds liquidity to a Hooker Pool:
- It specifies a hook contract address
- The hook is registered alongside the LP token balance
- Hooks are automatically removed when liquidity is withdrawn
### Swap Execution Flow
1. User calls `swap()`
2. Core trade logic executes
3. Global pool hook is triggered
4. All active protocol-specific hooks are called
5. Each hook executes custom logic (oracle sync, rebasing, rate updates, etc.)
### Safety Considerations
- Hook calls are isolated via `try/catch`
- Gas usage per hook is capped
- Hooks are non-blocking to preserve swap UX
## Liquidity Models

*Comparison of dual-sided, ETH-only, and DAI-only LP models showing who provides what, and who bears impermanent loss.*
Hooker supports multiple liquidity models, giving protocols the flexibility to choose how they provide capital and manage exposure to impermanent loss (IL).
### Dual-Sided Liquidity
Protocols may provide both DAI and ETH to LP in a Hooker pool. This gives them direct exposure to trading volume and fee generation while accepting the risk of impermanent loss in both assets.
### Single-Sided ETH LP (Hooker Provides DAI)
- Protocols deposit ETH via Hooker’s UI
- Hooker pairs this ETH with DAI from its own treasury
- LP tokens are minted and hooks activated
- Hooker bears IL on the DAI side, while protocols contribute only ETH
### Single-Sided DAI LP (Hooker Provides ETH)
- Protocols deposit DAI via Hooker’s UI
- Hooker pairs this DAI with ETH from its own reserves
- LP tokens are minted and hooks activated
- Protocols bear IL, Hooker avoids exposure
### Comparative Analysis
| Model | Protocols Provide | Hooker Provides | IL Risk | Protocol Friction | Hooker Treasury Load |
|-------|-------------------|-----------------|---------|-------------------|----------------------|
| Dual-Sided | DAI + ETH | - | Shared | High | None |
| ETH-Only | ETH | DAI | Hooker | Low | High (DAI reserves) |
| DAI-Only | DAI | ETH | Protocol | Medium | Medium (ETH reserves) |
By offering multiple liquidity pools under these different models, Hooker enables protocols to choose the model that best fits their treasury, risk tolerance, and strategic goals. Over time, Hooker may dynamically incentivize participation across these pools based on protocol needs and volatility conditions.
## Integration & Developer Experience

*Step-by-step overview from writing a hook, LPing, and registering logic to receiving automated upkeep via swap flow.*
Hooker is designed to be simple, fast, and flexible for protocols to adopt. The following features reduce integration friction and accelerate deployment.
### Standardized Hook Interface & Templates
Hooker defines a common hook interface:
```solidity
interface IHookerHook {
function onHookTrigger(address user, bytes calldata data) external;
}
```
Reference templates are provided for common use cases like:
- Oracle updates
- Interest accrual
- Emission tracking
- Supply rebasing
These templates are published as open-source contracts and npm packages.
### Deployment Wizard & UI
Hooker offers a web-based UI that:
- Accepts custom or templated hook contracts
- Simulates hook gas usage and safety
- Allows protocol teams to LP and register their hook in one transaction
This reduces the integration flow to a guided, no-code-required process.
### Frequency & Cost Dashboard
Hooker maintains live dashboards showing:
- Historical swap frequency per pool
- Estimated hook call frequency
- Average gas cost per call
- Projected daily cost and LP rewards
Protocols can compare pools and choose the optimal tradeoff between call frequency and LP profitability.
### Multi-Pool Fee Tiers
To support varying protocol needs, Hooker offers multiple pools:
| Pool Name | Fee Tier | Avg Swap Frequency | Best For |
|------------------|----------|--------------------|----------------------------------------|
| Hooker Light | 0.05% | Low | Low-cost, infrequent triggers |
| Hooker Standard | 0.3% | Medium | General-purpose upkeep |
| Hooker Turbo | 1.0% | High | Time-sensitive logic (e.g. rebase, oracles) |
Each pool type offers different economics, empowering protocols to self-select based on urgency, cost sensitivity, and upkeep frequency.
## Subsidizing Fixed-Interval Keeper Operations
While Hooker is designed to opportunistically trigger protocol logic through user swaps and arbitrage activity, some protocols may require their hooks to execute on a relatively fixed interval—regardless of market volatility or swap frequency. These include use cases such as:
• Time-based emissions
• Interest accrual
• Scheduled governance checks
• Rate dampening or decay mechanisms
To accommodate these needs, Hooker supports subsidy-based triggering for low-activity periods.
### Mechanism Overview
Each pool includes a subsidy layer that tracks a per-hook maximum time that can pass before a hook is subsidized.
Protocol hooks with lower maximum intervals must pay higher fees as they will be subsidized more.
If a hook has not been triggered by organic swap activity within its maximum interval, the next swap that calls the hook may receive a gas subsidy or bonus to incentivize continued execution.
Alternatively, a keeper fallback hook may be triggered from within the pool or by an external actor, with the subsidy covering the base gas cost.
#### Funding the Subsidy
Subsidies are tracked per-hook and paid from each protocol's LP position when liquidity is withdraw.
Subsidies are only paid when a protocol’s hook is overdue and successfully executed, ensuring they are cost-efficient and tied to system health.
### Benefits
Protocols can maintain consistent behavior even in low-volume markets.
Hook calls remain opportunistic during high activity, and only subsidized when needed
Developers can design hooks with guaranteed execution expectations.
Each protocol can define its own maximum interval and subsidy budget.
### Optional Extensions
* Hooker DAI may allow protocols to bond tokens to guarantee their subsidy stream
* Third-party keepers may compete to trigger overdue hooks and claim the subsidy (hybrid fallback model)
This layer ensures that Hooker’s decentralized automation infrastructure can support both event-driven and interval-driven upkeep with minimal friction.
### Optional Hosted Hook Service
Hooker may offer a hosted hook service:
- Protocol teams submit hook logic via UI
- Hooker deploys and manages execution on their behalf
- Ideal for protocols with limited dev resources or one-time logic
This service can evolve into a monetized SaaS layer or be open-sourced.
## Economic Model
### Gas Sharing
- Swap base gas is paid by the user
- ***Each protocol pays only the marginal gas cost of its hook***
- Protocols no longer need to pay for independent keeper transactions
### Protocol Profitability
Hooker can monetize through:
- Micro-fees per hook execution
- MEV exposure around hook-influenced state updates
- Tiered or auctioned access to hook bandwidth
- Token-gated or staked priority access
### Cost Comparison
| Feature | Hooker | Chainlink | Gelato | Keep3r |
|------------------|---------------------|-----------|--------|--------|
| Gas Cost / Hook | Marginal (shared) | Full | Full | Full |
| Payment Method | LP-based | LINK | ETH | KP3R |
| Integration | LP + hook | Registry | Resolver| Job Reg |
| Permissionless | Yes | Mostly | Yes | Semi |
## Advantages
- **Capital Efficiency**: Share one tx cost across many protocols
- **Composability**: Protocols define arbitrary logic via hooks
- **Ease of Use**: No bot infra or token staking required
- **Decentralization**: LPing = permissionless execution rights
- **Profit Model**: Hooker is a net-profitable protocol
- **Flexible Liquidity Onboarding**: Multiple LP models allow tailored risk/reward alignment
- **Streamlined Developer Experience**: Templates, wizards, and dashboards simplify adoption
## Use Cases
- Oracle synchronization
- Interest rate accruals
- Emissions distribution
- Time-based rebalancing
- Reflexive supply control
## Future Enhancements
- Hook priority queues (based on LP amount)
- Hook gas usage analytics dashboard
- Governance for hook contract whitelisting (optional)
## Arbitrage Frequency Reference

*Visual heatmap or chart representing how ETH/USD volatility and gas prices affect hook call frequency in the Hooker system.*
To estimate how often a protocol's hook will be triggered, we consider ETH/USD volatility and gas prices, which influence the frequency of arbitrage between DAI/USDC and DAI/ETH pools.
| **Gas Price (Gwei)** | **Low Volatility (≤2% daily)** | **Moderate Volatility (2-5% daily)** | **High Volatility (>5% daily)** |
|----------------------|-------------------------------|-------------------------------------|---------------------------------|
| **10** | ~1 hour | ~30 minutes | ~10 minutes |
| **50** | ~4 hours | ~2 hours | ~30 minutes |
| **100** | ~12 hours | ~6 hours | ~1 hour |
*Note: These are illustrative estimates. Empirical modeling is recommended for precise calibration.*
## Conclusion
Hooker reimagines automation in DeFi by enabling protocols to permissionlessly execute on-chain logic through liquidity provisioning. By shifting upkeep from external keepers to embedded, event-driven hooks, Hooker delivers a cleaner, cheaper, and more composable keeper layer. This unlocks a new primitive for protocol self-maintenance and shared economic infrastructure.
## Appendix
- Reference implementation (Solidity)
- Gas profiling estimates
- Comparisons to Chainlink/Gelato/Keep3r in varied volatility regimes