JoshLmao / ydly-calc

🧮 Small web app for calculating your Yieldly (YLDY) reward stake from the current global rewards and user stake(s)

Home Page:https://yldy-estimator.joshlmao.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yieldly Estimator/Calculator

twitter releases releases

A small web application for estimating Yieldly rewards. Includes estimating for the No Loss Lottery (NLL) and YLDY Staking pages.

The app shows your share of the current rewards pool. The rewards pool increases every 30 minutes (as per Yieldly's 1st July change) and can go down when someone else claims from that pool.

Any ALGO Donations are appreciated 😊 IM6CZ4KUPWT23PKA23MW5S4ZQVF4376GWELLAL5QA5NCMB635JTRUGIDPY

Claimable Rewards Formula

Big thank you to @Tommaso on Telegram for discovering the formula for determining a user's portion of the rewards pool, which is implemented in the app and can be seen below with the related variables required.

Any global are stored in the application (contract) while any user ones are stored alongside the Algorand wallet (algoexplorer.io/addresses/{your_algo_address} -> Apps -> Connected -> Hover over 'Eye' icon)

GT: Global Time
GSS: Global Staking Shares

USS: User Staking Shares
UA: User Amount
UT: User Time

Claimable YLDY Rewards = ((USS + ((GT - UT) / 86400) * UA) / GSS) * TYUL / 1000000

The js code can also be found in the YLDYCalculations.js file in the calculateYLDYRewardsFromDayPeriod() method

Development

Created using React and Vercel for hosting. Two environment variables (.env) are required, as well adjusting the config.json file.

Vercel

The repository is setup to be hosted using Vercel, used to hosted using github-pages. The develop and main branch are used as deployments. The develop branch test site can be found at yldy-calc-develop.vercel.app/

Database

The site has a small backend database that contains the global state of the Yieldly contracts, NLL (233725844) and YLDY Staking (233725850). The script runs to gather the values using the AlgoExplorer.io API and sleeps for X amount of hours to repeat. The script can be found in ./utils/yldy-state-fetcher

The backend database is hosted using Firebase and also utilizes their API's to store and fetch the data from it.

About

🧮 Small web app for calculating your Yieldly (YLDY) reward stake from the current global rewards and user stake(s)

https://yldy-estimator.joshlmao.com

License:MIT License


Languages

Language:JavaScript 90.1%Language:Python 7.5%Language:HTML 1.2%Language:SCSS 1.1%Language:CSS 0.1%