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: Bridging Liquidity and Data
  • Phase 1B: Receiving Liquidity and Data
  • Phase 2A: Depositing and Sending Acknowledgment to Source
  • Phase 2B: Receiving Acknowledgement
  • Phase 3: Minting SuperPositions

Was this helpful?

  1. E2E Flows

Cross-chain Deposit

Last updated 7 months ago

Was this helpful?

Phase 0: Route Generation and Selection

  1. The user selects a vault to deposit into, a funding token, and the amount to deposit into the vault

  2. User requests routes from the Superform API

  3. User selects a route

  4. User approves permit2 contract for funding token (if needed)

Phase 1A: Bridging Liquidity and Data

Atomic phase

  1. Once the request is initiated, the tokens may be swapped to the target vault's underlying token if the funding token differs from the underlying. The swap can be performed before the bridge, on the source chain, or after the bridge, on the destination chain. Swaps will be performed on the chain with the best execution

Phase 1B: Receiving Liquidity and Data

Transit phase (non-atomic)

  1. In no particular order

  2. Updater Keeper calls updateDepositPayload to finalize amount of tokens received before the deposit is processed

Phase 2A: Depositing and Sending Acknowledgment to Source

Atomic phase

  1. Processor Keeper calls processPayload to trigger the deposit into the vault

  2. This triggers xChainDepositIntoVault and tokens are deposited into the target vault via the target vault’s Superform contract

  3. Vault shares are minted to target vault’s Superform

Phase 2B: Receiving Acknowledgement

Transit phase (non-atomic)

Phase 3: Minting SuperPositions

Atomic phase

  1. Payload is validated

User calls singleXChainSingleVaultDeposit. The function sends the funding token and data containing desired bridge/swap route and end states (chain, vault) to . The function parameters are complex; therefore, using the Superform API to generate valid function parameters is suggested

bridges the tokens via the bridge route selected in the first step

generates a payload and proof with the singleVaultSFData and calls dispatchPayload to send them via the AMBs specified in initial request. This payload contains instructions that will use on the destination chain for how to process the incoming tokens

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

Payload is received by on the destination chain

Payload proof is received by on the destination chain

Liquidity/tokens are received by on the destination chain

ALTERNATIVELY: Tokens are received by dstSwapper. dstSwapper Keeper will call processTx which will swap the the bridged tokens and send them to

Destination generates an acknowledgement payload and proof and calls dispatchPayload to send them back to the source chain with the same AMBs used in the initial request. In this payload the exact amount of vault shares minted will be sent back to the source chain so the equivalent amount of can be minted to the depositing user

Acknowledgment payload is received by on the source chain

Acknowledgement payload proof is received by on the source chain

processor calls processPayload

are minted to the user

SuperformRouter
SuperformRouter
SuperformRouter
CoreStateRegistry
SuperformRouter
PayMaster
CoreStateRegistry
CoreStateRegistry
CoreStateRegistry
CoreStateRegistry
CoreStateRegistry
SuperPositions
CoreStateRegistry
CoreStateRegistry
CoreStateRegistry
SuperPositions