Skip to main content
POST
Builds the two transactions a deposit needs: an ERC-20 approval for the vault to pull its asset, a settlement token (stablecoin), then the deposit itself. The depositor’s wallet signs both, in order, and receives vault shares at the current share price. On a vault that supports distributor attribution, the deposit also names your instance as the depositor’s distributor. The vault admits a depositor only when every register it reads verifies the wallet. That is the vault’s own identity register, when the vault names one, and the provider register of every market the vault funds or has consented to draw for. The vault operator’s register provider and each market’s register provider admit depositors. A vault without a register of its own takes its depositor gate from its markets. On the current vault implementation it adopts the provider register of the first market it funds or consents to draw for, and keeps it for good, also once it no longer funds that market. Every deposit and share transfer is then examined against the adopted register as well. Until it has adopted one, a vault that funds no market with a provider register refuses every deposit and share transfer on-chain (DepositorGateRequired), and the API refuses such a deposit first with DEPOSITOR_GATE_REQUIRED. The API also prepares no deposit into a vault without a register of its own on an earlier implementation, which would admit any wallet. DEPOSITOR_NOT_VERIFIED names the register that refused the wallet: the vault’s own, the one it adopted, or a market’s provider register together with the market. When that register is the eligibility register of one of your verification profiles, the refusal names the profile as well. Onboard the wallet under that profile and admit it with Request Admission before the deposit. Get Wallet Eligibility shows where a wallet stands.

Path Parameters

string
required
Vault ID.

Body Parameters

string
required
Amount to deposit as a decimal string, for example "1000". Digits with an optional fraction, greater than zero. Denominated in the vault’s asset and parsed at assetDecimals, so a finer fraction answers VALIDATION_ERROR.
string
Wallet that will sign. When it is a 0x address, the API checks it against the vault’s register and, on a vault with distributor attribution, against the register the vault adopted when it has none of its own and each market’s provider register. It refuses with DEPOSITOR_NOT_VERIFIED when the deposit would revert, and reads whether the wallet is already bound to a distributor. Omit it to skip both; the contract enforces the registers either way. Any other value is ignored.

When a deposit is refused on the vault’s own state

Two refusals are about the vault rather than the depositor. Both stop shares being issued against a number nobody can stand behind, and neither affects redemptions, which stay open throughout. A deposit is refused with VAULT_BOOK_INCOMPLETE when a market the vault funds is not answering. The vault cannot total its own book, so it would issue shares at a price computed from a partial book. The message names the market. It clears when that market answers again, or when the operator writes it off. A deposit is refused with VAULT_WIPED_OUT when shares are in issue against assets totalling zero. A deposit into that vault would be absorbed by the existing holders rather than buying a position. A vault whose value is gone cannot be recapitalized, and the operator has to run a new one.
These checks, and the pause check, read the vault’s live state. When that read fails, the API still returns calldata. The current vault implementation refuses all three cases on-chain. The earlier one, supportsNotice: false on Get Vault, does not refuse a wiped-out vault, so do not sign there while onChain.readFailed is true.

Distributor attribution

The instance whose API key builds a deposit is that depositor’s distributor, and a market’s Deposit to Vault route attributes the same way. The deposit step names your instance’s distributor wallet in deposit(amount, distributor). That is its primary verified wallet, or its earliest verified wallet when none is primary. The vault binds the signing wallet to the first distributor a deposit names and never rebinds it. Every share the holder has or later receives is then attributed to that distributor. A share transfer moves the attribution to the recipient’s distributor, or to none. Each market sets aside a distributor share: 5 percent of repaid interest after Trusset’s 15 percent infrastructure fee, and 5 percent of each fixed transaction fee. It credits that share to its liquidity providers per share, and the vault’s part is its slice. The vault passes the part earned by attributed shares to their distributors and the rest to the vault operator. Get Earnings shows what your instance has earned. On the current vault implementation a deposit may bind a new holder only to the vault owner or to a distributor the vault operator approved. When your instance’s wallet is not approved, the API names no distributor unless the wallet is already bound, so the deposit still goes through. The operator approves distributors with Set Distributor Approval. If the approval is withdrawn after the calldata is built, a deposit that would bind a new holder to your wallet reverts and nothing moves. The attribution block states what this deposit does: The binding follows the wallet that signs the deposit, not holderAddress. Name the signing wallet, or the checks and the binding reading describe the wrong wallet.

Response Fields

object

Error Codes