vault:request-deposit
Request a deposit into an ERC-7540 asynchronous vault, approving the vault automatically when needed. The assets are taken immediately; claim the shares with vault:claim-deposit once the request is fulfilled.
Syntax
Section titled “Syntax”vault:request-deposit <assets> <into> <vault>Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
assets | number | Amount of the underlying asset to deposit, in base units (wei) |
into | command | Keyword into |
vault | address | ERC-7540 vault address |
Options
Section titled “Options”| Name | Type | Description |
|---|---|---|
--controller | address | Controller of the request, entitled to claim it (defaults to the connected account) |
--no-approve | bool | Skip the automatic allowance check and approve action |
Examples
Section titled “Examples”# Request a deposit of 1000 USDC into the Centrifuge JTRSY vault on Ethereum (auto-approves)load vault
switch mainnetvault:request-deposit 1000e6 into 0xFE6920eB6C421f1179cA8c8d4170530CDBdfd77A
# Request a deposit for another controller, who will claim the sharesload vault
switch mainnetvault:request-deposit 1000e6 into 0xFE6920eB6C421f1179cA8c8d4170530CDBdfd77A --controller 0x4F2083f5fBede34C2714aFfb3105539775f7FE64The asynchronous flow
Section titled “The asynchronous flow”ERC-7540 vaults (Centrifuge and other RWA vaults) settle deposits in two steps: the request escrows your assets immediately, an off-chain actor fulfills it later, and only then can the shares be claimed. preview* functions revert on asynchronous vaults, so there is no way to quote the share amount upfront.
Wait for fulfillment and claim in one long-running script:
load vaultload std
switch mainnetvault:request-deposit 1000e6 into 0xFE6920eB6C421f1179cA8c8d4170530CDBdfd77Aloop until @bool(@vault:claimableDeposit(0xFE6920eB6C421f1179cA8c8d4170530CDBdfd77A) > 0) ( wait 60s)vault:claim-deposit max from 0xFE6920eB6C421f1179cA8c8d4170530CDBdfd77AThe --controller becomes the account entitled to track and claim the request. Most vaults key requests purely by controller (request id 0); synchronous ERC-4626 vaults reject this command — use vault:deposit there instead.