Shader
Deposit

DocsGuides13 of 35 · 4 min read

Deposit

Add credits from your wallet in USDC, SOL, an xStock or SHDR, and see them land in your credit account.

A deposit turns an asset in your wallet into credits. You need a connected, signed-in wallet holding one of the payment assets. Deposits are signed by your wallet, so they happen in the app; an agent token cannot make one.

#Add credits

USDC

  1. Choose the asset

    Open Credits and, under Pay with, choose USDC. The list shows what your wallet holds of each supported asset.

  2. Enter the amount

    Type an amount, or press Max. You get shows the credits that will land. One USDC is one dollar of credits, one atom to one base unit. The quote expires after a short while, and the app asks for a new one when it does.

  3. Sign

    Press Sign to add and approve the transaction in your wallet. Once it confirms, the balance goes up, and the deposit shows under Recent deposits with a link to its receipt.

SOL

  1. Choose the asset

    Open Credits and, under Pay with, choose SOL. The list shows what your wallet holds of each supported asset.

  2. Enter the amount

    Type an amount, or press Max. You get shows the credits that will land. The quote is a Jupiter route from SOL to USDC. You get the route's minimum output in credits; any extra USDC the swap delivers stays in your wallet. 0.01 SOL stays in your wallet for fees. The quote expires after a short while, and the app asks for a new one when it does.

  3. Sign

    Press Sign to add and approve the transaction in your wallet. Once it confirms, the balance goes up, and the deposit shows under Recent deposits with a link to its receipt.

xStocks

  1. Choose the asset

    Open Credits and, under Pay with, choose NVDAx, TSLAx or AAPLx. The list shows what your wallet holds of each supported asset.

  2. Enter the amount

    Type an amount, or press Max. You get shows the credits that will land. NVDAx, TSLAx and AAPLx quote like SOL: a Jupiter route to USDC, credited at its minimum output. The quote expires after a short while, and the app asks for a new one when it does.

  3. Sign

    Press Sign to add and approve the transaction in your wallet. Once it confirms, the balance goes up, and the deposit shows under Recent deposits with a link to its receipt.

SHDR

  1. Choose the asset

    Open Credits and, under Pay with, choose SHDR. The list shows what your wallet holds of each supported asset.

  2. Enter the amount

    Type an amount, or press Max. You get shows the credits that will land. The quote is a USDC price for your SHDR, signed by Shader's price signer. The SHDR goes into escrow behind the credits, and those credits are spent first. SHDR deposits open once the mint exists. The quote expires after a short while, and the app asks for a new one when it does.

  3. Sign

    Press Sign to add and approve the transaction in your wallet. Once it confirms, the balance goes up, and the deposit shows under Recent deposits with a link to its receipt.

#What happened

  1. Quote

    The API priced the deposit: one to one for USDC, a Jupiter route to USDC for SOL and the xStocks, a price-signed USDC quote for SHDR.

  2. Build

    It built the transaction for your wallet to sign: deposit_usdc for USDC; a Jupiter swap to USDC followed by deposit_usdc, in one transaction, for SOL and the xStocks; deposit_shdr for SHDR.

  3. Sign and relay

    Your wallet signed it. For SHDR, the price signer co-signed after your wallet. The API relayed it and followed it to confirmation.

  4. On chain

    The program moved the asset to the treasury, or SHDR into escrow, and booked the credits in your CreditAccount, creating it on your first deposit. An expired SHDR quote is refused.

#The receipt

A deposit is listed in Receipts as kind deposit, from the UsdcDeposited or ShdrDeposited event, with the asset and amount as its units.

#Afterwards

The credits are spendable at once, on a rental or a generation, and by any agent key of your wallet.

#If it fails

What you seeWhyNext
QUOTE_EXPIREDThe quote ran out before you signedAsk for a new quote
WALLET_REJECTEDYou declined in the walletSign again when ready
SIMULATION_FAILEDThe signed transaction would fail, for example the swap no longer meets its minimumNothing was sent. Quote again
TRANSACTION_EXPIREDThe blockhash expired before the transaction was sentBuild it again from a new quote
ASSET_NOT_LIVESHDR has no mint yetPay with another asset
QUOTE_ASSET_UNSUPPORTEDThe asset is not a payment assetPick one from Pay with