Sperax
  • USDs (Sperax USD)
    • Minting and Redeeming
    • Auto Yield
      • Smart Contracts can opt in for the rebase feature (Auto-yield).
    • Stability Mechanism
    • Key parameters and functions
    • Technical documents
      • Sequence diagrams
      • Smart contracts
        • Vault
        • USDs
        • CollateralManager
        • SPA Buyback
        • MasterPriceOracle
        • Yield Reserve
        • Fee Calculator
        • RebaseManager
        • Dripper
        • BaseStrategy
      • Deployed contracts
  • Buyback Contract
  • Staking Protocol
    • Locking SPA
    • Withdrawing SPA
    • Staking Rewards
  • Demeter Protocol
    • How does Demeter Work?
    • Technical documents
      • Smart contracts
        • E721 Farms
          • E721Farm
          • Camelot V3
            • CamelotV3FarmDeployer
            • CamelotV3Farm
        • Base contracts
          • Farm
          • FarmStorage
          • FarmRegistry
          • FarmDeployer
        • Features
          • ClaimableFee
          • ExpirableFarm
          • OperableDeposit
        • Rewarder
          • Rewarder
          • RewarderFactory
      • Deployed contracts
  • Getting Started on Our DApp
    • Minting & Redeeming USDs
    • Stake SPA
  • Governance
  • Bug Bounty Program
  • FAQ
    • SPA Tokenomics
    • xSPA token
    • Smart Contract Addresses
    • How to Transfer SPA from Ethereum to Arbitrum
  • Quick Links
    • Audit Reports
    • Sperax Dapp
    • Demeter Dapp
    • Discord
    • Forum
    • Snapshot
Powered by GitBook
On this page
  • Functions
  • claimPoolFee
  • _claimPoolFee
  • Events
  • PoolFeeCollected
  • Errors
  • NoFeeToClaim

Was this helpful?

Export as PDF
  1. Demeter Protocol
  2. Technical documents
  3. Smart contracts
  4. Features

ClaimableFee

PreviousFeaturesNextExpirableFarm

Was this helpful?

Inherits: Farm

Author: Sperax Foundation.

Farms build for pairs/ pools in which fee can be claimed can extend and override _claimPoolFee function of this contract.

Functions

claimPoolFee

A function to claim the pool fee earned by lp.

Only the deposit owner can call this function.

function claimPoolFee(uint256 _depositId) external nonReentrant;

Parameters

Name
Type
Description

_depositId

uint256

ID of the deposit.

_claimPoolFee

Claim pool fee internal logic to be implemented by child farm contract.

Just override this function and write the logic to claim fee, validation and other checks are handled in claimPoolFee.

function _claimPoolFee(uint256 _depositId)
    internal
    virtual
    returns (uint256 tokenId, uint256 amt0Recv, uint256 amt1Recv);

Parameters

Name
Type
Description

_depositId

uint256

Deposit ID of the deposit in the farm.

Returns

Name
Type
Description

tokenId

uint256

Token ID of the deposit for E721 farms, for other farms return depositId.

amt0Recv

uint256

Amount 0 received as fee.

amt1Recv

uint256

Amount 1 received as fee.

Events

PoolFeeCollected

event PoolFeeCollected(address indexed recipient, uint256 tokenId, uint256 amt0Recv, uint256 amt1Recv);

Errors

NoFeeToClaim

error NoFeeToClaim();
Git Source