yearn / yearn-api-archived

Collection of serverless API
23 stars 24 forks source link

Add GUSD to APY API #23

Open ghost opened 3 years ago

ghost commented 3 years ago

Until #12 is resolved we need to manually add new vaults to the APY API.

I quickly tried adding GUSD to the API by adding the following to vaults.json:

  {
    id: "GUSD",
    name: "Gemini Dollar",
    symbol: "GUSD",
    description: "Gemini Dollar",
    vaultSymbol: "yGUSD",
    erc20address: "0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd",
    vaultContractAddress: "0xec0d8D3ED5477106c6D4ea27D90a60e594693C90",
    vaultContractABI: config.vaultContractV3ABI,
    balance: 0,
    vaultBalance: 0,
    decimals: 2,
    deposit: true,
    depositAll: true,
    withdraw: true,
    withdrawAll: true,
    lastMeasurement: 11065128,
    measurement: 1e18,
    price_id: "gemini-dollar",
  },

When I do this I receive the following error:

Reading vault Gemini Dollar
Error: Returned error: No response or no available upstream for eth_call
    at Object.ErrorResponse (/Users/x48/src/yearn-api/node_modules/web3-core-helpers/lib/errors.js:28:19)
    at /Users/x48/src/yearn-api/node_modules/web3-core-requestmanager/lib/index.js:288:36
    at XMLHttpRequest.request.onreadystatechange (/Users/x48/src/yearn-api/node_modules/web3-providers-http/lib/index.js:98:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/Users/x48/src/yearn-api/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
    at XMLHttpRequest._setReadyState (/Users/x48/src/yearn-api/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
    at XMLHttpRequest._onHttpResponseEnd (/Users/x48/src/yearn-api/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14)
    at IncomingMessage.<anonymous> (/Users/x48/src/yearn-api/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61)
    at IncomingMessage.emit (events.js:327:22)
    at IncomingMessage.EventEmitter.emit (domain.js:482:12)
    at endReadableNT (_stream_readable.js:1221:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  data: null
}

We need to get to the bottom of this and also make this API a bit more reliable (ideally by fixing #12).