@gala-chain/chaincode ∙ API
API > collectProtocolFees
Function: collectProtocolFees()
collectProtocolFees(
ctx,dto):Promise\<CollectProtocolFeesResDto>
Parameters
▪ ctx: GalaChainContext
GalaChainContext – The execution context providing access to the GalaChain environment.
▪ dto: CollectProtocolFeesDto
CollectProtocolFeesDto – A data transfer object containing: - Pool details (identifying which Decentralized exchange pool the fees are collected from). - Recipient address (where the collected protocol fees will be sent).
Returns
[tokenAmount0, tokenAmount1]
Dev
The collectProtocolFees function enables the collection of protocol fees accumulated in a Decentralized exchange pool within the GalaChain ecosystem. It retrieves and transfers the protocol's share of the trading fees to the designated recipient.