Capital allocation dashboard open on a desk in a DeFi protocol operations setting.
Protocols

Handling the XRPL AMM (XLS-30) in Applications

A technical integration guide for the XLS-30 Automated Market Maker. Covers constructing AMM transactions, interpreting AMM ledger objects for UI display, and calculating single-sided vs. double-sided deposit outcomes for DeFi interfaces and wallet providers.
introduction
XRPL AMM INTEGRATION

Introduction

A technical guide for integrating the XLS-30 Automated Market Maker into applications, covering transaction construction, ledger object interpretation, and liquidity operation mechanics.

The XLS-30 amendment introduces a native Automated Market Maker (AMM) to the XRP Ledger, enabling on-ledger liquidity pools and trading directly within the protocol. For application developers, this is not a simple UI overlay on existing DEX functionality. It requires constructing new transaction types (AMMCreate, AMMDeposit, AMMWithdraw, AMMVote), interpreting a new set of ledger objects (AMM, LPToken), and correctly calculating outcomes for single-sided and double-sided deposits. Wallets, DeFi interfaces, and custodial services must integrate these primitives to support liquidity provision and AMM-based trading.

The operational impact is significant. Unlike the existing order book DEX, the AMM uses a constant-product formula and issues LP Tokens to represent ownership of pooled assets. Applications must track these tokens, handle the auction mechanism for rebalancing single-sided deposits, and correctly display impermanent loss and fee accrual to users. The AMMVote transaction introduces a governance layer, allowing LP token holders to vote on trading fees, which requires UIs to surface governance participation. Failure to correctly parse the AMM object's fields, such as AuctionSlot, can lead to incorrect balance displays or failed transactions.

Chainscore Labs provides protocol-level review for teams integrating XLS-30. This includes verifying the correctness of transaction construction logic, auditing the interpretation of AMM ledger objects for UI display, and assessing the risk of edge cases in single-sided deposit and withdrawal flows. For exchanges and custodians, we review the accounting model for LP Tokens and the monitoring requirements for auction slot claims to ensure operational safety.

XLS-30 AMM INTEGRATION SURFACE

Integration Quick Facts

What changes for applications integrating with the XRPL Automated Market Maker, who is affected, and the immediate actions required.

AreaWhat changesWho is affectedAction

Transaction Model

New transaction types: AMMCreate, AMMDeposit, AMMWithdraw, AMMVote. Each has specific field requirements and fee structures distinct from Payment or OfferCreate.

Wallet providers, exchange deposit systems, DeFi interfaces

Update transaction construction libraries and signing flows to support the new canonical transaction types. Verify field validation logic.

Ledger Object Parsing

New AMM ledger object type and modified trustline objects. AMM accounts hold the pool's asset pair. Metadata parsing must handle new node types for balance change calculation.

Custody platforms, accounting systems, block explorers, data indexers

Extend metadata parsers to correctly identify and process AMM-related AffectedNodes. Update balance calculation logic to attribute changes from AMM interactions.

Deposit Logic

Supports single-sided and double-sided deposits. Single-sided deposits can fail or result in a different LP token amount than expected due to slippage and pool ratio changes.

DeFi frontends, algorithmic trading bots, liquidity management dashboards

Implement pre-flight simulation using the amm_info API to calculate expected LP token returns. Display clear slippage warnings and handle the tec-class failure codes for single-sided deposits.

Liquidity Provision

Liquidity Provider (LP) tokens are represented as a new fungible token type. The AMM account itself is the issuer. LP token balance changes must be tracked for user portfolio display.

Wallets, portfolio trackers, tax reporting tools

Update token indexers to recognize the AMM account as an issuer. Display LP token balances and their underlying asset composition. Ensure trustline logic does not incorrectly flag the AMM issuer.

Voting Mechanism

AMMVote transaction allows LP token holders to vote on the pool's trading fee. Voting slots and fee governance are new on-ledger state that must be monitored.

Governance dashboards, LP analytics sites, community tooling

Parse AMM ledger objects to display current fee, voting slots, and voter participation. Build interfaces for constructing and submitting AMMVote transactions.

Pathfinding and Auto-Bridging

XRP Ledger's native pathfinding and auto-bridging can route payments through AMM pools. This changes the optimal path for cross-currency payments and can affect slippage.

Payment processors, wallets using ripple_path_find, arbitrage bots

Review pathfinding algorithms to ensure AMM pools are considered as potential liquidity sources. Test cross-currency payment outcomes with AMM routes enabled to verify cost and slippage assumptions.

Fee and Reserve Model

AMMCreate requires a one-time special reserve. AMM transactions consume transaction fees. LP tokens do not carry the owner reserve burden of NFTs, but the AMM account itself has reserve requirements.

Infrastructure cost planners, exchange operations teams

Account for the higher reserve requirement when funding AMM creation operations. Monitor the transaction fee market to optimize AMM transaction submission costs during network congestion.

Operational Monitoring

New transaction types and ledger objects introduce new failure modes. AMM pools can be drained, and LP tokens can become worthless if the underlying assets depeg or the pool is exploited.

Risk teams, security auditors, node operators

Implement monitoring for AMM-specific transaction failure codes. Set alerts for large, imbalanced AMMWithdraw transactions or rapid changes in pool composition that may indicate an attack or depegging event.

technical-context
BEYOND THE SWAP BUTTON

The AMM Integration Surface

The XLS-30 AMM is not a single contract call but a suite of new ledger objects, transactions, and state transitions that applications must model correctly.

Integrating the XRP Ledger's native Automated Market Maker (XLS-30) requires applications to handle a broader surface than a typical DEX swap. Beyond the AMMCreate, AMMDeposit, AMMWithdraw, and AMMVote transactions, the protocol introduces the AMM ledger object and modifies the behavior of existing objects like Offer and TrustLine. Wallets, exchanges, and DeFi interfaces must correctly parse the LPToken balance, interpret the AuctionSlot for discounted fees, and compute the dynamic trading fee that adjusts based on the AMM's volatility.

The operational complexity lies in state management and user expectations. A single-sided AMMDeposit does not guarantee a fixed amount of LP Tokens; the final allocation depends on the pool's current asset ratio, requiring frontends to display clear pre-transaction estimates and handle slippage. Similarly, AMMWithdraw can return assets in a different ratio than the pool's current composition if the LPToken redemption triggers a rebalancing. Custodians and exchanges must track the AMMAccount root, monitor for AMMDelete events, and reconcile the continuous auction mechanism that allows fee bidding without a separate off-chain order book.

For teams building on XRPL, the AMM integration surface demands a review of how the new objects interact with existing payment and order book flows. The auto-bridging capability of the XRPL pathfinding engine can now route through AMM pools, meaning a simple Payment transaction may execute against an AMM without explicit user intent. Chainscore Labs helps protocol teams audit this integration surface, ensuring that transaction construction, balance reconciliation, and fee accounting are correct before the amendment activates on mainnet.

WHO MUST ACT ON XLS-30 INTEGRATION

Affected Systems and Actors

Frontend and Wallet Teams

Your UI must construct AMM transactions and display pool state accurately. Key responsibilities include:

  • Transaction Construction: Implement AMMCreate, AMMDeposit, AMMWithdraw, and AMMVote flows. Handle the Asset and Asset2 fields correctly, including the canonical ordering requirement.
  • Deposit UX: Calculate and preview single-sided deposit outcomes. Warn users about slippage and the EPrice constraint before they sign.
  • LP Token Display: Parse AMM ledger objects to show users their LP token balance, pool share percentage, and voting status for fee governance.
  • Fee Display: Surface the current trading fee (0–1%) and the auction slot mechanism so liquidity providers understand the dynamic fee environment.

Failure to handle the LPTokenOut field or tfSingleAsset flag correctly will result in failed transactions or unexpected value loss for users.

implementation-impact
XLS-30 INTEGRATION SURFACE

Implementation Impact by Component

The AMM introduces new transaction types, ledger objects, and balance-change patterns that affect every layer of an application stack. Teams must update transaction construction, state parsing, fee estimation, and user-facing logic to handle AMM-specific behavior correctly.

01

Transaction Construction and Signing

Applications must support four new transaction types: AMMCreate, AMMDeposit, AMMWithdraw, and AMMVote. Each requires precise field construction, including the AMM asset pair, amount specifications for single-sided or double-sided deposits, and EPrice for voting. Incorrectly setting the Amount, Amount2, or EPrice fields can lead to transaction failure or unexpected economic outcomes. Wallet and exchange signing flows need to parse and display these new transaction types clearly to users before approval.

02

Ledger Object Parsing and State Tracking

The AMM creates a new AMM ledger object type and modifies AccountRoot objects to track LP tokens. Indexers, explorers, and custody systems must update their AffectedNodes parsing logic to correctly interpret CreatedNode, ModifiedNode, and DeletedNode entries for AMM objects. LP token balances are represented as trustlines to the AMM account, so balance calculation systems must distinguish between standard IOUs and LP tokens to avoid misreporting user positions or triggering incorrect compliance alerts.

03

Fee and Reserve Management

AMM transactions consume network fees and can involve significant owner reserves for the AMM account and LP token trustlines. The AMMCreate transaction requires a substantial XRP reserve to fund the AMM account. Wallets and exchanges must accurately estimate the total cost of AMM operations, including the trading fee (set at creation) and the impact of the AMM's auction mechanism on slippage. Failure to account for these costs can result in stuck transactions or unexpected balance deductions.

04

Deposit and Withdrawal Logic

Supporting single-sided deposits requires applications to calculate the expected LP token return based on the AMM's current pool composition, which differs from the simpler double-sided deposit ratio. AMMWithdraw with the LPTokenIn flag allows a user to specify LP tokens to burn, while the Amount and Amount2 fields define the minimum assets to receive. Applications must handle the TFWithdrawAll flag and correctly interpret the resulting balance changes, especially when the AMM's auction slot is occupied, which can alter withdrawal outcomes.

05

User Interface and Display Requirements

DeFi interfaces must display AMM pool metrics, including total liquidity, 24-hour volume, and the current trading fee. The AMM's unique auction mechanism, which reduces the trading fee over time until an arbitrageur resets it, requires a dynamic fee display. Wallets must clearly present the difference between depositing into an AMM and holding the underlying assets, including impermanent loss risk. LP tokens should be displayed as a distinct asset class with their own valuation logic.

06

Governance and Voting Integration

The AMMVote transaction allows LP token holders to vote on the AMM's trading fee. Applications must track the current vote slots and the EPrice (effective price) to inform users when their vote can influence the fee. This requires monitoring the AMM object's VoteSlots field and calculating the correct trading fee based on the current slot's vote. Exchanges and custodians holding LP tokens on behalf of users need a governance participation policy to decide if and how to cast these votes.

XLS-30 AMM OPERATIONAL IMPACT

Integration Risk Matrix

Key integration risks and required actions for applications supporting the XLS-30 Automated Market Maker on the XRP Ledger.

AreaWhat changesWho is affectedAction

AMM Object Parsing

New AMM ledger object type with dynamic fields for LP tokens, asset balances, and trading fees. Incorrect parsing leads to incorrect pool state display.

Wallets, explorers, data aggregators, DeFi dashboards

Update ledger object parsers to handle the AMM object type and its fields. Validate parsing logic against devnet objects.

Single-Sided Deposit Calculation

Single-sided deposits use an auction mechanism that can result in a different LP token amount than a double-sided deposit of equivalent value.

DeFi interfaces, liquidity management tools, wallets

Implement the auction logic for single-sided deposits in the UI. Clearly display expected slippage and LP token outcome before user confirmation.

AMM Transaction Construction

New transaction types: AMMCreate, AMMDeposit, AMMWithdraw, AMMVote. Incorrect field construction can lead to transaction failure or unexpected economic outcomes.

Wallets, exchanges, custodial services

Add support for the new transaction types in transaction construction libraries. Validate all mandatory and optional fields against the XLS-30 specification.

Fee Voting Mechanics

AMMVote transactions allow LP token holders to direct protocol fees. Misinterpreting vote weight or epoch boundaries can cause governance display errors.

Governance dashboards, LP analytics tools, DeFi protocols

Implement correct vote-weight calculation based on LP token holdings. Monitor vote epochs and display active fee settings accurately.

Reserve Requirements

AMM accounts require a higher base reserve. Failing to account for this can cause transaction failures due to insufficient XRP balance.

Wallets, exchanges, automated trading bots

Update reserve calculation logic to include the AMM account reserve. Ensure fee and reserve checks account for the higher requirement before transaction submission.

Continuous Auction Mechanism

The continuous auction for arbitrage and single-sided deposits introduces a time-sensitive component. Stale data can lead to failed transactions.

Arbitrage bots, DeFi frontends, liquidity aggregators

Implement real-time or near-real-time data feeds for AMM pool states. Set appropriate transaction timeouts and handle tec-class failure codes gracefully.

Liquidity Provider Token Tracking

LP tokens are represented as trustline balances. Standard token balance queries may not distinguish LP tokens from other IOUs.

Portfolio trackers, accounting systems, tax tools

Update balance scanning logic to identify LP tokens by their association with an AMM account. Ensure LP tokens are categorized correctly for reporting.

AMM FEATURE READINESS

Integration Rollout Checklist

A phased checklist for wallet, exchange, and DeFi interface teams preparing to support XLS-30 AMM functionality on the XRP Ledger mainnet. Each phase confirms a critical dependency before exposing AMM features to users.

What to check: Confirm that your rippled node is running version 2.1.0 or later and that the XLS-30 amendment is enabled on the network you are targeting (mainnet, testnet, or devnet).

Why it matters: AMM transactions submitted to a node that does not support the amendment will fail with temDISABLED. Querying ledger data for AMM objects against an incompatible node will return no results.

Confirmation signal: Use the feature admin command or check the amendments object in the server state. Look for the AMM amendment hash with enabled: true. Verify your node is synced and not amendment-blocked.

Chains We Build On

Looking to build on a specific blockchain?

We build smart contracts, DeFi applications, wallets, tokenization platforms, and blockchain infrastructure across the major ecosystems teams choose today. That includes Ethereum, Arbitrum, Optimism, Polygon, Avalanche, Solana, Sui, Aptos, Hedera, Stellar, and NEAR, with support for additional EVM and non-EVM networks based on your product requirements.

EVM ecosystems

  • Ethereum logo
    Ethereum
  • Arbitrum logo
    Arbitrum
  • Optimism logo
    Optimism
  • Polygon logo
    Polygon
  • Avalanche logo
    Avalanche
  • Cronos logo
    Cronos

Non-EVM ecosystems

  • Solana logo
    Solana
  • Sui logo
    Sui
  • Aptos logo
    Aptos
  • Hedera logo
    Hedera
  • Stellar logo
    Stellar
  • NEAR logo
    NEAR

Additional ecosystems

  • Polkadot logo
    Polkadot
  • Cosmos logo
    Cosmos
  • TON logo
    TON
  • Cardano logo
    Cardano
  • Algorand logo
    Algorand
  • Tempo logo
    Tempo

Also available for Base, appchains, custom EVM networks, and cross-chain product architecture.

XRPL AMM INTEGRATION FAQ

Frequently Asked Questions

Common questions from engineering teams integrating XLS-30 AMM functionality into wallets, DeFi interfaces, and custodial services.

AMM ledger objects are identified by the LedgerEntryType field set to AMM. The object contains critical fields for display:

  • AMMAccount: The address of the AMM's special account. This is not a regular account and cannot sign transactions.
  • Asset and Asset2: The two assets in the pool, including currency code and optional issuer.
  • TradingFee: The fee, in basis points, charged on trades against the pool.
  • VoteSlots: An array of VoteEntry objects representing the current trading fee votes.
  • AuctionSlot: If present, contains the current auction slot holder's account and pricing details.
  • LPTokenBalance: The total outstanding LP tokens, which you need to calculate a user's share of the pool.

To find all AMMs, use the amm_info API method or scan for AMM objects in the ledger. For a user's LP positions, you must scan for AMM trustlines in their account lines, where the currency code matches the LP token identifier. The LP token currency code is derived from the AMM's assets and is not a standard IOU.

Trusted by Industry Leaders

Delivering blockchain solutions for 5+ years.

We have partnered with 50+ leading DeFi protocols, NFT ecosystems, and fintech innovators to build secure, scalable, and capital-efficient blockchain products.

Selected Partners & Clients

ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
β€œI've been working with Chainscore Labs for last 3+ years, they've consistently delivered with strong ownership across multiple projects. The team is reliable and detail-oriented.”
L
Lee Erswell
CEO, Telos Foundation
how to get started

How to get started?

If you're looking for blockchain integration, ChainScore Labs has 5+ years of experience helping teams build and integrate exchanges, wallets, smart contracts, tokenization solutions, and protocol-connected products, we can help you choose the right path, integrate securely, and get to production faster. Our team consists of experienced blockchain developers and architects who can help you with your blockchain integration needs.

01

Exploration & Strategy

Define your product goals and choose the right blockchain architecture for your use case.

02

Architecture & Design

Design the smart contracts, tokenomics, and security parameters of your system.

03

Development & Integration

Build and integrate with wallets, oracles, and front-end dApps for a seamless experience.

04

Security & Launch

Comprehensive audits followed by a risk-managed mainnet deployment to protect your users.

Start a build

Need a blockchain engineering team?

Send the project context and we will respond with next steps, scope questions, and a practical path to delivery.