Skip to main content
See Get user positions for details how to retrieve all positions of a user including fees earned if any.

Function name: collect Recommended gas limit: 300,000

Code overview

The following code demonstrates how to claim all swap fees from a pool.
When claiming fees from a pool that involves HBAR, include unwrapWHBAR in your multicall to convert the Wrapped HBAR (WHBAR) output token back into the native HBAR cryptocurrency.
Resources:

Next steps

Get user positions (V2)

See fees earned across all positions.

Decreasing liquidity (V2)

Collect fees while exiting a position.