write.account.add_liquidity
Add liquidity to a concentrated LP position atomically: combine wallet deposits, account collateral, swaps, LP minting, and optional leverage in one transaction.
Instructions
Multi-step flash-action: atomically combines [deposit from wallet] + [use account collateral] + [swap to optimal ratio] + [mint LP] + [borrow if leveraged] in ONE transaction. Do NOT call write.account.deposit separately. Capital sources: wallet tokens (deposits array), existing account collateral (use_account_assets=true), or both. Check allowances first (read.wallet.allowances), then approve if needed (write.wallet.approve). Supports depositing multiple tokens and minting multiple LP positions in one tx. Works with both margin accounts (can leverage) and spot accounts (no leverage). For workflows, call read.guides('strategies'). The returned calldata is time-sensitive — sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up). Response includes tenderly_sim_url and tenderly_sim_status for pre-broadcast validation. expected_value_change is in raw units of the account's numeraire token (6 decimals for USDC, 18 for WETH). Negative = cost to open, positive = value gained. Compare before.total_account_value and after.total_account_value for the full picture.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain_id | No | Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism) | |
| deposits | No | Wallet tokens to deposit. Approve each token first (write.wallet.approve). Omit to use only account collateral. | |
| leverage | No | 0 = no borrow, 2 = 2x leverage. Margin accounts only. | |
| slippage | No | Basis points, 100 = 1% | |
| positions | Yes | LP positions to mint. For a single position, pass one entry. | |
| wallet_address | Yes | Wallet address of the account owner | |
| account_address | Yes | Arcadia account address | |
| use_account_assets | No | If true, use ALL existing account collateral for LP minting. Fetched automatically. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | ||
| before | No | ||
| description | No | ||
| transaction | Yes | ||
| tenderly_sim_url | No | ||
| tenderly_sim_status | No | ||
| expected_value_change | No |