Skip to main content
ClankerSniperAuctionV2 is a MEV module that combines the sniper auction of ClankerSniperAuctionV0 with fee behavior similar to ClankerMevDescendingFees.

How it works

Deployers specify a starting LP fee (up to 80%), an ending fee and a time to descend (up to 2 minutes). Clanker’s original recommended configuration starts effective fees at 80% and descends to 5% over 30 seconds, after which the pool’s normal fee behavior starts. The clanker.world form’s default is 80% to 5% over 15 seconds. For the reasoning behind these choices, see the Clanker v4 sniper activity writeup. All auctioned swaps pay the applied LP fee from FeeConfig.startingFee, and the fee descent starts in the block the auction concludes in.

Initialization

Unlike V0, ClankerSniperAuctionV2 requires configuration data. The setup matches the ClankerMevDescendingFees module:

Sniper interactions

The interface for passing in swap data changed between ClankerHook and ClankerHookV2. For a swap’s hookData to reach the MEV module, it must be encoded in the PoolSwapData struct:
The new ClankerSniperUtilV2 example implementation does the expected encoding and works with both versions of the sniper auction.

Approving ClankerSniperAuctionV2 to spend WETH

Clanker does not recommend approving ClankerSniperAuctionV2 to spend WETH unless an auxiliary contract handles the approval and reverts if the bid doesn’t win. For example, if an EOA approves the auction contract to spend WETH, anyone can spend that EOA’s WETH by passing the EOA’s address as the auctionData parameter to ClankerSniperAuctionV0::beforeSwap. The ClankerSniperUtilV2 contract shows how to handle this safely.