autofarmnetwork / autofarm-v2-contracts Goto Github PK
View Code? Open in Web Editor NEWHome to Autofarm's smart contracts
Home Page: https://autofarm.network
Home to Autofarm's smart contracts
Home Page: https://autofarm.network
HI it seem that alpaca farm contract does commit to the repository yet
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.
Hi I want to know how to calculate "APY Calculations total APY"
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));`
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.