Crosschain TWAP into ETH to any EVM blockchain with USDC using Circle CCTP V2
This project enables cross-chain TWAP (Time-Weighted Average Price) swaps from USDC to ETH using Circle’s CCTP and Uniswap V4 with custom hooks. A user on the source chain specifies the USDC amount and TWAP timeframe, then signs an off-chain permit to allow spending on the destination chain. The system calls depositForBurnWithHook
on the CCTP Token Messenger, burns the USDC, and waits for an attestation from Iris. Once received, a self-deployed CCTPHookWrapper
on the destination chain calls relay
to mint USDC and trigger hook execution. The hook target is the Uniswap V4 Router, where a custom hook intercepts the beforeSwap
to enforce the TWAP logic, executing ETH purchases over time. Users interacting with the Uniswap V4 USDC-ETH pool that includes this TWAP hook help crank the logic and earn rewards for their participation.
Using Circle CCTP V2 Hooks to burn-and-mint and include data in the same message. Leveraged Fast Transfer enabled by CCTP V2 to improve the whole bridging process to almost instantly. Found out current deployed CCTP V2 contracts does not call hooks by itself but.have to deploy own CCTPHookWrapper on destination chain to do so. Also to make the transaction atomic, a permit signature has to be signed before bridging to make sure that the USDC on destination can be spend by Uniswap router. Made some plans on Uniswap V4 hook but unfortunately did not have enough time to execute.