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. The deposit also names your instance as the depositor’s distributor, under the rules in Distributor attribution. When a market the vault funded wrote off distributor accrual that the vault has not recorded yet, one recordMarketLoss step per such market comes first. Recording the loss before the deposit keeps the interest this deposit earns from being charged with a loss from before it arrived. Any wallet may sign those steps. 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. It adopts the provider register of the first market it funds or consents to draw for, and keeps it for good, also after it stops funding that market. Every deposit and share transfer is then examined against the adopted register as well. Until it has adopted one, the vault refuses every deposit and share transfer on-chain (DepositorGateRequired), and the API refuses such a deposit first with DEPOSITOR_GATE_REQUIRED. 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, 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 with ELIGIBILITY_REMOVAL_PENDING when the wallet’s admission to one of those registers waits for removal. It also checks that the wallet holds amount of the asset, and reads whether the wallet is already bound to a distributor. Send it. Only then does the deposit step carry a gasLimit, as Gas limit describes. Without it, the API skips these checks, and the contract enforces the registers either way. Any other non-empty value is refused with INVALID_HOLDER_ADDRESS.

When the wallet is not verified

DEPOSITOR_NOT_VERIFIED carries details alongside the message. register is the register that refused, wallet is the holder, and gate is vault for the vault’s own register or the one it adopted, or provider for a market’s provider register, which marketAddress names. When a hosted verification service on Trusset can admit the wallet into that register, details.remedy links it and the message ends with one sentence naming the service and its page. Offer the link to the depositor. Trusset links a service only where that service writes to the register that refused: A third-party register, a whitelist, a profile bound to an external register, or a service that verifies another investor type gets no remedy. No Trusset service can admit the wallet there, so the depositor would pay for a verification that does not open the vault. A verified wallet can deposit once the service’s issuer has signed its registration, which waits in List Pending Verifications until then.

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

Four refusals are about the vault rather than the depositor. Each stops shares being issued against a number nobody can stand behind, and none 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. A deposit is refused with VAULT_MARKET_IMPAIRED when a market the vault funds carries an open loan whose health factor is below 1, or seized debt still waiting for its sale. The share price still counts that debt at full value, so it does not yet show a loss a liquidation or a sale may realize. details.markets lists those markets. It clears once those loans are settled. A deposit is refused with VAULT_RECOVERY_PENDING when the vault wrote off a market that answers again and still holds its pool shares. Value can come back from that market, and it belongs to the holders who bore the write-off. details.recoverableEvictions names the markets. It clears once the operator has pulled that value back with a deallocation. Get Vault shows both positions in onChain.impairment. These two are the API’s own refusals. The contract takes such a deposit, and a check that found nothing refuses nothing, also when it could not read every market.
The book, wipe-out and pause checks read the vault’s live state. When that read fails, the API still returns calldata, and the vault contract refuses all three cases on-chain.

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 20 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. 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.

Gas limit

The gas a deposit uses depends on whether the markets the vault has consented to draw for have already accrued interest in the current block. A wallet that estimates in the same block as another deposit sees that accrual done and estimates too little. Its deposit lands in a later block, accrues there, and can run out of gas. With holderAddress, the API waits for a block past those markets’ last accrual and simulates the steps from that wallet with eth_simulateV1. The deposit step, and any recordMarketLoss step, then carries gasLimit: the gas it used plus 50 percent. The API simulates again under that limit and raises it where a step falls short. The approval carries no gasLimit. Without holderAddress, no step carries gasLimit. Neither does a step the node could not simulate or that failed in the simulation, and the wallet falls back to its own estimate. Send holderAddress, and sign each step with its transaction as handed, gasLimit included.

Response Fields

object

Error Codes