Get Deposit Address
Retrieves the deposit address for a portfolio's vault on a specific blockchain. This endpoint is useful for getting the vault address where users should send their deposits.
Request URL
GET https://ddp.definitive.fi/v2/portfolio/address/{chain}
Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
chain | string | Yes | Blockchain network ("solana" , "ethereum" , "polygon" , "arbitrum" , "base" ) |
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
walletAddress | string | Yes | User wallet address for the chain |
Examples
Get Ethereum Deposit Address
const ethAddress = await AuthHelpers.signAndSend({
path: "/v2/portfolio/address/ethereum",
method: "GET",
queryParams: {
walletAddress: "0x742d35Cc6634C0532925a3b8D400eE6a0b8CBd6",
},
apiKey: process.env.API_KEY,
apiSecret: process.env.API_SECRET,
});
Get Solana Deposit Address
const solanaAddress = await AuthHelpers.signAndSend({
path: "/v2/portfolio/address/solana",
method: "GET",
queryParams: {
walletAddress: "GszaaaaaaaaaaaaaaaaaaaaaaaaVcx",
},
apiKey: process.env.API_KEY,
apiSecret: process.env.API_SECRET,
});
Get Polygon Deposit Address
const polygonAddress = await AuthHelpers.signAndSend({
path: "/v2/portfolio/address/polygon",
method: "GET",
queryParams: {
walletAddress: "0x742d35Cc6634C0532925a3b8D400eE6a0b8CBd6",
},
apiKey: process.env.API_KEY,
apiSecret: process.env.API_SECRET,
});
Response Format
{
vaultId: "00000000-0000-0000-0000-000000000002",
address: "0x1234567890abcdef1234567890abcdef12345678"
}
Response Fields
Field | Type | Description |
---|---|---|
vaultId | string | UUID of the vault associated with the address |
address | string | The deposit address where funds should be sent |
Usage Notes
- Vault Creation: If a vault doesn't exist for the specified chain, it will be created automatically
- Address Format: The returned address is the actual blockchain address where deposits should be sent
- Chain Compatibility: The
walletAddress
parameter must be a valid address format for the specified chain - Authentication: Requests must be signed and include the correct headers. See Request Authorization for details
- Portfolio Context: This endpoint operates on the authenticated user's portfolio (no portfolioId needed in the path)
Integration with Deposit Flow
This endpoint is typically used in conjunction with deposit functionality:
- Get Deposit Address: Call this endpoint to retrieve the vault address
- Send Funds: Users send their assets to the returned address
- Process Deposit: Use the address to process incoming funds
Example Integration
// Step 1: Get the deposit address
const addressResponse = await AuthHelpers.signAndSend({
path: "/v2/portfolio/address/ethereum",
method: "GET",
queryParams: {
walletAddress: "0x742d35Cc6634C0532925a3b8D400eE6a0b8CBd6",
},
apiKey: process.env.API_KEY,
apiSecret: process.env.API_SECRET,
});
const vaultAddress = addressResponse.address;
// Step 2: User sends funds to vaultAddress
// (This happens outside the API - user sends ETH/tokens to the address)
// Step 3: The funds are automatically detected and credited to the portfolio
Error Handling
Common error responses:
Error Code | Description |
---|---|
INVALID_CHAIN | Unsupported blockchain network |
INVALID_WALLET_ADDRESS | Invalid wallet address format for the chain |
VAULT_CREATION_FAILED | Failed to create vault for the specified chain |
Common Pitfalls & Tips
- ⚠️ walletAddress format: Ensure the wallet address matches the expected format for the specified chain
- Vaults are auto-created: If a vault doesn't exist, it will be created automatically
- Address reuse: The same address can be used for multiple deposits to the same vault
- Chain-specific addresses: Each chain has different address formats (EVM vs Solana)
- Portfolio authentication: This endpoint uses the authenticated user's portfolio context