Infinity enables seamless crosschain swaps that guarantee the most optimal trade ratio to the end user by enabling a dutch-auction system to fullfill orders.
Infinity enables users to find most optimal swaps across chains whilst providing a simple UX to the end user.
A user can define his intent to swap as follows, "I want 10 LINK tokens on Scroll, use a maximum of 10 USDT, 10 USDC and 0.05 WETH from BASE and fulfill it within 10 seconds"
This data get serialized and the input tokens are locked in a contract to initiate a dutch-aution on scroll where solvers lock tokens to provide the best valued trade. Once the user-specified time period ends, the input tokens get released to the auction winner and output tokens get released to the user.
Creating a competition among solvers to provide the best possible price ensures that the user is getting the most optimal trade.
Following are the protocols being used
- Scroll, Celo, Mantle, Sepolia, Base and Arbitrum - Chains to deploy on
- Chainlink CCIP - to pass messages across chains
- Safe AA SDK - to enable seamless authentication and batching of transactions
User sends a transaction calling the below function on the InfinityEntrypoint
contract on the source chain
initiate(
address[] inputs,
address[] inputAmounts,
address output,
address outputAmount,
uint256 destChain,
uint256 duration
)
The contract locks all the input tokens within itself and uses CCIP to register the trade on destChain
Solvers call the below function on the InfinityEntrypoint
contract on the destination chain.
propose(
uint256 tradeId,
address inputValues[]
)
The contract gets the market price conversion (Mocked for now) to determine the new solution is better value than the previous provided / initial solution
Once the user-set duration elapses, the winner of the auction calls the below function to claim his reward and complete the trade, releasing funds to the user.
claim(
uint256 tradeId
)
The contract checks the defined duration has elapsed and releases funds on the destination chain to the user. It also makes another crosschain request to initiate release of funds on the source chain to the solver
- InfinityEntrypoint: 0x09246EeB9D56bDc7Cd66f1928764B05B07F4C47E
- InfinityEntrypoint: 0x28bBB720d15D63543861b5FC94bF93Bb4AdC680A
- CustomChainlinkRouter: 0xF6aC3c345296DCd381659Dff0bD04b53Ec213Bee
- InfinityEntrypoint: 0xc901A057a9037c3768090CEF25Dbbc9f06A23d32
- CustomChainlinkRouter: 0xA02A2706BD8C4be84A1fEB01741C10DDc975D857
- InfinityEntrypoint: 0x84335e34dbdE7eD4d15851B96E350FE010Cb7147
- CustomChainlinkRouter:0xF6aC3c345296DCd381659Dff0bD04b53Ec213Bee
- InfinityEntrypoint: 0x08e664C62E2ff8B390051eF24B08167204B6e62C
- CustomChainlinkRouter: 0xF6aC3c345296DCd381659Dff0bD04b53Ec213Bee
- InfinityEntrypoint: 0xc901A057a9037c3768090CEF25Dbbc9f06A23d32
- Live CCIP Message ID: 0x259440c5b04d8891a4dc5645ad89691c5c8aa5bca9860c7eb06d9a71f4abe538
- User Initiates Trade - here
- Trade propagates through CCIP - here
- Corresponding transaction on base-goerli chain - here
- Solvers propose solutions - here and here
- Winner of the auction claims the rewards - here
- A message again propagates through CCIP - here
- And initiates release of user funds on the destination chain - here