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
  • Key Features:
  • Contract State Variables
  • Core Functionalities

Was this helpful?

  1. Engineering
  2. Smart Contracts

JavFreezer

General Description

The JavFreezer contract facilitates user deposits, rewards distribution, and freeze mechanisms in a DeFi ecosystem. It supports multiple pools, different lock periods for freeze, and rewards tied to the amount of time a user locks their tokens. Additionally, users can claim rewards or withdraw tokens based on the freeze period they choose.

Key Features:

  • Pools and Fees:

    • Pools represent different staking options, each with a base token (e.g., a freeze token) and a reward token.

    • Fees are applied during deposits and withdrawals.

  • Rewards Distribution:

    • The contract includes mechanisms for distributing rewards over time, updating reward information, and handling pending rewards.

  • Lock Periods and Multipliers:

    • Users can choose to lock tokens for different periods (e.g., months), each with different multipliers affecting rewards.

  • Vesting Mechanism:

    • There is support for special "vesting" deposits where tokens can be locked and withdrawn after certain conditions.

Contract State Variables

Core Pool Structures:

  1. PoolInfo[] poolInfo: Stores details for each pool, such as:

    • Base and reward tokens.

    • Accumulated rewards per share.

    • Total shares in the pool.

  2. PoolFee[] poolFee: Defines fee structures for each pool, including deposit, withdraw, and claim fees.

  3. mapping(uint256 => mapping(address => UserInfo)) userInfo: Tracks user-specific freezer information such as shares and reward debts.

  4. mapping(uint256 => mapping(address => UseDeposit[])) userDeposits: Tracks user-specific freezer deposit information such as amount, stake period and witdraw timestampo.

  5. mapping(address => TokenPrecisionInfo) tokensPrecision: Holds precision configurations for base and reward tokens.

Core Functionalities

  • Pool Management:

    • addPool: Adds a new pool by specifying the base and reward tokens, the reward configuration, and associated fees.

    • setPoolInfo: Updates pool reward configuration.

    • setPoolFee: Allows changing the fee configuration for a specific pool.

  • Reward Configuration and Claims:

    • setRewardConfiguration: Admin function to configure reward rates.

    • addRewards: Used by the rewards distributor to add rewards to the system.

    • claimAll: A user function that allows claiming rewards for all their deposits in a given pool.

    • claim: Claims rewards for a specific deposit.

  • Staking and Withdrawal:

    • deposit: Allows a user to deposit tokens into a specific pool, locked for a given period.

    • withdrawVesting: Allows the vesting contract to withdraw tokens on behalf of users who have locked them in a pool.

    • withdraw: Allows users to withdraw tokens from their deposit (after fulfilling lock period requirements).

  • Migration (will be deleted after base migration)

    • makeMigration: Migrates user deposits from migration contract, enabling assets to be transferred to this contract.

  • Rewards and APR Calculations:

    • pendingReward: Returns the pending reward for a specific deposit.

    • apr: Returns the Annual Percentage Rate (APR) for a given pool and lock period.

Last updated 6 months ago

Was this helpful?