For the complete documentation index, see llms.txt. This page is also available as Markdown.

Claim LP rewards

Claim accrued AQUA rewards for a liquidity position with the official SDK — check the pending amount, then collect it.

Liquidity in a reward zone pool accrues AQUA every second. Check what a position has accrued, then claim it.

This page continues from the client setup in Deposit liquidity. For the raw router signature — claim(user, tokens, pool_index) — see Router & pool contracts.

1. Check the pending amount

Reading needs no signer — pass any address:

pool = next(p for p in aqua.pools_for_pair(XLM, AQUA) if p.type == "volatile" and p.fee_bps == 30)

pending = pool.pending_rewards()   # the signer's accrual, in stroops of AQUA
const pool = (await aqua.pools.forPair(XLM, AQUA)).find(p => p.type === "volatile" && p.feeBps === 30);

const pending = await pool.pendingRewards();   // the signer's accrual, in stroops of AQUA

2. Claim

result = pool.claim_rewards()

print(f"claimed: {result.amount} stroops of AQUA")
print(f"transaction: {result.tx_hash}")
const result = await pool.claimRewards();

console.log(`claimed: ${result.amount} stroops of AQUA`);
console.log(`transaction: ${result.txHash}`);

The claimed AQUA lands in the signer's account; the position itself is untouched and keeps accruing. A pool outside the reward zone accrues nothing — claiming there returns 0.

Claiming also refreshes your reward boost — worth doing periodically while other providers move in and out of the pool.

Last updated