The first Uniswap v4 Hook that turns AI intent into real-world commerce — with on-chain enforcement, smart pricing, and a built-in loyalty engine.
AI agents can propose any transaction. There's no on-chain layer verifying that the agent's plan matches the user's real intent.
Uniswap swaps are raw token exchanges. No merchant verification, no loyalty rewards, no commerce logic. Unusable for real-world payments.
AMM fees ignore user context. A loyal VIP customer pays the same fee as a first-time user. No commerce-aware dynamic pricing exists.
User says "Pay $30 to Hot Pot King with USDC" → AI compiles to PaymentIntent struct → planHash = keccak256(intent) verified on-chain
Multiple AI agents bid for optimal execution route. Agents stake tokens → sealed bids → Hook selects best → winner earns fee, losers keep stake.
beforeSwap() enforces: merchant whitelist, operating hours, transaction limits, slippage bounds, intent hash verification. Invalid = revert.
Dynamic fee = f(loyalty tier, peak hours, volatility). Not a simple discount — it's the first context-aware fee model for real-world commerce on an AMM.
99% merchant / 0.5% platform / 0.5% reward pool auto-split. FOODY cashback, loyalty points, tier upgrades, and VIP Soulbound NFT auto-mint.
struct PaymentIntent { address diner; // Consumer address restaurant; // Merchant address tokenIn; // Payment token uint256 amountIn; // Payment amount uint256 minAmountOut; // Minimum received uint16 maxFeeBps; // Max fee tolerance uint48 expiry; // Expiration timestamp bytes32 orderId; // Order identifier bytes32 intentHash; // AI Agent signed hash }
function beforeSwap(..., bytes calldata hookData) { PaymentIntent memory intent = abi.decode(hookData, (PaymentIntent)); // Layer 0: Intent Verification require(intent.intentHash == keccak256(abi.encode(intent)), "INVALID_INTENT"); require(block.timestamp <= intent.expiry, "INTENT_EXPIRED"); // Layer 2: Commerce Guard require(restaurants[intent.restaurant].isActive, "MERCHANT_NOT_FOUND"); require(_isWithinHours(intent.restaurant), "CLOSED"); require(intent.amountIn <= restaurants[intent.restaurant].maxTxLimit, "OVER_LIMIT"); // Layer 3: Smart Pricing uint24 fee = _calculateFee(intent.diner, intent.restaurant, intent.amountIn); poolManager.updateDynamicLPFee(key, fee); }
function afterSwap(...) { // Layer 4: Auto Settlement (99/0.5/0.5) _splitSettlement(restaurant, amountOut); // Loyalty Update _updateLoyalty(diner, amountIn); // VIP Soulbound NFT Auto-Mint if (loyaltyPoints[diner] >= VIP_THRESHOLD) { _mintVIPSoulbound(diner); } }
forge test -vvFee formula: dynamic_fee = base_fee(3000) - tier_discount - peak_bonus
The only Uniswap v4 Hook combining AI intent verification, agent execution, and real-world commerce in a single contract.
Not a simple if-else Hook — a complete protocol stack with intent verification, commerce guards, smart pricing, and settlement.
Directly connects Uniswap liquidity to physical merchants. Not another DEX tool — a bridge to real commerce.
End-to-end on-chain demos: payment flows, merchant validation, operating hours enforcement, VIP NFT minting, and dynamic fee calculation.
Directly implements the AI wallet thesis: AI suggests, local simulation verifies, the protocol enforces. A natural evolution of the smart wallet.
Introduces "Intent-Enforced Liquidity" — a new DeFi primitive where swaps carry verifiable merchant context.
Coinbase's open protocol turns HTTP 402 "Payment Required" into a machine-native payment layer. AI agents pay per-request in USDC — fractions of a cent, no human in the loop.
Google Cloud, AWS, and Anthropic have adopted x402. Over 50 million agent transactions processed. The infrastructure is live — the ecosystem is ready.
Our Hook turns every restaurant into a programmable payment endpoint. AI agents pay with USDC on Base — no API keys, no signups. One wallet, instant access to every merchant.
Zero-knowledge proofs close the trust gap — verify a payment is authentic without revealing private data. No more "pay and hope." On-chain enforcement guarantees what you paid for.
FoodySwap's 0.5% platform fee is settled on-chain in real-time. No invoices, no 30-day net terms. Every swap splits settlement instantly — 99% merchant, 0.5% platform, 0.5% rewards.
In the x402 world, agents don't visit websites or read docs — they query endpoints and pay or move on. FoodySwap makes every Uniswap pool a commerce vending machine.
Intent verification, commerce guard, smart pricing, settlement & loyalty engine. Full test suite and demo.
Multiple AI agents bid for best execution. Staking, sealed bids, reputation scoring. Creating an on-chain agent marketplace.
Autonomous LP rebalancing using AI signals. Volatility-adaptive fees, liquidity density optimization, strategy profiles.
Onboard real restaurants, cross-merchant loyalty, FOODY token economy, and merchant analytics dashboard.
FoodySwap makes every Uniswap pool a point-of-sale.