Smart Mining V2

Smart Mining V2: A high-yield fixed-term mining mode


As one of the digital financial derivatives on, mining provides crypto holders with stable, secure, and reliable services for subscription and redemption of investment products. Smart Mining V2, also known as fixed-term mining, is an important part of's mining service. It converts a user's staked assets to virtual assets of a certain amount according to the amount of assets staked and the staking duration. The total virtual stake is defined as the total amount of virtual assets converted from all users' staked assets. Users are rewarded based on their virtual assets' proportion in the total virtual stake, and they are only allowed to redeem their assets during a specified period of time.


Reward Distribution

Suppose the stake amount of a token is "amount". The token's lock-up duration DurationlockDuration_{lock} meets the following condition: Durationmin<=Durationlock<=DurationmaxDuration_{min}<=Duration_{lock}<=Duration_{max}。 where DurationmaxDuration_{ma x} is 1080 days, DurationminDuration_{min} is 30 days, and the maximum acceleration rateweightmaxweight_{max} is 1400% (magnifying by e12e^{12} times). The veToken is calculated in the following way:


Here,balanceveTokenbalance_{veToken}refers to the amount of a user's virtual assets. According to the reward distribution formula (2) of Smart Mining V1, the user's rewards are calculated in the following way:

f(ti,tn)=i=1mbalanceveTokenj=startiendi(titi1)rtTi3f(t_i,t_n)= \sum_{i=1}^{m}balance_{veToken} \sum_{j=start_i}^{end_i}\frac{(t_i-t_{i-1})r_t}{T_i}(3)

Here, rtr_t denotes the expansion factor of the reward token, tit_i denotes the i-th change, TiT_i denotes the total virtual stake at the time ti1t_{i-1}to tit_i, and balanceveTokenbalance_{veToken} denotes the amount of the user's virtual assets at the time ti1t_{i-1}to tit_i.

Contract code

function calculateBoostedBalance(uint256 amount, uint256 lockDuration) public view returns (uint256) {
    if (lockDuration == 0) {
        return amount;
    uint256 boostWeight = lockDuration.mul(BOOST_WEIGHT).div(DURATION_FACTOR);
    return amount.add(amount.mul(boostWeight).div(PRECISION_FACTOR));

Redemption Time of Fixed-Term Mining

DurationlockDuration_{lock} denotes the length of a lock-up period, DurationmaintenanceDuration_{maintenance} denotes the length of a cooling-off period for re-staking, tstaket_{stake} denotes the time when the assets are staked, and tnowt_{no w} denotes the current time. Assets can be redeemed when the following conditions are both met:

(tnowtstake)modDurationlock<=Durationmaintenance5(t_{now}-t_{stake}) mod Duration_{lock} <= Duration_{maintenance}(5)

rewards denotes the total amount of rewards, rewardsprevrewards_{prev} denotes the amount of settled rewards, tlastActiont_{lastAction} denotes the time of the last settlement, and DurationrewardDuration_{reward} denotes the lock-up duration during which the rewards are not settled yet. DurationoverdueDuration_{overdue} denotes the duration of time that is after the last lock-up period and shorter than a lock-up period. The user's rewards are calculated in the following way:

Durationoverdue=DurationrewardmodDurationlock7Duration_{overdue}=Duration_{reward} mod Duration_{lock}(7)

Contract code

function overdueDuration(address account) public view returns (bool, uint256, uint256){
    uint256 duration = userInfo[account].lockDuration;
    if (duration == 0) {
        return (true, 0, 0);
    uint256 totalTime = block.timestamp.sub(userInfo[account].lockStartTime);
    uint256 round = totalTime.div(duration);
    uint256 overdue = totalTime.mod(duration);
    if (round < 1 || overdue > maintenanceDuration || block.timestamp < userInfo[account].lastActionTime) {
        return (false, 0, 0);

    uint256 rewardsDuration = block.timestamp.sub(userInfo[account].lastActionTime);
    return (true, rewardsDuration, overdue);

Mining pools


Mainnet contract address:TY1mxnpL18oDP8hsSrrxNZgUMj71pcyFS8

2pool LOCK farm

Mainnet contract address:TJmn1bjmNfE2F1sw2x6P224i8sFQj5mnbg

Contract interaction

We use TronWeb to interact with contracts. One can easily interact with online contracts after initializing TronWeb instances.

const TronWeb = require('tronweb')
const privateKey = process.env.PRIVATE_KEY
const apiKey = process.env.API_KEY

var tronWeb = new TronWeb({
	fullHost: "",
	headers: { "TRON-PRO-API-KEY": apiKey },
	privateKey: privateKey,

Get mining pool information

View addresses of fixed-term/on-demand mining pools

  • Function: sub_pool()

>>> let contract = await tronWeb.getContract('TJmn1bjmNfE2F1sw2x6P224i8sFQj5mnbg')
>>> await contract.methods.sub_pool().call()

View rewards of on-demand mining pools

  • Function:earned(address)

  • Parameter: user's addres

>>> let contract = await tronWeb.getContract('TUgVp8FzZcFLHwruuncXaQo2js5Ym2GqSj')
>>> await contract.methods.earned('TF5MekHgFz6neU7zTpX4h2tha5miPDUj3z').call()

Transaction execution


  • Function:deposit(uint256)

  • Parameter:Deposit amount

>>> let contract = await tronWeb.getContract('TJmn1bjmNfE2F1sw2x6P224i8sFQj5mnbg')
>>> await contract.methods.deposit(1000000000000000000).send()


  • Function:withdraw(uint256)

  • Parameter:Withdrawal amount

>>> let contract = await tronWeb.getContract('TJmn1bjmNfE2F1sw2x6P224i8sFQj5mnbg')
>>> await contract.methods.withdraw(1000000000000000000).send()

Last updated