GluexRouter smart contract (version 1) facilitates secure and efficient execution of complex DeFi operations. It provides versatile functionality for routing tokens, collecting protocol fees and executing diverse onchain interactions via a structured interface. The contract prioritizes high security and usability, ensuring strict adherence to predefined routing and slippage rules
Deployment
TheGluexRouter-v1 contract is deployed at the following address on the supported chains by GlueX:
Contract Address: 0x6Ec7612828B776cC746fe0Ee5381CC93878844f7
Functions
Swap
Executes a token routing operation using a specifiedIExecutor contract and predefined interaction data. This function is the primary entry point for orchestrating multi-step DeFi flows
Function Signature
executor(IExecutor): The executor contract performing the interactionsdesc(RouteDescription calldata): The route description containing input, output and fee detailsinteractions(Interaction[] calldata): The interactions encoded for execution by the executordeadline(uint256): The timestamp after which the transaction will revert
finalOutputAmount(uint256): The final amount of output token received
Deadline passed: If the block timestamp exceeds the deadlineRouting fee too high: Ifdesc.routingFeeexceeds _MAX_FEERouting fee too low: Ifdesc.routingFeeis below _MIN_FEENegative slippage limit: Ifdesc.minOutputAmountis less than or equal to zeroSlippage limit too large: Ifdesc.minOutputAmountexceedsdesc.outputAmount
Events
Routed
Emitted upon the successful completion of a token routing operation Event SignatureuniquePID(bytes): The unique identifier (integrator id) for the partneruserAddress(address): The address of the user who initiated the routeoutputReceiver(address): The address of the receiver of the output tokeninputToken(IERC20): The ERC20 token used as inputinputAmount(uint256): The amount of input token used for routingoutputToken(IERC20): The ERC20 token received as outputoutputAmount(uint256): The expected output amount from the routepartnerFee(uint256): The fee charged for the partnerroutingFee(uint256): The fee charged for the routing operationfinalOutputAmount(uint256): The actual output amount received after routing