esLBRBoost

Boosts in Lybra are calculated based on a formula that involves the amount of locked up LBR (which equals the amount of esLBR), the Maximum LBR Lock-up Limit (also referred to as the esLBR Limit), and a time weight factor. The formula is as follows:

Boost = (Locked up LBR / Max Lockable LBR/esLBR Limit) * Time Weight

The Maximum LBR Lockable Limit (esLBR Limit) for a user is determined by the ratio of the user's total mint value to the total mint value across the entire protocol, multiplied by the total circulation of LBR and esLBR. This is illustrated as:

Max LBR Lockable Limit (esLBR Limit) = (User Total Mint Value / Protocol Total Mint Value) * (LBR+esLBR) Total Circulation

Users are allowed to lock up more esLBR than the lockable limit, but the boost will be calculated based on the real Maximum esLBR Lockable Limit.

Function Documentation

setLockStatus

function setLockStatus(uint256 id, uint256 lbrAmount, bool useLBR) external

The user can set the lock status and choose to use either esLBR or LBR.

ParameterTypeDescription

id

uint256

The ID of the lock setting.

lbrAmount

uint256

The amount of LBR/esLBR to be locked.

useLBR

bool

Flag indicating whether to use LBR or not.

unLock

function unLock() external

Unlocks the user's locked amount.

getUnlockTime

function getUnlockTime(address user) external view returns (uint256 unlockTime)

Returns the unlock time for a user.

ParameterTypeDescription

user

address

The user's address.

getUserBoost

function getUserBoost(address user, uint256 userUpdatedAt, uint256 finishAt) external view returns (uint256)

Calculates the user's mining boost based on their lock status.

ParameterTypeDescription

user

address

The user's address.

userUpdatedAt

uint256

The timestamp when the user's status was last updated.

finishAt

uint256

The timestamp when the boost calculation finishes.

getAmountNeedLocked

function getAmountNeedLocked(address user) public view returns (uint256)

Returns the amount of esLBR needed to be locked for a user.

ParameterTypeDescription

user

address

The user's address.

userLockStatus

function userLockStatus(address user) public view

Returns the current lock status of the user.

Last updated