For the complete documentation index, see llms.txt. This page is also available as Markdown.

Cross-Chain Deposit and Redeem

Onyx supports deposits and redemptions from other chains via Chainlink CCIP. Cross-chain support is a transport layer wrapped around the ordinary deposit and redeem flows on the vault's chain: the vault and its issuance components are unaware of cross-chain activity — from their perspective, they are dealing with an ordinary depositor on their own chain.

Wallets Manager

The vault-chain side is coordinated by the wallets manager (the WalletsManager), a vault component that is the receiver of all incoming CCIP messages. For each message, it deploys the sender's depositor wallet if needed, forwards any bridged tokens to it, and executes the message's instructions through it. It is the only account authorized to operate the depositor wallets, and always on behalf of each wallet's one depositor.

Depositor Wallets

Each (source chain, depositor) pair gets its own dedicated depositor wallet contract on the vault chain (the DepositorWallet), deployed by the wallets manager the first time a message arrives from that depositor.

The depositor wallet acts as the depositor's on-chain representative on the vault chain:

  • It holds the depositor's bridged assets and shares.

  • It is the account that the vault's deposit and redeem handlers see as their depositor and request controller.

Depositor wallet addresses are deterministic, so a depositor's wallet address can be computed in advance — before it is deployed — and used as a parameter in the instructions of the first message.

Deposit Flow

A cross-chain deposit is a single CCIP message from the source chain, carrying the deposit asset together with instructions for what to do with it:

  1. The depositor sends a CCIP message from the source chain, bridging the deposit asset and including instructions (e.g. approve and deposit).

  2. On the vault chain, the wallets manager deploys the depositor wallet if it does not yet exist, and forwards the bridged asset to it.

  3. The depositor wallet executes the instructions, performing the ordinary vault-chain deposit — either a sync deposit (shares minted immediately) or a request to the async deposit queue (executed later in a batch by an admin).

  4. Shares are minted to the depositor wallet, where they remain held on the depositor's behalf.

Getting Tokens Back

Shares minted on deposit remain in the depositor wallet on the vault chain — they do not need to be bridged, since the wallet holds them on the depositor's behalf and can use them for a later redemption.

Assets, on the other hand — after a redemption or a cancellation — are sent back to the depositor on the source chain via CCIP. There are two ways this happens:

  • Batched by a keeper: an admin-authorized keeper triggers the return for many depositor wallets at once (typically right after executing a batch of queued requests), paying the CCIP fees.

  • Triggered by the depositor: the depositor sends a follow-up CCIP message instructing their wallet to return specified tokens. The CCIP fee is deducted from the returned token amount (or paid from a fee token bridged along with the message).

The same return leg can carry any token held by the depositor wallet — including shares, though bridging shares to the source chain is not part of the standard flow.

Redeem Flow

A cross-chain redemption reuses the same machinery, but with the token movement reversed: nothing is bridged in — the shares are already in the depositor wallet on the vault chain — and the redeemed assets are bridged out over the return leg:

  1. The depositor sends a CCIP message from the source chain carrying only instructions (no tokens).

  2. The wallets manager executes the instructions through the depositor wallet, which submits a redeem request to the vault's redeem handler.

  3. An admin executes the queued request; the redeemed assets land in the depositor wallet.

  4. The assets are sent back to the depositor on the source chain — batched by a keeper or triggered by the depositor, as described above.

Cancellation

While a queued deposit or redeem request is still pending, the depositor can cancel it with a follow-up cross-chain message. The refunded tokens land back in their depositor wallet and can be sent back to the source chain within the same message.

Failure Safety

  • Failed instructions: the token transfer and the instructions are decoupled. If the instructed action fails on arrival (e.g. a misconfigured deposit), the bridged tokens still land safely in the depositor wallet — nothing reverts back to the bridge. The depositor simply sends a follow-up message to retry the action or pull the tokens back.

  • Isolation: each depositor's funds only ever touch their own depositor wallet, so a failure or pending state for one depositor never affects another.

Last updated

Was this helpful?