Skip to main content

Staking Contract Configuration

This guide provides the configuration parameters required to set up and deploy a Staking Contract in the Defactor Engage platform. The staking contract allows users to stake tokens and earn rewards based on predefined plans and parameters.


Requirements for Staking Setup

Admin Address

  • Purpose: The admin address is required to manage the staking contract, configure parameters, and make updates.
  • Type: eth address (Ethereum-compatible address)

New Staking Plans Configuration

For creating a new staking plan apart from the default plans, the following parameters need to be defined:

Staking Configuration Parameters

ParameterTypeDescription
stakingTokeneth addressThe contract address of the token that will be staked.
rewardTokeneth addressThe contract address of the token used for rewards.
maxStakednumberMaximum amount of tokens that can be staked in this plan.
minStakeAmountnumberMinimum amount of tokens required to participate in staking.
initialRationumberThe initial ratio of rewards distributed per staked token.
stakingEndTimeUTC DateThe date and time (in UTC) when staking will end.
rewardEndTimeUTC DateThe date and time (in UTC) when reward distribution ends.
lockDurationnumberThe duration (in seconds) for which staked tokens are locked and cannot be withdrawn.
apynumberThe annual percentage yield (APY) applied during the staking period before unlocking.
apyAfterUnlocknumberThe annual percentage yield (APY) applied after the staking period has ended and is unlocked.

Example Configuration

adminAddress: "0x1234567890abcdef1234567890abcdef12345678"  # Admin address for contract management
stakingPlans:
- stakingToken: "0xabcdef1234567890abcdef1234567890abcdef12" # Staking token address
rewardToken: "0x1234567890abcdef1234567890abcdef12345678" # Reward token address
maxStaked: 100000 # Maximum staked amount
minStakeAmount: 100 # Minimum stake amount
initialRatio: 1.2 # Initial reward ratio
stakingEndTime: "2024-12-31T23:59:59Z" # Staking end time in UTC
rewardEndTime: "2025-01-31T23:59:59Z" # Reward end time in UTC
lockDuration: 2592000 # Lock duration (30 days in seconds)
apy: 12.5 # APY percentage before unlock
apyAfterUnlock: 5.0 # APY percentage after unlock

Follow us:

Copyright © 2024 Defactor. All Rights Reserved