SuperformRouterPlus

Overview

The SuperformRouterPlus contract is an extension of the SuperformRouter contract, adding advanced functionalities for rebalancing between SuperPositions or entering the system with ERC4626 shares. This contract is part of the Superform ecosystem and builds on the core functionalities provided in the base SuperformRouter.

Key Features

  • Extends the base router contract functionality.

  • Supports rebalancing of superPositions (same chain and cross chain, via SuperformRouterPlusAsync)

  • Allows users to enter into Superform with 4626 shares

Functions

rebalanceSinglePosition

function rebalanceSinglePosition(RebalanceSinglePositionSyncArgs calldata args) external payable;

Parameters:

Name
Description

id

The uint256 ID of the position to rebalance.

sharesToRedeem

The uint256 amount of shares to redeem from the position.

expectedAmountToReceivePostRebalanceFrom

The expected uint256 amount of assets to be received after the rebalance.

rebalanceFromMsgValue

The uint256 ETH amount sent to cover the rebalance from operation.

rebalanceToMsgValue

The uint256 ETH amount sent to cover the rebalance to operation.

interimAsset

The address of the interim asset used for the rebalance process.

slippage

The uint256 maximum allowable slippage for the rebalance.

receiverAddressSP

The address of the receiver. This is the address to receive the rebalanced position.

callData

The call data for the rebalance from function.

rebalanceToCallData

The call data for the rebalance to function.

Description:

This function facilitates rebalancing a single SuperPosition synchronously, ensuring that interim assets and receiver addresses are properly handled.


rebalanceMultiPositions

function rebalanceMultiPositions(RebalanceMultiPositionsSyncArgs calldata args) external payable;

Parameters:

Name
Description

ids

An array of position IDs to rebalance.

sharesToRedeem

An array of share amounts to redeem for each position.

expectedAmountToReceivePostRebalanceFrom

The total expected amount to be received after the rebalance.

rebalanceFromMsgValue

The ETH amount sent for covering the rebalance from operation.

rebalanceToMsgValue

The ETH amount sent for covering the rebalance to operation.

interimAsset

The interim asset used in the rebalance process.

slippage

The allowable slippage for the rebalance.

receiverAddressSP

The address to receive the rebalanced positions.

callData

The call data for the rebalance from function.

rebalanceToCallData

The call data for the rebalance to function.

Description:

This function rebalances multiple SuperPositions synchronously. It ensures the proper handling of interim assets, slippage, and receiver addresses across all positions.


startCrossChainRebalance

function startCrossChainRebalance(InitiateXChainRebalanceArgs calldata args) external payable;

Parameters:

Name
Description

id

The ID of the position being rebalanced.

sharesToRedeem

The number of shares to redeem.

receiverAddressSP

The address to receive the rebalanced position.

interimAsset

The interim asset used during the cross-chain rebalance.

finalizeSlippage

The slippage tolerance during the finalization step of the rebalance.

expectedAmountInterimAsset

The expected amount of interim asset to receive.

rebalanceToSelector

The selector of the rebalance function to call on the destination chain.

callData

The call data to pass along for the rebalance.

rebalanceToAmbIds

The array of AMB (Asynchronous Message Bus) IDs for the rebalance.

rebalanceToDstChainIds

The destination chain IDs for cross-chain rebalances.

rebalanceToSfData

Additional data required for Superform functionality during the rebalance.

Description:

This function initiates the cross-chain rebalance of a single position, transferring interim assets across chains and managing slippage tolerances and message passing.


startCrossChainRebalanceMulti

function startCrossChainRebalanceMulti(InitiateXChainRebalanceMultiArgs memory args) external payable;

Parameters:

ids

An array of position IDs to rebalance.

sharesToRedeem

The number of shares to redeem for each position.

receiverAddressSP

The address to receive the rebalanced positions.

interimAsset

The interim asset used during the cross-chain rebalance.

finalizeSlippage

The slippage tolerance for finalization.

expectedAmountInterimAsset

The expected amount of interim asset to receive.

rebalanceToSelector

The selector of the rebalance function to call on the destination chain.

callData

The call data to pass for the rebalance.

rebalanceToAmbIds

The array of AMB (Asynchronous Message Bus) IDs.

rebalanceToDstChainIds

The destination chain IDs.

rebalanceToSfData

Additional data for Superform-specific rebalances.

Description:

This function starts the cross-chain rebalance of multiple positions, handling all details of cross-chain transfers, interim assets, and rebalancing logic across multiple positions.


deposit4626

function deposit4626(address vault_, Deposit4626Args calldata args) external payable;

Parameters:

Name
Description

vault_

The address of the ERC4626 vault from which to redeem tokens.

amount

The amount of tokens to deposit.

expectedOutputAmount

The expected output amount from the deposit.

maxSlippage

The maximum allowable slippage for the deposit.

receiverAddressSP

The address to receive the deposited tokens.

depositCallData

The call data to execute the deposit operation.

Description:

This function deposits ERC4626 vault shares into Superform, handling slippage tolerances and receiver addresses, and facilitates interacting with the Superform ecosystem through ERC4626 shares.

Last updated