Coder Social home page Coder Social logo

iearn-finance's People

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  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  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

iearn-finance's Issues

Remove 3 Day ROI from "Stats" and "Vaults" pages

3 day ROI data annualized is a very misleading metric when calculating APY for vault performance. The yearn.finance/stats and yearn.finance/vaults pages both include a 3 day ROI annualized. I believe this should be removed as it is not an accurate representation for vault APYs.

image

image

Enable "Claim Rewards" button on the Staking Contract

A new YIP passed that allows governance stakers to claim rewards without having voted recently. The rewards can be claimed directly from etherscan, but the button on the UI is still greyed out. Can this button be enabled?

image

Re-arrange order of yVaults

The current layout of the yVaults appears to be in an arbitrary order based on date added. This suggested change re-orders the yVaults to be in a logical order by importance/usage by end-user, and also groups them together by type.

Please re-arrange the order of the yVaults in this manner:

  1. curve.fi/3pool (highest ROI currently)
  2. curve.fi/ypool (flagship and initial vault, despite current low ROI)
  3. curve.fi/busd
  4. curve.fi/sBTC
  5. yETH (remove the WETH vault in the web repository. Logic down below).
  6. yYFI
  7. yDAI
  8. yTUSD
  9. yUSDC
  10. yUSDT
  11. GUSD
  12. aLINK
  13. yLINK (Remove).

WETH: Functionally the WETH and ETH vaults do the same thing. ETH is converted into WETH so that it can be used in the MakerDAO system to mint DAI. For the end-user there is no difference between these two vaults. But for less sophisticated users, it is confusing, why are there two vaults? Some people do not know the difference between WETH and ETH, but they all are aware of the "ETH yVault". Since they both do the same thing, and in an effort to reduce redundancy and clutter. Remove the WETH vault from the web repository. I believe the yETH vault (and web repository) will accept both ETH and WETH, and if a user deposits WETH it doesn't need to wrap it since it is already wrapped.

yLINK: Please remove this vault. There is no ETA on when it will be opened, and people keep asking about it. Remove the vault from the web repository so we stop getting questions. Simiarly as above aLINK and yLINK vaults are functionally the same, if someone wants to deposit LINK they can deposit aLINK into the respective vault.

https://yearn.finance/vaults

wBTC withdrawal not working

When trying to withdraw wBTC from Earn, you cannot do it. I'm trying to withdraw 0.13047559 wBTC.

Steps to reproduce it:

  • Deposit some wBTC
  • Try to withdraw them

This PR was done to fix it but it didn't: #72

The error shown in console is:

index.ts:205 Uncaught (in promise) Error: underflow (fault="underflow", operation="BigNumber.from", value=13039999.999999998, code=NUMERIC_FAULT, version=bignumber/5.0.5)
    at e.value (index.ts:205)
    at e.value (index.ts:217)
    at d (bignumber.ts:314)
    at Function.value (bignumber.ts:218)
    at r.value (number.js:13)
    at array.js:41
    at Array.forEach (<anonymous>)
    at H (array.js:27)
    at r.value (tuple.js:19)
    at e.value (abi-coder.js:82)
    at l.encodeParameters (index.js:140)
    at index.js:531
    at Array.map (<anonymous>)
    at Object.h._encodeMethodABI (index.js:530)
    at Object.h._processExecuteArguments (index.js:858)
    at Object.h._executeMethod (index.js:883)
    at store.jsx:1440
    at c (runtime.js:63)
    at Generator._invoke (runtime.js:293)
    at Generator.next (runtime.js:118)
    at n (asyncToGenerator.js:3)
    at s (asyncToGenerator.js:25)



Typo in homepage

Hi,

There's currently a typo in the homepage interface in yearn.finance, in the hover-over of the vault section; it currently reads as follows:

Vaults follow a unique strategy that are designed to maximize the yield of the deposited asset and minimize risk.

The "are" is misplaced as it ought to refer to strategy. It should either be:

Vaults follow a unique strategy that is designed to maximize...

Or:

Vaults follow unique strategies that are designed to maximize..

Thank you!

Add conventional linting as a pre-commit hook

Currently we execute a GitHub lint action when new code is pushed to prevent invalid commit messages.
We should leverage husky and enforce commit message naming linting as a git pre-commit hook.
This will make the development process easier because commits will fail immediately if the commit message is improperly named, rather than after the commit push is attempted.

Add git pre-commit hook (or similar) to enforce commit message conventions

Suggested commit message requirements:

  1. Every commit message must start with a capital letter
  2. Every commit message should reference a github issue
  3. Every commit message should start with a verb (simple present tense)

Requirements 1 and 2 can be enforced programmatically.
3 we may not be able to enforce.

Suggestion: add aggregated statistics

Currently, only per vault stats are displayed. The community currently doesn't have a single source of truth for useful aggregated stats like TVL. Stats on external sources (e.g. DeFi pulse) are not 100% accurate. Until the yearn API is improved to incorporate aggregated stats, some simple client-side calcs maybe the way to go:

  • Total Holdings
  • Vault Holdings
  • Strategy Holdings (assume this is money that's deployed into the strategies?)
  • Growth Run Rate (e.g. estimated annual yield in % and $ for active strategies)

image

Wallet connection issues

Argent with walletconnect not working, was working a week ago now giving the following error "index.ts:181 Uncaught (in promise) TypeError: this.send is not a function" right after connecting and not working afterwards.

If you're a user please leave you feed back of issues in the format
{wallet used}
{which connection method: (trustwallet / walletconnect ect}
{which os: android, ios, pc, mac}
{error msg, picture if you have one}

Warn Metamask user if he's not on Ethereum mainnet

Currently if you open ygov and your Metamask is set to another network (testnet or custom RPC) it gives the following error:

Screenshot 2020-10-17 at 11 55 24

It's also buggy with yearn.

It would be good to detect if the user is on Ethereum mainnet, if not, show a warning message.

Expanding a vault's dropdown before the vault deposit amount loads causes statistics to show as NaN

Repro:

  1. Open https://yearn.finance/vaults
  2. Immediately click a vault (with which you have a deposit balance) before the deposit balance loads and shows up

Issue:
image
Statistics load with NaN, but Strategy details, APY, and Deposit Balance show up fine.

image

From the console, there seems to be a TypeError in the request to api.yearn.tools.

This only repros if you click a vault and open its drop down before the Deposit Balance and APY load.

Spanish Version of the Platform

We have already translated the whole plataform and are planing to host it in our community portal TodosUnidos.com , we believe that by implementing the plataform we could contribute with the democratization of wealth in our region , we would love very much to be able to give back to in any way posible , we as a software development house will do our best towards adding additional functionalites to the plataform and hope they could also be used by the yearn.finance

Tried to Zap ETH to Dai, got http 400 "Error retrieving trade"

Steps to reproduce

  1. Go to https://iearn.finance/zap

  2. Connect using Metamask

  3. Select "ETH" under "I have", and put in an ETH amount under "Send amount" (e.g 1 ETH).

  4. Click "Trade"

What happens

"Trade" buttons becomes un-clickable after clicking on it (cursor:pointer; disappears) and error appears in console:

request.js:150 GET https://api-v2.dex.ag/trade?from=eth&to=dai&fromAmount=1&dex=best 400
asyncToGenerator.js:6 Uncaught (in promise) 
i {name: "StatusCodeError", statusCode: 400, message: "400 - "{\"error\":\"Error retrieving trade\"}"", error: "{"error":"Error retrieving trade"}", options: {…}, …}
name: "StatusCodeError"
statusCode: 400
message: "400 - "{\"error\":\"Error retrieving trade\"}""
error: "{"error":"Error retrieving trade"}"
options: {uri: "https://api-v2.dex.ag/trade?from=eth&to=dai&fromAmount=1&dex=best", transform: undefined, simple: true, resolveWithFullResponse: false, callback: ƒ, …}
response: t.IncomingMessage {_readableState: b, readable: false, _events: {…}, _eventsCount: 4, _maxListeners: undefined, …}
stack: "StatusCodeError: 400 - "{\"error\":\"Error retrieving trade\"}"↵    at new i (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:3173480)↵    at q.callback (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:3172323)↵    at q.e.callback.t.callback [as _callback] (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:3171371)↵    at q.t._callback.t.callback.t.callback (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:3317790)↵    at q.s.emit (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:230027)↵    at q.<anonymous> (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:3330707)↵    at q.s.emit (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:230027)↵    at t.IncomingMessage.<anonymous> (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:3329527)↵    at Object.f (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:228306)↵    at t.IncomingMessage.s.emit (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:230084)↵    at M (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:905327)↵    at https://iearn.finance/static/js/2.d87191b1.chunk.js:2:613983↵    at p.run (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:132630)↵    at h (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:132124)↵From previous event:↵    at P.L [as _captureStackTrace] (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:3108307)↵    at P._resolveFromExecutor (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:3138103)↵    at new P (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:3131321)↵    at q.init (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:3171213)↵    at q.e.request.Request.init (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:3170546)↵    at new q (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:3316759)↵    at s (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:3175853)↵    at https://iearn.finance/static/js/main.a963f63c.chunk.js:1:275501↵    at u (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:1491434)↵    at Generator._invoke (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:1491187)↵    at Generator.forEach.e.<computed> [as next] (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:1491791)↵    at n (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:115834)↵    at s (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:116037)↵    at https://iearn.finance/static/js/2.d87191b1.chunk.js:2:116096↵    at new Promise (<anonymous>)↵    at e.<anonymous> (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:115977)↵    at e._getDexAgTrade (https://iearn.finance/static/js/main.a963f63c.chunk.js:1:275640)↵    at https://iearn.finance/static/js/main.a963f63c.chunk.js:1:274864↵    at u (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:1491434)↵    at Generator._invoke (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:1491187)↵    at Generator.forEach.e.<computed> [as next] (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:1491791)↵    at n (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:115834)↵    at s (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:116037)↵    at https://iearn.finance/static/js/2.d87191b1.chunk.js:2:116096↵    at new Promise (<anonymous>)↵    at e.<anonymous> (https://iearn.finance/static/js/2.d87191b1.chunk.js:2:115977)↵    at e._callTrade (https://iearn.finance/static/js/main.a963f63c.chunk.js:1:275187)↵    at e.trade (https://iearn.finance/static/js/main.a963f63c.chunk.js:1:274551)"
__stackCleaned__: true
__proto__: Error
constructor: ƒ i(e,t,r,n)
__proto__: Object

Zap submit button does not appear

In Zap page, when you have DAI, the submit button does not appear. You can only make appear when you change the value in the combo box.

Screen Shot 2020-09-18 at 15 02 17

Ledger wallet cannot be connected

Hello,

Using Android Enjin or MetaMask wallet's browser while trying to connect to a Ledger Nano for earning it throw an error message because it seem only expecting users of iearn.finance use Chrome based browser (with U2F).

So for now it seem that any use from an App browser should fail and users have to use Chrome, Firefox or any other browsers having U2F capability to be able to use your services.

IMG_20200229_135903
Screenshot_2020-02-29-17-03-25-349_io metamask

Add prominent UI for deposit disabled vaults

The Chainlink Vault is not scheduled to be re-opened any time soon, if at all. Since it will not be operational it should be removed, as it is causing confusion among end-users. Instead, they can use the aLINK vault.

Action: Remove Chainlink vault from the web repository (yVaults) page.

Total Earnings showing Deposits in the UI instead of earnings from yearn.tools

Here is the yearn vault UI:
image

Notice how Total Earnings is equal to Deposits, which is around 983.36

Here is the result from using yearn.tools on this account:
{ "vaultAddress": "0x5dbcf33d8c2e976c6b560249878e6f1491bca25c", "totalDeposits": "983363199999999999999", "totalWithdrawals": "0", "totalTransferredIn": "0", "totalTransferredOut": "0", "depositedShares": "914167889107499533658", "depositedAmount": "1006254407763697324422", "earnings": "22.89120776369732442298" },

Earnings here is ~22.89120776, not the 983.36 which is shown in the UI.

@antonnell, this line of code seems like it would use the earnings. This change seems like it is deployed, do you know any reason why my earnings on the website would show up differently on the yearn UI vs the yearn.tools API?

yDAI and yCrvBUSD vaults withdraw typically fail due to slippage error

yCrvBUSD seems to use some yVaultCheck contract at https://etherscan.io/address/0xE309978497DfC15bb4F04755005F6410CAdB4103, for withdrawals.

Here is the relevant snippet from store.jsx

{
          id: 'crvBUSD',
          name: 'curve.fi/busd LP',
          symbol: 'crvBUSD',
          description: 'yDAI/yUSDC/yUSDT/yBUSD',
          vaultSymbol: 'ycrvBUSD',
          erc20address: '0x3B3Ac5386837Dc563660FB6a0937DFAa5924333B',
          vaultContractAddress: '0x2994529c0652d127b7842094103715ec5299bbed',
          vaultContractABI: config.vaultContractV3ABI,
          balance: 0,
          vaultBalance: 0,
          decimals: 18,
          deposit: true,
          depositAll: true,
          withdraw: true,
          withdrawAll: true,
          depositDisabled: false,
          lastMeasurement: 10709740,
          measurement: 1e18,
          price_id: 'lp-bcurve',
          yVaultCheckAddress: '0xe309978497dfc15bb4f04755005f6410cadb4103'
       },

If you check the tx history on this yVaultCheck contract, you can see that many withdrawAll calls fail due to slippage errors:
image

Here is one for example:
https://etherscan.io/tx/0x0b50ec3208f9223414ca1c7193ff8afff49ef6b5ed1b0e0ca8742f5867f51518

One user came to Discord unable to withdraw:
image

Eventually we figured out that the TX was going to a contract other than the yCrvBUSD vault:
image
image

Eventually the user was able to withdraw using Etherscan and the yCrvBusd contract directly:
image

Here is their TX on the yCrvBUSD contract that ended up succeeding: https://etherscan.io/tx/0x92997f68db47d4bb8e38d97b3b59c5430e7af7c794e5aaeb557777876c2d4354

It seems like the yVaultCheck contract is faulty at the moment and users who use the yearn.finance to withdraw may not be able to withdraw right now.

What is the purpose of this contract? Why don't we just hook the UI into calling withdraw on the yCrvBUSD contract directly?

Fix mobile error: "this.send(e), 'this.send' is undefined"

I suspect we are seeing this error due to the way we initialize web3.

Currently we dispatch a CONNECTION_CONNECTED event in src/App.js if window.ethereum is available.

    if(window.ethereum) {
      window.ethereum.on('accountsChanged', function (accounts) {
        store.setStore({ account: { address: accounts[0] } })

        const web3context = store.getStore('web3context')
        if(web3context) {
          emitter.emit(CONNECTION_CONNECTED)
        }
      })
    }

We cannot rely on window.ethereum being available upon app initialization. window.ethereum is not immediately available for mobile devices.

We need to follow Metamask's "best practices" guide and add an event listener to listen for ethereum initialization.
If we do this this may resolve some of our mobile issues.

https://docs.metamask.io/guide/mobile-best-practices.html#the-provider-window-ethereum

consider removal of learnyearn.finance links

a link to learnyearn.finance/ currently appears in the "community" section of the yearn.finance footer. this site suffers from several issues, and thus should be considered to be removed from the set of links:

  • the information is stale and there is no way for the community to keep it up to date;

  • it was created by "bluekirby" and prominently features his branding, but he is currently in high disrepute among DeFi participants from a cross-section of communities, including an alleged 'exit scam' involving the sale of potential unregistered securities.

  • it includes inappropriate promotion of YFI's price and investment potential that runs directly counter to Andre Cronje's prior messaging and general community sentiment regarding how YFI should be thought about

Authereum Integration is using Kovan

Now that Authereum is released, the wallet integration should be updated to use the mainnet url. Currently, the url used for auth is kovan.authereum.com. It looks like this should be possible by updating the @web3-react/authereum-connector package to 6.0.8 and configuring it to use mainnet.

Update trezor connect to enable passphrase via device

Both trezor wallet models allow for an optional passphrase. The model T has the advantage that it allows entering the passphrase via the touch screen on the device itself instead of inside the browser.
It seems like we are using trezor connect version 7.0.5 in this repo which does not support typing passphrases on the device but just the browser which is not ideal from a security perspective. It has another disadvantage, which is that the passphrase also needs to be typed in for making a transaction.

I propose updating trezor connect to the latest stable version (https://www.npmjs.com/package/trezor-connect/v/8.1.14) which should resolve both mentioned issues.

Here a comparison of what can be seen in the browser when connecting with a trezor model t and passphrase enabled on yearn.finance (which uses version 7 of trezor connect):
Screen Shot 2020-09-27 at 16 44 30

vs myetherwallet which uses version 8 of trezor connect:
Screen Shot 2020-09-27 at 16 43 22

Add slippage calculations and warning to vaults UI

Some users are experiencing a high amount of slippage when utilizing DAI vault.
Previously we utilized a slippage contract to prevent excessive slippage.
We should calculate slippage on the front-end and display to the user.
We should warn the user if slippage is unreasonably high.

CI build fails with npm build errors

Creating an optimized production build...

Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.

Failed to compile.

./src/stores/store.jsx
Line 1328:26: Expected '!==' and instead saw '!=' eqeqeq
Line 1333:26: Expected '!==' and instead saw '!=' eqeqeq

./src/components/home/home.jsx
Line 212:25: 'location' is assigned a value but never used no-unused-vars

./src/components/apr/apr.jsx
Line 296:20: Expected to return a value in arrow function array-callback-return
Line 316:22: Expected to return a value in arrow function array-callback-return
Line 335:20: Expected to return a value in arrow function array-callback-return
Line 357:20: Expected to return a value in arrow function array-callback-return

./src/components/vault/vault.jsx
Line 727:254: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank

Max Balance Rounding Issue

When attempting to deposit 100% of my DAI balance that has a large float value, the balance is rounded up to the nearest 8th decimal. In my case, I have a balance of 2.438169309543077043 DAI (as taken from Etherscan). When clicking my "balance" or "100%", a value of 2.43816931 (rounded up) is inserted into the earn box. When clicking "Earn", the value box is outlined in red indicating that it is more than my balance.

One potential fix would be to display the rounded value, but store the full balance in a hidden input and used it for the transaction. Right now, the only workaround seems to be to manually round down and deposit less (albeit very slightly less) than 100% of the balance.

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.