See the canonical spec:
.TypeScriptimport { Client, Wallet } from 'xrpl'; async function depositAMM(): Promise<void> { const client = new Client('wss://honeycluster.dev'); await client.connect(); const wallet = Wallet.fromSeed('s...'); const prepared = await client.autofill({ TransactionType: 'AMMDeposit', Account: wallet.address, Asset: { currency: 'USD', issuer: 'r...issuer', value: '10' }, Asset2: '1000000', Flags: 0, }); const signed = wallet.sign(prepared); const res = await client.submitAndWait(signed.tx_blob); console.log(res); await client.disconnect(); } depositAMM().catch(console.error);
| Field | Type | Required | Description |
|---|---|---|---|
Account | String | Yes | The address of the account depositing to the AMM |
Asset | Object | Yes | The first asset to deposit |
Asset2 | String/Object | Yes | The second asset to deposit |
Amount | String/Object | No | Amount of the first asset to deposit |
Amount2 | String/Object | No | Amount of the second asset to deposit |
EPrice | String | No | The effective price for the deposit |
Asset/Asset2:
For XRP: "0"
For issued currency: {"currency": "USD", "issuer": "r...", "value": "0"}
Amount/Amount2:
For XRP: "1000000" (drops)
For issued currency: {"currency": "USD", "issuer": "r...", "value": "100"}
EPrice:
Optional effective price for the deposit
If not specified, the current AMM price is used
Adds liquidity to an existing AMM pool
Can deposit one or both assets in the pool
LP tokens are minted to represent your share of the pool
Always use autofill to set fees and sequence safely when using the XRPL client library