Claim the swap fees from an existing liquidity position
Contract ID: SaucerSwapV2NonfungiblePositionManager
See Get user positions for details how to retrieve all positions of a user including fees earned if any.
Function name: collect
⛽ Recommended gas: 300,000 gwei (~ $0.026 USD)
Struct Parameter Name | Description |
---|---|
uint256 tokenSN | The serial number of the token for which liquidity is being increased |
address recipient | EVM address to receive the claimed swap fees |
uint256 amount0Max | The maximum amount for the first token in its smallest unit |
uint256 amount1Max | The maximum amount for the second token in its smallest unit |
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.
Claim the swap fees from an existing liquidity position
Contract ID: SaucerSwapV2NonfungiblePositionManager
See Get user positions for details how to retrieve all positions of a user including fees earned if any.
Function name: collect
⛽ Recommended gas: 300,000 gwei (~ $0.026 USD)
Struct Parameter Name | Description |
---|---|
uint256 tokenSN | The serial number of the token for which liquidity is being increased |
address recipient | EVM address to receive the claimed swap fees |
uint256 amount0Max | The maximum amount for the first token in its smallest unit |
uint256 amount1Max | The maximum amount for the second token in its smallest unit |
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.