LogoLogo
WebsiteTwitterGitHub
  • Introduction
    • Bridge
  • Wallets
    • fWallet
    • Rabby
    • MetaMask
    • Coinbase Wallet
    • Ledger
  • Staking
    • Overview
    • Stake FTM
    • Liquid Staking
    • Governance
  • Build on Opera
    • Overview
    • Tutorials
      • Deploy Contract
      • Verify Contract
      • Unit Test Contract
      • Create Fixed-Cap Asset
      • Create Variable-Cap Asset
      • Proxy Pattern
      • Diamond Proxy Pattern
    • Oracles
      • Chainlink
      • Band Protocol
      • API3
    • API
      • Public Endpoints
      • Transaction Tracing
      • Web3 API
      • GraphQL
        • Getting Started
        • Installation
        • Schema Basics
        • Schema Structure
        • Implementation Details
    • Providers
      • Contracts
        • Chainstack
        • thirdweb
        • GetBlock
      • API
        • The Graph
        • Covalent
        • Moralis
  • Funding
    • Gas Monetization
  • Run a Node
    • Overview
    • Node Providers
    • Mainnet
      • Run Validator Node
      • Run API Node
    • Testnet
      • Run Validator Node
      • Run Read-Only Node
    • Troubleshooting
    • FAQ
  • Technology
    • Overview
    • Consensus
    • Database Storage
    • Proof of Stake
    • Transaction Fees
    • Stablecoin
    • FAQ
  • Security
    • Contract Library
    • Fantom Safe
Powered by GitBook

© 2024 Fantom Foundation

On this page
  • Rewards Estimation
  • Delegation Limits
Export as PDF
  1. Build on Opera
  2. API
  3. GraphQL

Implementation Details

Rewards Estimation

Estimated rewards calculation uses the current status of the blockchain to approximate the amount of FTM rewarded for participating in staking. The network uses a proof-of-stake consensus variant to ensure the security of the data inside the blockchain structure.

To calculate the rewards, we use the baseRewardPerSecond value of the latest sealed epoch, but the total staked amount of tokens is calculated elsewhere. The epoch provides the total value of self-staked tokens and the amount of total delegated tokens within that epoch. However, the self-staked total does not account for temporarily offline nodes and includes delegated stakes in the process of being undelegated. Consequently, this value is not accurate for our calculations.

To get the current total staked value, we iterate all the staking records and collect the total staked amount from individual staking.

Delegation Limits

The delegation limit is determined by multiplying the staker's current self-staked amount by a fixed rate specified in the SFC contract. Currently, the maximum allowed delegations are set at 15 times the self-staked FTM.

To calculate the remaining delegation limit, we subtract the current delegated amount from the total limit. This value is provided by the API, so you don't need to perform the calculation manually. Note that tokens in the process of undelegation are not included in the delegated amount and therefore do not count towards the delegation limit.

PreviousSchema StructureNextProviders