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 before calling the deposit endpoint.
Request URL
GET https://ddp.definitive.fi/v2/organization/portfolios/{portfolioId}/address/{chain}
Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
portfolioId | string | Yes | UUID of the portfolio |
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/organization/portfolios/00000000-0000-0000-0000-000000000001/address/ethereum",
method: "GET",
queryParams: {
walletAddress: "0x742d35Cc6634C0532925a3b8D400eE6a0b8CBd6",
},
organizationId: "00000000-0000-0000-0000-000000000000",
apiKey: process.env.API_KEY,
apiSecret: process.env.API_SECRET,
});
Get Solana Deposit Address
const solanaAddress = await AuthHelpers.signAndSend({
path: "/v2/organization/portfolios/00000000-0000-0000-0000-000000000001/address/solana",
method: "GET",
queryParams: {
walletAddress: "GszaaaaaaaaaaaaaaaaaaaaaaaaVcx",
},
organizationId: "00000000-0000-0000-0000-000000000000",
apiKey: process.env.API_KEY,
apiSecret: process.env.API_SECRET,
});
Get Polygon Deposit Address
const polygonAddress = await AuthHelpers.signAndSend({
path: "/v2/organization/portfolios/00000000-0000-0000-0000-000000000001/address/polygon",
method: "GET",
queryParams: {
walletAddress: "0x742d35Cc6634C0532925a3b8D400eE6a0b8CBd6",
},
organizationId: "00000000-0000-0000-0000-000000000000",
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 portfolio and 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
Integration with Deposit Flow
This endpoint is typically used in conjunction with the Deposit endpoint:
- Get Deposit Address: Call this endpoint to retrieve the vault address
- Send Funds: Users send their assets to the returned address
- Initiate Deposit: Call the deposit endpoint to process the incoming funds
Example Integration
// Step 1: Get the deposit address
const addressResponse = await AuthHelpers.signAndSend({
path: "/v2/organization/portfolios/00000000-0000-0000-0000-000000000001/address/ethereum",
method: "GET",
queryParams: {
walletAddress: "0x742d35Cc6634C0532925a3b8D400eE6a0b8CBd6",
},
organizationId: "00000000-0000-0000-0000-000000000000",
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: Process the deposit
const depositResponse = await AuthHelpers.signAndSend({
path: "/v2/organization/portfolios/00000000-0000-0000-0000-000000000001/deposit",
method: "POST",
body: {
chain: "ethereum",
asset: "0x0000000000000000000000000000000000000000", // Native ETH
amount: "1.0",
walletAddress: "0x742d35Cc6634C0532925a3b8D400eE6a0b8CBd6",
address: vaultAddress, // Use the address from step 1
},
organizationId: "00000000-0000-0000-0000-000000000000",
apiKey: process.env.API_KEY,
apiSecret: process.env.API_SECRET,
});
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
- ⚠️ portfolioId is required: Always use the correct portfolio UUID in the path
- ⚠️ 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)