Confirms and submits a signed liquidity deposit transaction to the Solana blockchain. This endpoint validates the transaction structure comprehensively, verifies the transaction hasn’t been tampered with, and broadcasts it to the network. The transaction transfers tokens from the manager wallet and adds liquidity to a Meteora DAMM v2 pool.
Enhanced security: This endpoint validates that the transaction hasn’t been modified after creation, preventing tampering attacks.
The manager wallet’s signature is invalid or doesn’t match.
400 - Transaction Tampered
Copy
{ "error": "Transaction verification failed: transaction has been modified", "details": "Transaction structure does not match the original unsigned transaction"}
The transaction structure was modified after it was built. The SHA-256 hash doesn’t match.
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 manager or LP owner", "details": "Instruction 5 authority mismatch"}
Token transfers must be signed by either the manager wallet or LP owner.
400 - Unauthorized Manager Transfer
Copy
{ "error": "Invalid transaction: transfer from manager must go to LP owner", "details": "Instruction 6 invalid destination"}
Manager wallet transfers can only go to the LP owner’s token accounts.
400 - Unauthorized LP Owner Transfer
Copy
{ "error": "Invalid transaction: LP owner transfers must go to pool vaults only", "details": "Instruction 7 unauthorized destination for LP owner transfer"}
CRITICAL SECURITY: LP owner transfers can only go to pool vaults, preventing fund drainage attacks.
400 - Amount Exceeds Expected
Copy
{ "error": "Invalid transaction: Token A transfer amount exceeds expected", "details": "Instruction 8 amount too large"}
Transfer amounts cannot exceed the specified deposit amounts.
400 - Invalid Manager SOL Transfer
Copy
{ "error": "Invalid transaction: manager SOL transfer must be to LP owner", "details": "Instruction 9 to mismatch"}
Native SOL transfers from manager must go to LP owner.
400 - Unauthorized LP Owner SOL Transfer
Copy
{ "error": "Invalid transaction: LP owner SOL transfers must be to WSOL account only", "details": "Instruction 10 unauthorized destination for LP owner SOL transfer"}
SECURITY: LP owner SOL transfers are only allowed to whitelisted destinations (LP owner’s WSOL account for wrapping SOL, or self-transfers for account creation). This prevents fund drainage attacks while allowing legitimate SOL wrapping operations.
500 - Configuration Error
Copy
{ "error": "Server configuration incomplete"}
Required environment variables are not configured.
This endpoint implements the most comprehensive transaction validation to prevent attacks:
1. Request Queueing
Only one liquidity operation can be processed per pool at a time. Concurrent requests are automatically queued and processed sequentially.
2. Tampering Detection
Cryptographic validation detects any modification to the transaction structure before submission. This prevents malicious changes to instructions.
3. Blockhash Validation
Prevents replay attacks by verifying the blockhash is recent (within last 150 slots / ~60 seconds).
4. Manager Wallet Verification
Only the configured manager wallet can submit deposit transactions. Both fee payer and signature are verified cryptographically.
5. Allowed Programs
Only permits instructions from:
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)
6. 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 deposits
Validates transfer authority (manager wallet or LP owner)
Transfer amounts cannot exceed specified deposit amounts
7. Destination Validation - Manager Transfers
Manager wallet transfers can ONLY go to:
LP owner’s Token A account
LP owner’s Token B account (or LP owner address for native SOL)
Any other destination is rejected.
8. Destination Validation - LP Owner Transfers
CRITICAL SECURITY: LP owner transfers can ONLY go to:
Pool Token A vault (for adding liquidity)
Pool Token B vault (for adding liquidity)
LP owner’s own token accounts
This prevents malicious clients from draining LP owner funds to arbitrary addresses.
9. System Transfer Validation - Manager
For native SOL transfers from manager wallet:
Only SystemProgram.transfer (instruction type 2) allowed
Must be from manager wallet to LP owner
Amount cannot exceed Token B deposit amount
10. System Transfer Validation - LP Owner
SECURITY: LP owner SOL transfers are whitelisted to specific destinations only:
LP owner’s WSOL associated token account (required for wrapping SOL)
LP owner’s own address (for self-transfers needed for account creation)
This prevents fund drainage while allowing legitimate SOL wrapping operations required for native SOL deposits. Any transfers to other addresses are rejected.
11. ATA Instruction Validation
Only CreateAssociatedTokenAccountIdempotent (opcode 1) is allowed for ATA program.
12. Amount Validation
All transfer amounts are compared against stored expected deposit amounts to prevent over-deposit or fund drainage.
Enhanced security for deposits: Deposit transactions undergo the most rigorous validation to prevent fund drainage attacks. The combination of transaction hash validation, strict destination checks, and amount validation ensures that only legitimate deposits can be processed.