Claim Royalty Fees

How to claim royalty fees from a Vertigo pool

Overview

The SDK v2 provides a simplified method for claiming accumulated fees from your pools:

  • claimFees() - Claim all accumulated royalty fees from a pool

Pool owners can claim trading fees that have accumulated in their pools. The SDK handles all the complexity of identifying the correct token accounts and building the transaction.

Prerequisites

  • You must be the pool owner to claim fees

  • You must have a wallet configured (use Vertigo.load() instead of Vertigo.loadReadOnly())

  • Fees must have accumulated in the pool from trading activity

Parameters

For claimFees():

  • poolAddress - The public key of the pool to claim fees from

  • destinationAccount - (Optional) The token account to receive claimed fees. If not provided, the fees are sent to your wallet's associated token account for the pool's quote token

  • options - (Optional) Transaction options:

    • priorityFee - Priority fee: "auto" for automatic calculation, or a specific number in micro-lamports

    • commitment - Transaction confirmation level (default: "confirmed")

Example: Claim fees from a pool

Example: Claim fees with custom options

Example: Check fees before claiming

Get pool data to see accumulated fees:

Example: Claim from multiple pools

If you own multiple pools, you can claim fees from all of them:

Migration from v1

v1 (Old)

v2 (New)

Key Improvements in v2

  1. Simplified interface - No need to specify mints, token programs, or accounts

  2. Automatic handling - SDK handles all token account lookups and creation

  3. Owner verification - Automatically verifies you own the pool

  4. Better errors - Clear error messages if pool doesn't exist or you're not the owner

  5. Type safety - Full TypeScript support

Error Handling

Understanding Royalty Fees

  • Fee rate: Set when creating the pool (e.g., 250 basis points = 2.5%)

  • Accumulation: Fees are collected separately from pool reserves with each trade (not stored in pool reserves)

  • Claiming: Only the pool owner can claim accumulated fees

  • Frequency: You can claim fees as often as you like

  • Token type: Fees are accumulated in the pool's quote token (usually SOL)

Tips

  • Check pool statistics before claiming to see if there are fees worth claiming

  • Consider transaction costs - claiming small amounts may not be profitable

  • You can batch multiple claims if you own multiple pools

  • Use appropriate priority fees during high network congestion

  • The SDK automatically handles SOL wrapping/unwrapping as needed

Last updated