See the canonical spec:
.TypeScriptimport { Client, Wallet } from 'xrpl'; async function createAMM(): Promise<void> { const client = new Client('wss://honeycluster.dev'); await client.connect(); const wallet = Wallet.fromSeed('s...'); const prepared = await client.autofill({ TransactionType: 'AMMCreate', Account: wallet.address, Amount: { currency: 'USD', issuer: 'r...issuer', value: '100' }, Amount2: '100000000', TradingFee: 500, }); const signed = wallet.sign(prepared); const res = await client.submitAndWait(signed.tx_blob); console.log(res); await client.disconnect(); } createAMM().catch(console.error);
| Field | Type | Required | Description |
|---|---|---|---|
Account | String | Yes | The address of the account creating the AMM |
Amount | Object | Yes | The first asset to provide for the AMM pool |
Amount2 | String/Object | Yes | The second asset to provide for the AMM pool |
TradingFee | Number | Yes | The trading fee for the AMM, in units of 1/100,000 |
Flags | Number | No | Flags to enable/disable certain AMM features |
Amount Object Format:
For XRP: "1000000" (drops)
For issued currency: {"currency": "USD", "issuer": "r...", "value": "100"}
TradingFee:
Range: 0 to 1000
Represents 0% to 1% fee (e.g., 500 = 0.5%)
Creates a new AMM instance for trading between two assets
Requires Amount and Amount2 for the initial liquidity pool
TradingFee determines the fee charged for trades
Always use autofill to set fees and sequence safely when using the XRPL client library