ExchangeRouter

The ExchangeRouter is the primary entry point for user interactions with the HertzFlow protocol.

Overview

ExchangeRouter handles:

  • Creating deposits and withdrawals

  • Creating and managing orders

  • Creating and managing shifts

  • Claiming fees and collateral

  • Token transfers

  • External calls for integrations

Functions

Deposits

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.

Withdrawals

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.

Shifts

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.

Orders

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.

Claims

claimAffiliateRewards

Claim affiliate rewards.

claimCollateral

Claim collateral from capped price impact.

claimFundingFees

Claim accumulated funding fees.

claimUiFees

Claim UI fees.

External Calls

makeExternalCalls

Perform external calls (e.g., swaps via aggregators) before protocol actions.

Settings

setSavedCallbackContract

Set a saved callback contract for liquidations and ADLs.

setUiFeeFactor

Set the UI fee factor for the caller.

Multicall

multicall

Execute multiple calls in a single transaction (inherited from PayableMulticall).

View Functions

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.


Notes

circle-info

This documentation was auto-generated from the contract ABI.

Last updated