Coder Social home page Coder Social logo

joshlmao / ydly-calc Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 2.0 3.54 MB

๐Ÿงฎ 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

License: MIT License

HTML 1.25% JavaScript 90.09% CSS 0.07% Python 7.47% SCSS 1.12%
yieldly algorand estimator algo

ydly-calc's Introduction

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.

ydly-calc's People

Contributors

janvandenenden avatar joshlmao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.