Withdraw liquidity
Withdraw liquidity from an Aquarius pool with the official SDK — burn pool shares for the underlying tokens, guarded by per-token minimums.
1. Read your share balance
pool = next(p for p in aqua.pools_for_pair(XLM, AQUA) if p.type == "volatile" and p.fee_bps == 30)
shares = pool.share_balance() # the signer's shares; pass an address to check another accountconst pool = (await aqua.pools.forPair(XLM, AQUA)).find(p => p.type === "volatile" && p.feeBps === 30);
const shares = await pool.shareBalance(); // the signer's shares; pass an address to check another account2. Withdraw
result = pool.withdraw(shares, slippage=0.01)
print(f"received: {result.amounts}") # base units returned, in sorted-token order
print(f"transaction: {result.tx_hash}")const result = await pool.withdraw({ shares, slippage: 0.01 });
console.log(`received: ${result.amounts}`); // base units returned, in sorted-token order
console.log(`transaction: ${result.txHash}`);Last updated