Skip to content

@gala-chain/chaincodeAPI


API > collectTradingFees

Function: collectTradingFees()

collectTradingFees(ctx, dto): Promise\<CollectTradingFeesResDto>

Parameters

ctx: GalaChainContext

GalaChainContext – The execution context providing access to the GalaChain environment.

dto: CollectTradingFeesDto

CollectTradingFeesDto – A data transfer object containing: - Pool details (identifying which Uniswap V3 pool the fees are collected from). - Recipient address (where the collected protocol fees will be sent).

Returns

[tokenAmount0, tokenAmount1]

Dev

The collectTradingFees function enables the collection of protocol fees accumulated in a Uniswap V3 pool within the GalaChain ecosystem. It retrieves and transfers the protocol's share of the trading fees to the designated recipient.

Source

chaincode/src/dex/collectTradingFees.ts:47