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.
Concurrent request handling: Only one withdrawal operation can be processed at a time for each pool. Additional requests will wait in queue until the current operation completes.
Token program instructions must be Transfer (3), InitializeAccount (9), TransferChecked (12), or SyncNative (17) only. SyncNative is required for wrapping SOL to WSOL.
400 - Invalid Transfer Authority
Copy
{ "error": "Invalid transaction: transfer authority must be LP owner", "details": "Instruction 5 authority mismatch"}
Token transfers must be signed by the LP owner.
400 - Unauthorized Destination
Copy
{ "error": "Invalid transaction: transfer destination not authorized", "details": "Instruction 6 invalid destination"}
Transfers can only go to the manager wallet’s token accounts or LP owner’s token accounts.
400 - Amount Exceeds Expected
Copy
{ "error": "Invalid transaction: Token A transfer amount exceeds expected", "details": "Instruction 7 amount too large"}
Transfer amounts cannot exceed the calculated withdrawal amounts.
400 - Invalid System Transfer
Copy
{ "error": "Invalid transaction: system transfer destination must be manager wallet", "details": "Instruction 8 to mismatch"}
Native SOL transfers must go to the manager wallet.
500 - Configuration Error
Copy
{ "error": "Server configuration incomplete"}
Required environment variables are not configured.
LP owner token accounts (intermediate recipients before transfer)
Any other destination is rejected.
7. System Transfer Validation
For native SOL transfers (when Token B is wSOL):
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
Only CreateAssociatedTokenAccountIdempotent (opcode 1) is allowed for ATA program.
9. Amount Validation
All transfer amounts are compared against stored expected withdrawal amounts to prevent over-withdrawal.
Manager authorization required: Unlike fee claims, withdrawals require manager wallet authorization. Only the configured manager wallet can execute withdrawals, preventing unauthorized access to pool liquidity.