Code Monkey home page Code Monkey logo

autofarm-v2-contracts's People

Contributors

autofarm-network avatar fmnxl avatar mildgiraffe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

autofarm-v2-contracts's Issues

AutoFarmV2 Code explanation

Hi,
I want code explanations of autofarmv2.sol file because I can't relate how code works and how the parameters should I give. So please provide me a doc file in which the code explanations has been written.

Thank You.

Calculating Apy

Hi I want to know how to calculate "APY Calculations total APY"

image

I want to calculate it to the exact same number in smart contract. But the number of the calculation didn't match.

I tried to calculate By BUSD for an easy calculation

I thought total APY would be calculated by the sum of the (BUSD deposit APY from Venus - BUSD borrow APY from Venus). And I also want to know about how to calculate auto apr.

` let supplyRatePerBlock = await contract.methods.supplyRatePerBlock().call();
console.log(supplyRatePerBlock);
let borrowRatePerBlock = await contract.methods.borrowRatePerBlock().call();
console.log(borrowRatePerBlock);
let borrowDepth = await contract_auto.methods.borrowDepth().call();
console.log(borrowDepth);

const bnbMantissa = 1 * 10 ** 18;
const blocksPerDay = 20 * 60 * 24;
const daysPerYear = 365;

const supplyAPY = ((Math.pow((supplyRatePerBlock / bnbMantissa * blocksPerDay) + 1 , daysPerYear-1))-1)*100 ;
const borrowAPY = ((Math.pow((borrowRatePerBlock / bnbMantissa * blocksPerDay) + 1 , daysPerYear-1))-1)*100 ;
console.log("supplyAPY", supplyAPY)
console.log("borrowAPY", borrowAPY)

var arr = new Array();
let r = (0.585);
console.log(r)
console.log(borrowDepth)
let borrowDepth_num = Number(borrowDepth);
console.log(borrowDepth_num+1)
for (var i = 1; i <= borrowDepth_num+1; i++) {
    let multi = 1;
    for (var j = 1; j < i; j++) {
        multi = multi * r;
        console.log("multi :j",j,"is",multi)
    }
    console.log("multi :i",i,"is",multi)
    arr.push(multi);
}
console.log(arr)
var sum = arr.reduce((a, b) => a + b);
console.log(sum)
let result = ((sum)*(1+supplyAPY/100)) - ((sum-1)*(1+borrowAPY/100));`

question about ownerAUTOReward

Hey guys,
I'm trying to understand your code and i got something i did not quite understand.

The owner auto reward is 12% on the website. i see this parameter down here [line 1454]

uint256 public ownerAUTOReward = 138; // 12%

that is used here [1594 - 1603]

uint256 AUTOReward =multiplier.mul(AUTOPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
AUTOToken(AUTOv2).mint(owner(), AUTOReward.mul(ownerAUTOReward).div(1000));
AUTOToken(AUTOv2).mint(address(this), AUTOReward);

I see that it's applying 138/1000 that is 0.138 and sending to owner.

Is this the team 12% reward?

What i'm missing here?

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.