Superform v1
  • Introduction
  • Components
    • Protocol
    • Keepers
    • API
    • App
  • E2E Flows
    • Same-chain Deposit
    • Cross-chain Deposit
    • Same-chain Withdrawal
    • Cross-chain Withdrawal
  • Periphery Contracts
    • SuperformRouter
      • SuperformRouterPlus
      • SuperformRouterPlusAsync
    • PayMaster
    • PaymentHelper
    • EmergencyQueue
    • SuperformFactory
    • Forms
      • ERC4626Form
      • ERC5115Form
      • ERC7540Form
    • SuperPositions
      • ERC1155A
    • RewardsDistributor
  • Core Contracts
    • State Registries
      • CoreStateRegistry
      • AsyncStateRegistry
      • PayloadHelper
    • AMB Implementations
      • LayerzeroImplementation
      • LayerzeroV2Implementation
      • WormholeARImplementation
      • HyperlaneImplementation
      • AxelarImplementation
    • Broadcasting
      • BroadcastRegistry
      • WormholeSRImplementation
    • Bridge Validators
      • LiFiValidator
      • SocketValidator
      • SocketOneInchValidator
      • DebridgeValidator (and forwarder)
      • OneInchValidator
    • DstSwapper
    • Settings
      • SuperRBAC
      • SuperRegistry
  • SuperVaults
    • SuperVaults
  • Resources
    • Deployment Addresses
    • Subgraphs
      • Protocol Level Entities
      • Form Related Entities
      • Deposits and Withdrawals
      • SuperPosition Events
      • External Entities
    • Infrastructure Integrations
    • Security & Audits
    • Protocol License
    • Glossary
    • Protocol Multisig
    • Superform Labs Socials
Powered by GitBook
On this page
  • Phase 0: Route Generation and Selection
  • Phase 1A: Burning SuperPositions and Sending Data
  • Phase 1B: Receiving Data
  • Phase 2A: Withdrawing Tokens and Sending Them to the User
  • Phase 2B: Receiving tokens on the target chain

Was this helpful?

  1. E2E Flows

Cross-chain Withdrawal

Last updated 6 months ago

Was this helpful?

Phase 0: Route Generation and Selection

  1. User selects vaults to withdraw from, a target token, and the amount to withdraw from each vault

  2. User requests routes from the Superform API

  3. User selects a route

  4. User approves the contract to burn selected (if needed)

Phase 1A: Burning SuperPositions and Sending Data

Atomic phase

Phase 1B: Receiving Data

Transit phase (non-atomic)

  1. In no particular order

Phase 2A: Withdrawing Tokens and Sending Them to the User

Atomic phase

  1. Processor Keeper calls processPayload to trigger the redemption of vault shares from the target vault for the underlying tokens

  2. Underlying tokens may be swapped at this point into the target token if the target token is not the underlying token

  3. If the target token is on another chain, the tokens will be bridged to the target chain, otherwise the tokens will be sent to the user’s address on the vault chain

Phase 2B: Receiving tokens on the target chain

Transit phase

  1. If the target chain was different than the vault chain, tokens will be received by the user directly from the bridge contract after bridging completes

User calls singleXChainSingleVaultWithdraw. The function burns the user designated amount of . The function parameters are complex; therefore, using the Superform API to generate valid function parameters is encouraged

generates a payload and proof that contains singleVaultSFData and calls dispatchPayload to send them via the AMBs specified in the route. This payload contains the desired bridge/swap route and end states (chain, vault, amounts, slippage). Sending liqRequest.txData on withdrawals is optional; if provided, it will reduce reliance on Superform Keepers, but increase the likelihood of the transaction failing requiring to be re-minted

sends the cross-chain payment to the contract on the source chain

Payload is received by on destination

Payload proof is received by on destination

updateWithdrawPayload is called by the updater Keeper to provide the with the txData if it wasn't provided in the payload based on the user intent

SuperPositions
SuperformRouter
SuperPositions
SuperformRouter
PayMaster
CoreStateRegistry
CoreStateRegistry
CoreStateRegistry
SuperPosition
SuperPositions