Skip to main content

Fees Collector Smart Contract (1.0.0)

Download OpenAPI specification:Download

The Fees Collector is a smart contract developed for the Klever network that manages the collection and distribution of fees and rewards. This contract is part of the energy integration system and works in conjunction with other modules to ensure fair and efficient reward distribution.

Overview

The Fees Collector contract provides:

  • Fee Collection: Collects fees accumulated weekly from trading pairs
  • Multi-token Support: Manages multiple tokens for fee distribution
  • Weekly Tracking: Maintains records of fees accumulated per week

Endpoints

Write operations that modify contract state

Claim Rewards

Allows users to claim their accumulated rewards from the Fees Collector.

How it works:

  • Distributes rewards to users who hold XKFI and have Energy in their account
  • Rewards are calculated based on the user's Energy amount relative to total Energy
  • Supports weekly reward distribution cycles

Process:

  1. Verifies the user has XKFI tokens and accumulated Energy
  2. Calculates the user's share of rewards based on their Energy
  3. Distributes the proportional rewards to the user
  4. Updates the user's claim progress

Benefits of claiming regularly:

  • Updates getCurrentClaimProgress
  • Reactivates getLastActiveWeekForUser
  • Synchronizes local data
  • Corrects energy values through refund_after_token_unlock()

Recommended maintenance flow:

  1. Check for expired positions
  2. Unlock expired positions
  3. Claim rewards
  4. Verify updated energy

Note: Users should claim rewards periodically (weekly recommended) to keep their storage updated and optimize energy calculations.

Request Body schema: application/json
required
scAddress
required
string

Fees Collector contract address

funcName
required
string
Value: "claimRewards"
args
Array of strings

No arguments required

Responses

Request samples

Content type
application/json
{
  • "scAddress": "klv1qqqqqqqqqqqqqpgq9696g7x76kwrrh02fahn4rpem4v595t8c0nqgxzpmu",
  • "funcName": "claimRewards",
  • "args": [ ]
}

Response samples

Content type
application/json
{
  • "data": {
    }
}