Giter Site home page Giter Site logo

commissions's Introduction

Wassup, im Log (You might know me from discord) ๐Ÿ‘‹

Just like the person reading this, I like coding

I don't really know what else to put here

commissions's People

Contributors

logeth avatar oceanfishy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

0xnim gfxlabs

commissions's Issues

StrategyRARIcDAI.sol Review

  • // cDAI and fcDAI are auto compounding by default, so this contract needs to track its profits itself using this variable
    uint StampBalance;
    Why keep track of assets if you have exchangeRate?
  • _profit = sub(estimatedTotalAssets(), StampBalance); // _profit is in DAI
    fcDAI.redeemUnderlying(div(mul(_profit, cDAI.exchangeRateCurrent()), 10e18)); // Multiply then remove 18 decimals (big to small, Rule 2)
    cDAI.redeemUnderlying(_profit);
    StampBalance = estimatedTotalAssets();
    fcDAI.redeemUnderlying(div(mul(_debtOutstanding , cDAI.exchangeRateCurrent()), 10e18)); // Multiply then remove 18 decimals (big to small, Rule 2)
    cDAI.redeemUnderlying(_debtOutstanding);
    StampBalance = sub(StampBalance, _debtOutstanding);
    _loss = 0; // It is impossible to lose money from this stratagy, so loss is always zero.
    // (Unless compound gets hacked.. but then this vault will probably be the least of your concerns.)
    _debtPayment = 0; // No debts are paid
    return (_profit, _loss, _debtPayment);
    why call two times to reedemUnderlying? Can't you estimate profits with exchangeRate and make the difference between that value and vault.strategies(address(this))['totalDebt']?
  • _debtPayment = 0; // No debts are paid
    you need to pay the debtOutstanding, no matter profit or loss. Why is it always 0?
  • debtOutstanding = add(debtOutstanding, _debtOutstanding); // Keep track of debt to the vault
    the vault does this for you with a method called: vault.debtOutstanding(strategy) or with vault.strategies(address(this))['totalDebt'].
  • To simplify the 3 strategies DAI, USDC and USDT, you can have a clone method and make the cToken, fcTooken and Oracle parameters of the constructor.
  • Do you have tests for these strategies?
  • What's the estimated APR?

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.