LP Operations on XRPL - Practical Guide
Learning Objectives
Execute LP deposits on XRPL AMM pools step-by-step
Set up proper trust lines for LP tokens
Monitor LP positions using available tools
Execute withdrawals both partial and complete
Track performance for accounting and tax purposes
The previous lessons covered why AMMs work, how impermanent loss occurs, and what makes XRPL's implementation unique. This lesson is different—it's a practical operations manual.
We'll walk through each step of the LP lifecycle: preparation, deposit, monitoring, and withdrawal. Whether you're planning to LP with $100 or $100,000, the process is the same.
WALLET SETUP CHECKLIST
□ XRPL-compatible wallet
├── Xaman (formerly XUMM)
├── Crossmark
├── GemWallet
└── Or: Direct API/CLI access
□ Funded with XRP
├── For transaction fees (~0.00001 XRP each)
├── For account reserves
├── Plus: XRP if depositing to XRP pair
□ If depositing issued currencies:
├── Trust line for the currency set
├── Balance of the currency
└── Example: RLUSD trust line, RLUSD balance
□ Understand account reserves:
├── Base reserve: 10 XRP (varies)
├── Each trust line: 2 XRP reserve
├── Plan for LP token trust line
└── Reserves locked while used
```
PRE-DEPOSIT DUE DILIGENCE
□ Identify target pool
├── Asset pair
├── Pool address
└── Current parameters
□ Check pool metrics:
├── TVL (Total Value Locked)
├── Trading volume (recent)
├── Fee rate
├── Number of LP token holders
└── Auction activity (if relevant)
□ Calculate potential returns:
├── Fee APY based on volume
├── IL scenarios for different price moves
├── Net expected return
└── Compare to alternatives
□ Verify assets:
├── Issuer addresses
├── Legitimacy of issued currencies
├── Trust established issuers only
└── Scam tokens exist—be careful
```
DETERMINING DEPOSIT AMOUNT
Questions to answer:
├── How much can I afford to lose to IL?
├── What % of my portfolio is this?
├── Am I comfortable with both assets?
└── What's my exit plan?
Position sizing guidelines:
├── First-time LP: Start small ($100-1000)
├── Learning phase: Test mechanics before scaling
├── Comfortable: Portion you'd hold anyway
├── Maximum: Never more than comfortable IL loss
Example thought process:
├── Total liquid assets: $50,000
├── Comfortable with 10% in DeFi: $5,000
├── First XRPL LP: Start with $500
├── If successful after 1 month: Increase to $2,000
└── Never exceed comfortable threshold
```
Before receiving LP tokens, you need a trust line to the AMM account.
TRUST LINE SETUP (IF NOT AUTO-CREATED)
Step 1: Identify AMM account
├── Look up pool in XRPL explorer
├── Find AMM account address
├── This is the LP token issuer
└── Example: rAMMaccount123...
Step 2: Identify LP token currency
├── Derived from pool asset pair
├── Unique currency code (hash-based)
├── Shown in pool details
└── Example: 03A19B2F...
Step 3: Set trust line (via wallet)
├── Transaction type: TrustSet
├── Limit amount: Large number (e.g., 1e15)
├── Currency: LP token code
├── Issuer: AMM account
└── Sign and submit
Most wallets handle this automatically
when you first deposit to a pool.
```
AMMDEPOSIT STEP-BY-STEP
Two-asset deposit (recommended):
Step 1: Calculate balanced amounts
├── Check current pool ratio
├── Example: Pool has 2:1 RLUSD:XRP ratio
├── To deposit 1000 XRP, need 2000 RLUSD
└── Ratio from: RLUSD balance / XRP balance
Step 2: Prepare transaction
├── Transaction type: AMMDeposit
├── Asset: First pool asset
├── Asset2: Second pool asset
├── Amount: Your deposit of first asset
├── Amount2: Your deposit of second asset
├── Flags: tfTwoAsset (for two-asset deposit)
└── Fee: Standard XRPL fee
Step 3: Sign transaction
├── Using your wallet
├── Review amounts carefully
├── Confirm both asset amounts
└── Sign when satisfied
Step 4: Submit to network
├── Broadcast signed transaction
├── Wait for validation (3-5 seconds)
├── Check result code
└── Success: tesSUCCESS
Step 5: Verify receipt
├── Check LP token balance
├── Should match expected amount
├── Your pool share = LP tokens / total LP supply
└── Record for tracking
```
SINGLE-ASSET DEPOSIT (WHEN NEEDED)
When to use:
├── Only have one asset available
├── Don't want to acquire second asset
├── Convenience over efficiency
└── Accepting additional slippage
How it works:
├── Deposit only one asset
├── Pool effectively swaps half
├── You receive LP tokens
├── Net position is 50/50 exposure
├── But: You paid swap slippage
Transaction:
├── AMMDeposit with one Amount
├── Flags: tfSingleAsset
├── Result: LP tokens as usual
└── Less efficient than two-asset
Example:
├── Deposit: 2000 RLUSD (only)
├── Pool: 100K XRP / 200K RLUSD
├── Pool swaps ~1000 RLUSD to XRP internally
├── You receive LP tokens for ~1000 RLUSD + ~500 XRP value
├── But swap had slippage
└── Net: Less LP tokens than two-asset deposit
```
POST-DEPOSIT VERIFICATION
Check LP token balance:
├── Use wallet to view balances
├── Look for LP token currency
├── Should show received amount
└── May take a moment to appear
Verify pool share:
├── Your LP tokens / Total LP supply = Share %
├── Example: 5000 / 500000 = 1%
├── You own 1% of all pool assets
└── Cross-check with deposited amounts
Record keeping (essential):
├── Transaction hash
├── Date and time
├── Assets deposited (both amounts)
├── Asset prices at deposit
├── Total deposit value
├── LP tokens received
├── Pool share percentage
├── Pool TVL at deposit
└── Screenshot pool state
```
LP POSITION MONITORING CHECKLIST
Daily/Weekly checks:
├── LP token balance (should be unchanged unless you transacted)
├── Pool balances (changes show trading activity)
├── Pool share (constant unless pool grows/shrinks)
├── Estimated position value
└── Compare to deposit value
Periodic deeper review:
├── Calculate current IL
├── Estimate fee income earned
├── Assess net return
├── Compare to holding strategy
└── Decide whether to continue
Alert triggers:
├── Significant price movement (>20%)
├── Unusual volume spikes
├── Pool parameter changes (fees)
├── New competitor pools
└── Market news affecting assets
```
POSITION VALUATION STEPS
Step 1: Get current pool state
├── Query pool or AMM object
├── Get Token A balance: x
├── Get Token B balance: y
├── Get total LP supply: L
├── Your LP tokens: l
Step 2: Calculate your holdings
├── Your share: s = l / L
├── Your Token A: x × s
├── Your Token B: y × s
└── These are your current holdings
Step 3: Get current prices
├── Token A price in reference currency
├── Token B price (usually $1 if stablecoin)
└── Use external source for accuracy
Step 4: Calculate value
├── Value = (Your A × Price A) + (Your B × Price B)
└── This is current position value
Example:
├── Pool: 100,000 XRP + 250,000 RLUSD
├── Total LP supply: 158,114
├── Your LP tokens: 15,811 (10% share)
├── Your holdings: 10,000 XRP + 25,000 RLUSD
├── XRP price: $2.80
├── Value: (10,000 × $2.80) + $25,000 = $53,000
```
AVAILABLE MONITORING TOOLS
XRPL Explorers:
├── xrpscan.com
├── bithomp.com
├── xrplorer.com
├── Can query account balances
├── Can view AMM pool state
└── Manual but reliable
Wallet interfaces:
├── Some show LP position values
├── May calculate share automatically
├── Quality varies by wallet
└── Check accuracy manually
API queries:
├── Direct XRPL API (amm_info, account_lines)
├── For programmatic monitoring
├── Can build custom dashboards
├── Requires technical skill
└── Most accurate
Spreadsheet tracking:
├── Manual entry of positions
├── Calculate value, IL, returns
├── Full control over methodology
├── Recommended for serious LPs
└── Templates from previous lessons
```
EXIT PLANNING CONSIDERATIONS
When to withdraw:
├── Reached profit target
├── IL exceeds acceptable level
├── Need liquidity for other purposes
├── Pool economics deteriorating
├── Better opportunity elsewhere
└── Or: Time-based exit (planned from start)
Pre-withdrawal checklist:
├── Current position value
├── Total return since entry
├── IL calculation
├── Fee income estimate
├── Tax implications
└── Where proceeds will go
Withdrawal types:
├── Full withdrawal: Exit entire position
├── Partial withdrawal: Reduce exposure
├── Single-asset: Receive one token only
└── Most common: Full two-asset withdrawal
```
AMMWITHDRAW STEP-BY-STEP
Full two-asset withdrawal:
Step 1: Confirm LP token balance
├── Know exactly how many LP tokens you have
├── Decide how many to burn
├── Full exit = all LP tokens
└── Partial = some LP tokens
Step 2: Prepare transaction
{
"TransactionType": "AMMWithdraw",
"Account": "rYourAccount...",
"Asset": { "currency": "XRP" },
"Asset2": {
"currency": "USD",
"issuer": "rIssuer..."
},
"LPTokenIn": {
"currency": "03A19...",
"issuer": "rAMMAccount...",
"value": "15811" // LP tokens to burn
},
"Flags": tfTwoAsset
}
Step 3: Sign and submit
├── Review amounts
├── Confirm LP tokens being burned
├── Sign transaction
└── Submit to network
Step 4: Verify receipt
├── Check LP token balance (should decrease)
├── Check asset balances (should increase)
├── Verify received amounts match expectations
└── Record for accounting
```
POST-WITHDRAWAL CHECKLIST
Immediately:
├── Verify received assets
├── Check LP token balance is zero (if full withdrawal)
├── Screenshot final state
└── Record transaction hash
For records:
├── Date and time of withdrawal
├── LP tokens burned
├── Assets received (both amounts)
├── Asset prices at withdrawal
├── Total withdrawal value
├── Calculate total return
├── Calculate realized IL
├── Estimate fee income earned
└── Net profit/loss
Tax documentation:
├── Entry transaction(s)
├── Exit transaction
├── Cost basis calculation
├── Gain/loss computation
├── Hold period (short/long term)
└── Keep all records
Optional cleanup:
├── Remove trust line for LP token (if desired)
├── Frees 2 XRP reserve
├── Only if not planning to re-enter
└── Can always recreate later
```
ESSENTIAL RECORDS TO MAINTAIN
Transaction log:
├── Every deposit transaction hash
├── Every withdrawal transaction hash
├── Dates and amounts
├── Prices at transaction time
└── Running balance
Position tracker:
├── Current LP token balance
├── Current pool share
├── Estimated value (updated periodically)
├── Comparison to entry value
└── Running P&L
Performance metrics:
├── Entry value
├── Current value
├── Total deposits
├── Total withdrawals
├── Net invested
├── Return ($ and %)
├── IL suffered
├── Fee income estimated
└── Net performance vs hold
Template recommendation:
├── Spreadsheet with tabs:
│ ├── Transactions
│ ├── Position Summary
│ ├── Performance
│ └── Tax Lots
├── Update at least monthly
└── Or use dedicated tracker
```
LP OPERATIONAL MISTAKES
Mistake: Not recording entry details
├── Can't calculate IL without entry prices
├── Tax reporting impossible
├── Learn from: Always record immediately
└── Prevention: Screenshot at entry
Mistake: Wrong deposit ratio
├── Single-asset when two-asset possible
├── Pays unnecessary slippage
├── Learn from: Calculate ratio first
└── Prevention: Check pool state before depositing
Mistake: Ignoring reserves
├── Account locked due to reserves
├── Can't send transactions
├── Learn from: Keep buffer XRP
└── Prevention: Maintain 20+ XRP beyond position
Mistake: Panic withdrawal
├── IL looks scary, withdraw at worst time
├── Locks in losses
├── Learn from: Have exit criteria before entry
└── Prevention: Define exit rules upfront
Mistake: Not comparing to holding
├── Think you're profiting when just price went up
├── Actually underperformed hold
├── Learn from: Calculate IL and compare
└── Prevention: Track hold value alongside
```
LP SECURITY CHECKLIST
Wallet security:
├── Hardware wallet for significant amounts
├── Never share seed phrase
├── Verify transaction details before signing
├── Use trusted interfaces only
└── Beware of phishing sites
Pool verification:
├── Verify AMM account address
├── Check asset issuers are legitimate
├── Don't LP in unknown tokens
├── Research before depositing
└── Start small with new pools
Transaction safety:
├── Review all transaction details
├── Amounts, assets, addresses
├── Don't rush—verify carefully
├── Test with small amount first
└── Use testnet for learning
Operational security:
├── Don't disclose LP positions publicly
├── Be wary of "too good to be true" pools
├── Diversify across pools (don't concentrate)
├── Have exit plan ready
└── Monitor for anomalies
```
AVAILABLE TOOLS
Explorers with AMM support:
├── xrpscan.com/amm
├── bithomp.com
├── Various XRPL explorers
└── Query pool data directly
Wallets with AMM UI:
├── Some wallets have LP interfaces
├── Quality varies
├── Check for latest updates
└── May simplify process
API documentation:
├── xrpl.org AMM docs
├── Transaction specifications
├── Query methods
└── For developers/advanced users
Community resources:
├── XRPL Discord
├── Reddit communities
├── Developer forums
└── Ask questions, share learnings
```
RECOMMENDED LP WORKFLOW
Setup phase (one-time):
├── Create tracking spreadsheet
├── Set up wallet
├── Fund with XRP
├── Bookmark useful tools
└── Practice on testnet
Per-position workflow:
├── Research pool
├── Calculate expected returns
├── Define exit criteria
├── Execute deposit
├── Record entry details
├── Set monitoring schedule
Ongoing:
├── Check positions weekly
├── Update value estimates
├── Calculate running returns
├── Compare to benchmarks
├── Assess exit criteria
└── Adjust strategy as needed
Exit:
├── Confirm exit criteria met
├── Execute withdrawal
├── Record final details
├── Calculate final return
├── Document for taxes
└── Review and learn
```
✅ LP operations work as documented. Deposit, monitor, withdraw functions reliably.
✅ Trust lines required for LP tokens. Standard XRPL mechanics apply.
✅ Two-asset deposits are more efficient. Single-asset has additional slippage.
⚠️ Best monitoring tools. Ecosystem is evolving; quality varies.
⚠️ Tax treatment specifics. Varies by jurisdiction; consult professional.
⚠️ Optimal tracking methodology. Multiple valid approaches exist.
📌 Not keeping records. Makes tax reporting and performance analysis impossible.
📌 Skipping pre-deposit research. Entering unknown pools is risky.
📌 Panic withdrawals. Exiting at worst times locks in losses.
LP operations on XRPL are straightforward once you understand the mechanics. The process is: research → deposit → monitor → withdraw. Rigorous record-keeping and defined exit criteria are as important as the transactions themselves. Start small, learn the mechanics, then scale.
Assignment: Create a comprehensive checklist for LP lifecycle on XRPL.
Requirements:
Wallet setup requirements
Funding requirements
Pool research items
Position sizing considerations
Risk assessment questions
Trust line verification
Pool ratio calculation
Transaction preparation
Signing process
Post-deposit verification
Record-keeping items
Daily/weekly items
Monthly items
Alert triggers
Value calculation steps
IL calculation steps
Pre-withdrawal review
Transaction steps
Post-withdrawal verification
Record finalization
Tax documentation
Transaction log format
Position tracker format
Performance calculation format
Include example entries
Actionable checklist format
Can be used as actual operational guide
Includes all necessary details
Printable/usable during actual LP activities
Completeness (30%)
Practicality (30%)
Accuracy (25%)
Usability (15%)
Time Investment: 2-3 hours
Knowledge Check
Question 1 of 4Before receiving LP tokens on XRPL, what must you have set up?
- AMM transaction specifications
- Wallet integration guides
- API query methods
- XRPL explorers
- Wallet applications
- Spreadsheet templates
- XRPL developer Discord
- LP discussion forums
- Educational resources
For Next Lesson:
Lesson 12 examines the current XRPL AMM pool landscape—available pools, TVL distribution, volume analysis, and honest assessment of the ecosystem.
End of Lesson 11
Total words: ~5,300
Estimated completion time: 50 minutes reading + 2-3 hours for deliverable
Key Takeaways
Set up trust line before receiving LP tokens.
Usually handled automatically, but understand the requirement.
Two-asset deposits are more efficient.
Calculate correct ratio; avoid single-asset unless necessary.
Record everything at entry.
Transaction hash, amounts, prices, pool state—you'll need these.
Monitor regularly.
Weekly checks on value, IL, and return versus holding.
Define exit criteria upfront.
Prevents emotional decisions; withdraw when criteria met. ---