Endpoints
Wallet Operations
Deposit or withdraw tokens directly on Arbitrum
POST
/
api
/
wallet
Overview
The Wallet Operations endpoint handles direct deposits and withdrawals of tokens on Arbitrum to your margin wallet. This endpoint is specifically for tokens already on the Arbitrum network - for cross-chain deposits, use the crosschaindeposit endpoint instead.
Request Body
Operation type. Must be either:
deposit
: Deposit tokens into margin walletwithdraw
: Withdraw tokens from margin wallet
Contract address of the token to deposit or withdraw. Currently supported tokens:
- USDC:
0xaf88d065e77c8cc2239327c5edb3a432268e5831
(6 decimals)
Amount to deposit or withdraw (in token units with decimals)
Response Fields
Encoded function call data for the transaction
Address of the vault contract
Example Usage
Deposit USDC
Withdraw USDC
Example Response
Implementation Notes
-
For deposits:
- Uses
depositSelf
function - Token approval may be required before deposit
- Amount precision handled based on token decimals (6 for USDC)
- Uses
-
For withdrawals:
- Uses
withdraw
function - Amount must not exceed available balance
- Amount precision handled based on token decimals (6 for USDC)
- Uses
Error Responses
The endpoint will return a 400 status code for:
- Missing type, tokenAddress, or amount
- Invalid operation type
- Invalid token address
- Invalid amount format
A 500 status code will be returned for:
- Transaction encoding errors
- Contract interaction errors
Body
application/json
Operation type
Available options:
deposit
, withdraw
Token contract address
Amount to deposit or withdraw