Deposit
Deposit USDC into the ksUSD vault and receive ksUSD share tokens at the current share price.
New here? Read What is ksUSD? first.
The instruction
deposit(usdc_amount: u64)In one atomic transaction:
Transfers USDC from the user into the vault's USDC ATA
Mints
ksUSDto the user at the current share priceUpdates vault NAV accounting
vault
mut
Vault PDA (seeds: [b"vault"])
vault_usdc_account
mut
Vault's USDC ATA — receives the deposit
ksusd_mint
mut
ksUSD share mint — vault PDA is authority
user_usdc_account
mut
Depositor's USDC source ATA
user_ksusd_account
mut
Depositor's ksUSD destination ATA
user
signer
Depositor
token_program
—
SPL token program
Share-price math
First deposit into an empty vault mints
usdc_amountshares 1:1 at $1.00 (initialshare_price_1e9 = 1_000_000_000)Every subsequent deposit mints fewer shares as the share price drifts upward with accrued carry
Guardrails
Vault must not be paused. Admin can pause via
set_pausefor emergency response.Deposit cap. New deposits revert if
cached_nav_usdc + usdc_amount > deposit_cap_usdc(default: $1M cap on launch).No zero deposits.
usdc_amount > 0required.
TypeScript example
Events
DepositEvent is emitted on success:
Related
Withdraw — instant vs. queued paths
Last updated