ExchangeRouter
The ExchangeRouter is the primary entry point for user interactions with the HertzFlow protocol.
ExchangeRouter handles:
Creating deposits and withdrawals
Creating and managing orders
Creating and managing shifts
Claiming fees and collateral
External calls for integrations
cancelDeposit
Cancel a pending deposit.
function cancelDeposit(bytes32 key) external payable;
createDeposit
Create a deposit request to add liquidity.
function createDeposit(IDepositUtils.CreateDepositParams params) external payable returns (bytes32);
simulateExecuteDeposit
Simulate a deposit execution.
simulateExecuteLatestDeposit
Simulate execution of the latest deposit.
cancelWithdrawal
Cancel a pending withdrawal.
createWithdrawal
Create a withdrawal request to remove liquidity.
executeAtomicWithdrawal
Execute a withdrawal atomically (without keeper).
simulateExecuteLatestWithdrawal
Simulate execution of the latest withdrawal.
simulateExecuteWithdrawal
Simulate a withdrawal execution.
cancelShift
Cancel a pending shift.
createShift
Create a shift request to move liquidity between markets.
simulateExecuteLatestShift
Simulate execution of the latest shift.
simulateExecuteShift
Simulate a shift execution.
cancelOrder
Cancel a pending order.
createOrder
Create a new order (swap, increase, or decrease position).
simulateExecuteLatestOrder
Simulate execution of the latest order.
simulateExecuteOrder
Simulate an order execution.
updateOrder
Update a pending order.
Token Transfers
sendNativeToken
Transfer native tokens to a receiver.
sendTokens
Transfer ERC20 tokens from the caller to a receiver.
sendWnt
Transfer wrapped native tokens (WNT) to a receiver.
claimAffiliateRewards
Claim affiliate rewards.
claimCollateral
Claim collateral from capped price impact.
claimFundingFees
Claim accumulated funding fees.
claimUiFees
Claim UI fees.
makeExternalCalls
Perform external calls (e.g., swaps via aggregators) before protocol actions.
setSavedCallbackContract
Set a saved callback contract for liquidations and ADLs.
setUiFeeFactor
Set the UI fee factor for the caller.
multicall
Execute multiple calls in a single transaction (inherited from PayableMulticall).
dataStore
Get the DataStore contract address.
depositHandler
Get the DepositHandler contract address.
eventEmitter
Get the EventEmitter contract address.
externalHandler
Get the ExternalHandler contract address.
orderHandler
Get the OrderHandler contract address.
roleStore
Get the RoleStore contract address.
router
Get the Router contract address.
shiftHandler
Get the ShiftHandler contract address.
withdrawalHandler
Get the WithdrawalHandler contract address.