GluexRouter
smart contract (version 1.1) represents an optimized iteration of our routing infrastructure. It provides enhanced functionality for highly efficient token routing, dynamic fee collection and the precise execution of onchain interactions through a refined, structured interface. This version introduces advanced mechanisms for surplus and slippage sharing
GluexRouter-v1.1
contract is deployed at the following address on the supported chains by GlueX:
Contract Address: 0xe95F6EAeaE1E4d650576Af600b33D9F7e5f9f7fd
IExecutor
contract using a predefined set of interactions
Function Signature
executor
(IExecutor
): The executor contract responsible for processing interactionsdesc
(RouteDescription calldata
): A structured object containing input/output token information, fees, limits and recipient addressesinteractions
(Interaction[] calldata
): An array of interaction steps to be executed by the executorfinalOutputAmount
(uint256
): The final amount of output token received by the outputReceiver
after fees and surplus/slippage sharingInvalidNativeTokenInputAmount
: If the ETH value sent does not match the expected input amountRoutingFeeTooHigh
: If desc.routingFee
exceeds the maximum allowed fee (_MAX_FEE
)RoutingFeeTooLow
: If desc.routingFee
is below the minimum required fee (_MIN_FEE
)PartnerSurplusShareTooHigh
: If desc.partnerSurplusShare
exceeds _MAX_PARTNER_SURPLUS_SHARE_LIMIT
ProtocolSurplusShareTooLow
: If desc.protocolSurplusShare
is below _MIN_PROTOCOL_SURPLUS_SHARE_LIMIT
PartnerSlippageShareTooHigh
: If desc.partnerSlippageShare
exceeds _MAX_PARTNER_SLIPPAGE_SHARE_LIMIT
ProtocolSlippageShareTooLow
: If desc.protocolSlippageShare
is below _MIN_PROTOCOL_SLIPPAGE_SHARE_LIMIT
ZeroAddress
: If any required address (eg: inputReceiver
, outputReceiver
) is a zero addressInvalidSlippage
: If desc.minOutputAmount
is zeroSlippageLimitTooLarge
: If desc.minOutputAmount
exceeds desc.outputAmount
InsufficientBalance
: If the router does not hold sufficient balance for the intended transferNativeTransferFailed
: If the native token transfer failsuniquePID
(bytes): The unique identifier 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 outputfinalOutputAmount
(uint256): The actual output amount received after routingpartnerFee
(uint256): The fee charged for the partnerroutingFee
(uint256): The fee charged for the routing operationpartnerShare
(uint256): The share of surplus/slippage allocated to the partnerprotocolShare
(uint256): The share of surplus/slippage allocated to the protocol