For the complete documentation index, see llms.txt. This page is also available as Markdown.
Claiming & swapping accumulated fees
Claim the fees your integration has accumulated, or convert them into one target asset.
Your fee accumulates on the collector as plain token balances — the fee comes out of each swap's output token, so a collector serving many pairs holds many tokens. Claims are per token, only the collector's operator can call them, and every claim pays out to the fee_destination fixed at deploy time.
Reads need no signer. balance returns 0 for a token the collector has never held:
from aquarius import AquariusClient, Asset,XLMAQUA= Asset.classic("AQUA","GBNZILSTVQZ4R7IKQDGHYGY2QXL5QOFJYQMXPKWRRM5PAV7Y4M67AQUA")aqua =AquariusClient(network="mainnet")collector = aqua.fee_collector("C...")# your deployed collectorprint(collector.fee_destination())# where claims pay outprint(collector.balance(AQUA))# accrued fees in AQUA, base units
import{AquariusClient,Asset,XLM}from"@aquariusdefi/sdk";constAQUA=Asset.classic("AQUA","GBNZILSTVQZ4R7IKQDGHYGY2QXL5QOFJYQMXPKWRRM5PAV7Y4M67AQUA");constaqua=newAquariusClient({network:"mainnet"});constcollector=aqua.feeCollector("C...");// your deployed collectorconsole.log(awaitcollector.feeDestination());// where claims pay outconsole.log(awaitcollector.balance(AQUA));// accrued fees in AQUA, base units
Claim and convert into one asset
claim_and_swap claims a token's entire accrued balance, swaps it through the router along a fresh quoted route, and sends the output token to the fee destination. The minimum-out guard comes from the quote, so a moving market fails the claim instead of underdelivering. The signer must be the operator:
from stellar_sdk import KeypairUSDC= Asset.classic("USDC","GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN")aqua =AquariusClient(network="mainnet",signer=Keypair.from_secret("S..."))collector = aqua.fee_collector("C...")claimed = collector.claim_and_swap(AQUA,USDC,slippage=0.01)print(f"claimed {claimed.amount_in} AQUA -> {claimed.amount_out} USDC")print(f"transaction: {claimed.tx_hash}")
import{Keypair}from"@stellar/stellar-sdk";constUSDC=Asset.classic("USDC","GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN");constaqua=newAquariusClient({network:"mainnet",signer:Keypair.fromSecret("S...") });constcollector=aqua.feeCollector("C...");constclaimed=awaitcollector.claimAndSwap(AQUA,USDC,{slippage:0.01});console.log(`claimed ${claimed.amountIn} AQUA -> ${claimed.amountOut} USDC`);console.log(`transaction: ${claimed.txHash}`);
Claim raw
claim sweeps one token's balance to the fee destination without conversion. For classic assets the destination needs a trustline for that token:
Claims are operator-gated by the contract: claim_fees and claim_fees_and_swap require the operator's signature and reject every other caller. The payout address is equally fixed — the operator chooses the token and the route, never the destination.
Contract-level flow (any language)
The collector functions behind claim_and_swap and claim, called directly: