Overview
Confirms and submits a signed liquidity withdrawal transaction to the Solana blockchain. This endpoint validates the transaction structure comprehensively and broadcasts it to the network. The transaction removes liquidity from a Meteora DAMM v2 pool and transfers all withdrawn tokens to the manager wallet.Request Parameters
/damm/withdraw/build)/damm/withdraw/build endpointResponse
tokenA(string): Token A amount withdrawntokenB(string): Token B amount withdrawnliquidityDelta(string): Liquidity amount removed
Success Response
Error Responses
400 - Missing Parameters
400 - Missing Parameters
400 - Request Not Found
400 - Request Not Found
400 - Request Expired
400 - Request Expired
400 - Transaction Deserialization Failed
400 - Transaction Deserialization Failed
400 - Missing Blockhash
400 - Missing Blockhash
400 - Expired Blockhash
400 - Expired Blockhash
400 - Fee Payer Mismatch
400 - Fee Payer Mismatch
400 - Manager Not Signed
400 - Manager Not Signed
400 - Invalid Manager Signature
400 - Invalid Manager Signature
400 - Amount Exceeds Expected
400 - Amount Exceeds Expected
400 - Invalid System Transfer
400 - Invalid System Transfer
500 - Configuration Error
500 - Configuration Error
500 - Transaction Submission Failed
500 - Transaction Submission Failed
Process Flow
This endpoint performs extensive validation before submitting the transaction:Validate Parameters
Retrieve Request Data
Queue Request
Check Request Expiry
Deserialize Transaction
Validate Blockhash
Verify Manager Wallet
Verify Manager Signature
Validate Transaction Structure
Complete Transaction
Submit Transaction
Wait for Confirmation
Cleanup
Security Validations
This endpoint implements comprehensive transaction validation to prevent attacks:1. Request Queueing
1. Request Queueing
2. Blockhash Validation
2. Blockhash Validation
3. Manager Wallet Verification
3. Manager Wallet Verification
4. Allowed Programs
4. Allowed Programs
- Token Program (TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA)
- Associated Token Program (ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL)
- Compute Budget Program
- Lighthouse Program (for optimization)
- Meteora CP-AMM Program (CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C)
- Meteora DAMM v2 Program (cpamdpZCGKy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG)
- System Program (for native SOL transfers)
5. Token Instruction Validation
5. Token Instruction Validation
- Only Transfer (opcode 3), InitializeAccount (opcode 9), TransferChecked (opcode 12), and SyncNative (opcode 17) are allowed
- SyncNative is required for wrapping SOL to WSOL in native SOL withdrawals
- All transfers must be signed by the LP owner
- Transfer amounts cannot exceed calculated withdrawal amounts
6. Destination Validation
6. Destination Validation
- Manager wallet token accounts (withdrawal recipients)
- LP owner token accounts (intermediate recipients before transfer) Any other destination is rejected.
7. System Transfer Validation
7. System Transfer Validation
- Only SystemProgram.transfer (instruction type 2) allowed
- Must be from LP owner to manager wallet
- Amount cannot exceed Token B withdrawal amount
8. ATA Instruction Validation
8. ATA Instruction Validation
9. Amount Validation
9. Amount Validation
Rate Limiting
This endpoint is subject to rate limiting:- 10 requests per 5-minute window per IP
- Returns HTTP 429 when limit exceeded
Transaction Confirmation
The API attempts to wait for transaction confirmation but continues even if confirmation times out:- Confirmation Commitment: confirmed
- Timeout Handling: Logs warning but returns success
- User Responsibility: Check transaction status on Solana explorer
https://solscan.io/tx/{signature}
Concurrent Request Handling
One-Time Use
After successful submission:- The requestId cannot be reused
- You must create a new request for additional operations
Best Practices
Check Blockhash Age
/damm/withdraw/build. Blockhashes expire after ~60 seconds.Handle Expiry
Monitor Transaction
Handle Queueing
Manage Withdrawals Carefully
Related Endpoints
/damm/withdraw/build- Create the unsigned withdrawal transaction/damm/deposit/build- Build deposit transaction
