Skip to Content

Funding

Before you can trade, you need to deposit funds into your 01 Exchange account.

Supported Assets

On Devnet, we use mock tokens. You will need SOL for transaction fees and USDC (or other supported assets) for trading collateral.

Depositing Funds

Use the depositSpl method to move funds from your Solana wallet into your 01 Exchange account.

// Example: Deposit 100 USDC // Token ID 0 represents USDC on 01 Exchange const USDC_TOKEN_ID = 0; const AMOUNT_TO_DEPOSIT = 100; try { console.log(`Depositing ${AMOUNT_TO_DEPOSIT} USDC...`); const txId = await user.depositSpl(AMOUNT_TO_DEPOSIT, USDC_TOKEN_ID); console.log("Deposit successful!"); console.log("Transaction ID:", txId); // Refresh user state to see updated balances await user.fetchInfo(); console.log("New Balance:", user.balances[USDC_TOKEN_ID]); } catch (error) { console.error("Deposit failed:", error); }

Tip: Ensure your Solana wallet has enough SOL to pay for the transaction fees.

Last updated on