Skip to content

Deposit and Withdraw with the CLI

jv deposit and jv withdraw generate a web address. You open it in your browser and confirm with a wallet signature while the command waits for the result. Assets move between Base and Jasper Vault through a cross-chain bridge.

Do not set any wallet private key in the terminal environment where you run jv.

Complete authorization before you start. The first time, we recommend running through the full flow with a small amount. You can also deposit and withdraw on the web app; see Deposit and Withdraw.

jv deposit --token usdc --amount 100
  1. The command first prints one line of JSON: url is the deposit page; recipient is the receiving address, which is your margin account (the same as marginAccount in jv wallet info); and expiresAt is when the page expires.
  2. Open url in your browser, connect the wallet you used for authorization, and confirm the transactions on Base as the page instructs, usually a token approval (approve) plus a cross-chain transfer. Your wallet needs ETH on Base to pay gas.
  3. After the transaction is confirmed on Base, the CLI waits up to another 60 seconds to check whether the funds have arrived, then prints the result:
{"success":true,"message":"Deposit transaction confirmed on Base","transactionHash":"0x…","recipient":"0x…","token":"USDC","amount":"100","arrived":true,"arrivalTimeMs":12345}

"arrived": true means the funds have arrived. "arrived": false means the assets are still in transit across chains; check your balance on the web app in a few minutes.

Flag Description
--token Set to usdc; required. Deposited USDC can be used as margin for perpetuals
--amount Amount in USDC, for example 100 for 100 USDC; required
--timeout Maximum time to wait for you to finish on the web page, in seconds; default 900
--no-wait Return as soon as the transaction is confirmed on Base, without waiting for the funds to arrive
jv withdraw --token usdc --amount 100
  • Set BASE_HTTP_RPC_URL before running it; see Install the jv CLI.
  • Funds are withdrawn from your margin account, shown as vault in the output.
  • Open url in your browser, sign the withdrawal with your wallet, then follow the page to complete the cross-chain transfer and the claim on Base.
  • Only your wallet itself can sign withdrawals; the delegation key cannot sign on its behalf.
  • By default, the command waits up to 900 seconds and, when done, prints {"success":true,"message":"Withdrawal completed","transactionHash":"0x…",…}.
Flag Description
--token Set to usdc; required
--amount Amount in USDC; required
--timeout Maximum time to wait for you to finish on the web page, in seconds; default 900

If the page expires or the flow fails, the command prints "success": false and exits with code 3. After confirming that your wallet has no transactions already sent, run the command again.