Javsphere Docs
Open AppJoin Trading Competition
  • Open Javsphere App
  • Welcome to Javsphere
  • Javsphere Stats
  • Fundamentals
    • Javsphere Set Up
      • Base Chain
      • Connect Wallet
      • Add Tokens
      • New to Crypto
    • Buy & add JAV
  • Products
    • LeverageX
      • Assets
        • Cryptocurrencies
        • Stocks
        • Forex
        • Commodities
      • Fees & Spread
      • Trader
        • Open Trade
        • Edit & Close Trade
      • Earn LLP Pool
        • Buy LLP
        • LLP Price & APY
      • xJAV Vault
        • FAQ
      • Limitations
      • Testing
      • Trading Competitions
      • Referral
    • StakeX
    • CryoVault
  • Trading Competitions
    • Current Competition
      • Create Profile
      • Create Community
      • Old competitions
        • Competition Vol. 3
        • Competition Vol. 2
        • Competition Vol. 1
        • Tournament
    • Zealy Campaign
      • Old Airdrops
        • Infinity Pass
        • CFR
        • UPT
        • DTL
        • RNG
        • DPM & Baby Dana
        • GRWV
    • Become a Sponsor
  • JAV Token
    • Utility
    • Whitepaper
      • Javsphere and JAV Token
        • JAV Token
          • Javsphere Fee Structure
          • Tokenomics
        • Added Value for Holders
        • Javsphere Technology
          • StakeX
          • CryoVault
          • LeverageX
      • Disclaimer
    • Governance
      • Onchain Proposals
      • Migration to Base
      • Offchain Proposals
      • Submit a Proposal
    • Base Migration
    • JAV Burn
  • JAVLIS
    • The Ultimate AI Agent
      • Ecosystem
      • USPs
      • Boost for LeverageX
      • Business Model
      • Roadmap
      • Virtuals as Infrastructure
      • More than a hype
      • Hiring
    • Buy JAVLIS
  • Engineering
    • Oracle System
    • Smart Contracts
      • LeverageX
        • JavBorrowingFees
        • JavFeeTiers
        • JavPairsStorage
        • JavPriceAggregator
        • JavPriceImpact
        • JavReferrals
        • JavTradingInteractions
        • JavTradingProcessing
        • JavTradingStorage
        • JavBorrowingProvider
        • LLPToken
        • Feeds
      • JavPriceAggregator
      • JavFreezer
      • JavStakeX
    • Github
    • Bug Bounty Program
  • Community & More
    • Content Library
      • Logos
      • UI Mockups
    • Social Content
    • Socials
      • Telegram Guidelines
  • LEGAL
    • Privacy Policy
    • Terms of Use
      • Excluded Jurisdictions
    • Migration Terms
    • Cookie Policy
    • Trading Competition Terms
    • Bug Bounty Terms
Powered by GitBook
On this page
  • General Description
  • Core Functionalities
  • initializeFeeTiers
  • setGroupVolumeMultipliers
  • setFeeTiers
  • updateTraderPoints
  • calculateFeeAmount
  • getFeeTiersCount
  • getFeeTier
  • getGroupVolumeMultiplier
  • getFeeTiersTraderInfo
  • getFeeTiersTraderDailyInfo

Was this helpful?

  1. Engineering
  2. Smart Contracts
  3. LeverageX

JavFeeTiers

General Description

The JavFeeTiers contract used for managing and calculating fee tiers and volume multipliers for a trading system. It supports defining and updating fee-related parameters for different trading groups and individual traders.

Core Functionalities

initializeFeeTiers

Initializes fee tiers and group volume multipliers.

  • Parameters:

    • _groupIndices: Array of group indices (pairs storage fee index) to initialize.

    • _groupVolumeMultipliers: Corresponding group volume multipliers (scaled by 1e3).

    • _feeTiersIndices: Array of fee tier indices to initialize.

    • _feeTiers: Array of fee tier configurations, including feeMultiplier and pointsThreshold.


setGroupVolumeMultipliers

Updates volume multipliers for specified groups.

  • Parameters:

    • _groupIndices: Array of group indices to update.

    • _groupVolumeMultipliers: Array of new volume multipliers (scaled by 1e3).


setFeeTiers

Updates fee tiers with new configurations.

  • Parameters:

    • _feeTiersIndices: Array of fee tier indices to update.

    • _feeTiers: Array of updated fee tier configurations, including feeMultiplier and pointsThreshold.


updateTraderPoints

Updates a trader’s daily points based on a new trade, recalculates trailing points, and caches the trader's daily fee tier.

  • Parameters:

    • _trader: Address of the trader.

    • _volumeUsd: Trading volume in USD (scaled by 1e18).

    • _pairIndex: Pair index associated with the trade.


calculateFeeAmount

Calculates the fee amount for a trader after applying their active fee tier multiplier.

  • Parameters:

    • _trader: Address of the trader.

    • _normalFeeAmountCollateral: Base fee amount (in collateral precision).

  • Returns: Adjusted fee amount after applying the active multiplier.


getFeeTiersCount

Retrieves the total number of active fee tiers.

  • Returns: The count of active fee tiers.


getFeeTier

Fetches the details of a specific fee tier.

  • Parameters:

    • _feeTierIndex: Index of the fee tier.

  • Returns: Fee tier details including feeMultiplier and pointsThreshold.


getGroupVolumeMultiplier

Retrieves the volume multiplier for a specific group.

  • Parameters:

    • _groupIndex: Index of the group (pairs storage fee index).

  • Returns: Volume multiplier for the specified group.


getFeeTiersTraderInfo

Gets a trader’s general fee-related information, including the last day updated and trailing points.

  • Parameters:

    • _trader: Address of the trader.

  • Returns: Trader info as lastDayUpdated and trailingPoints.


getFeeTiersTraderDailyInfo

Fetches a trader’s fee tier information for a specific day, including the cached fee multiplier and points.

  • Parameters:

    • _trader: Address of the trader.

    • _day: Specific day for which to fetch the information.

  • Returns: Daily fee tier information as feeMultiplierCache and points.

Last updated 5 months ago

Was this helpful?