Claim Deployer Fees
After graduation, the deployer receives 30% of trading fees. Here's how to claim them.
Check Claimable Balance
const hook = new ethers.Contract(HOOK_ADDRESS, HOOK_ABI, provider);
// Check if fees are available to distribute first
const canDist = await hook.canDistribute(tokenAddress);
const pending = await hook.getPendingFees(tokenAddress);
// Check already-distributed deployer balance
const claimable = await hook.deployerBalance(tokenAddress);
console.log("Pending fees:", ethers.utils.formatEther(pending));
console.log("Claimable now:", ethers.utils.formatEther(claimable));
Step 1: Distribute Fees (if needed)
// Anyone can call distributeFees — it's permissionless
if (canDist) {
await (await hook.connect(signer).distributeFees(tokenAddress)).wait();
}
Step 2: Withdraw
// Only the deployer can call this
await (await hook.connect(signer).withdrawDeployerFees(tokenAddress)).wait();
Automate Distribution
Since distributeFees() is permissionless, you can set up a bot or Gelato task to call it periodically. This ensures the 60% reinvestment happens regularly, growing liquidity.