Giter Club home page Giter Club logo

defi-pulse-adapters's People

Contributors

alirun avatar andremiras avatar arintrongs avatar arman37 avatar b1u3h4t avatar christoph-luescher avatar dumebi avatar gregfrasco avatar haythemsellami avatar iherger avatar jeremyhd avatar mayorcoded avatar mitche50 avatar mpilkey avatar mrdavey avatar nedodn avatar noahzinsmeister avatar pemulis avatar penandlim avatar pengiundev avatar rajivpo avatar razgraf avatar ruffrey avatar shaneahern avatar silagepete avatar skyge avatar thiagomva avatar tonoyandev avatar xcellsior avatar yudilevi 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  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

defi-pulse-adapters's Issues

validate script failure

The validate script fails due to the category of some projects not matching the categories[] expected by the test.

There's also the misspelled 'categoy' but i'll open a pull for that.


./testing/validate/export.js

  const categories = [
    'derivatives',
    'dexes',
    'lending',
    'payments',
    'assets'
  ]
...
it('categoy matches one of the defined options', () => {
        chai.expect(project.category).to.be.oneOf(categories);
});
...
  • connext uses 'Lending'
  • curve uses 'DEXes'
  • dydx uses 'Lending'
  • kyber uses 'DEXes'

The confusion is being created due to the _template project having a comment mentioning the incorrect values.

./projects/template/index.js

module.exports = {
...
 category: 'assets'  // allowed values as shown on DefiPulse: 'Derivatives', 'DEXes', 'Lending', 'Payments', 'Assets'
...
  }

Settle on either package-lock.json or yarn.lock

Description

Having a package-lock.json and a yarn.lock file at the same time is not recommended:

We highly recommend you to delete the package-lock.json file if you decide to use yarn in order to avoid future confusion and possible consistency issues.

Solution

Delete either the package-lock.json or the yarn.lock file.

npm run test -- --project=_someProjectName fails because of run.js

Tests fail at npm run test due to run.js's: output = (await sdk.api.util.unwrap({balances: output, block: point.block})).output;

async function Run(runFunction, project, timeUnit = 'day', timeOffset = 0) {
    try {
      let timestamp;

      if(typeof timeUnit == 'number') {
        timestamp = timeUnit;
      } else {
        timestamp = moment().utcOffset(0).startOf(timeUnit).add(timeOffset, timeUnit).unix();
      }

      let point = await sdk.api.util.lookupBlock(timestamp);

      await sdk.api.util.resetEthCallCount();
      let output = await project[runFunction](point.timestamp, point.block);
      console.log('RUN before', output) // <----- this returns the normal expected data shape: { [tokenAddress: string]: BalanceAsString }
      if(runFunction == 'tvl') {
        output = (await sdk.api.util.toSymbols(output)).output;
        output = (await sdk.api.util.unwrap({balances: output, block: point.block})).output;
      }
      console.log('RUN after', output)
      let ethCallCount = await sdk.api.util.getEthCallCount();

      return {
        ...ethCallCount,
        ...point,
        output
      }

    } catch(error) {
      console.log(error);
    }
  }

the console log console.log('RUN after', output) returns:

RUN after {
  ETH: { balance: '2220.846437', id: 1027 },
  USDT: { balance: '605155.984481', id: 825 },
  TUSD: { balance: '10006.044458', id: 2563 },
  USDC: { balance: '3101071.305708', id: 3408 },
  PAX: { balance: '5093.068189', id: 3330 },
  GUSD: { balance: '142.37', id: 3306 },
...
}

which breaks inside test-run.js here:

_.each(projectRun.output, (value, symbol) => {
            let balance = BigNumber(value).toNumber();   // <----- "value" here is the object above e.g { balance: '2220', id: 1000 } 
            console.log(symbol, balance, value)
...

Obviously this fails as BigNumber({ balance: '2220.846437', id: 1027 }) breaks.
Btw, the log above console.log(RUN before, output) returns data as expected:
{
[tokenAddress: string]: string
}

Any ideas?
ok it's the unwrap function:
output = (await sdk.api.util.unwrap({balances: output, block: point.block})).output;

Which returns the object for each token symbol

Discrepancy between DeFi Pulse and btconethereum.com

There seems to be a significant discrepancy between DeFi Pulse and btconethereum.com regarding the number of BTC on Ethereum. DeFi Pulse is consistently reporting a larger amount.

Right now DeFi Pulse reports 109K BTC, of which all are on Ethereum expect for 1.1K BTC on the Lightning Network. That's a total 107.9K BTC on Ethereum. However, btconethereum.com reports 100.8K BTC. Where does the 7.1K BTC discrepancy come from?

Because btconethereum.com pulls its data straight off the smart contracts' totalSupply functions my best guess is that DeFi Pulse has a double-counting bug.

(Apologies if this is the wrong place to submit this issue.)

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.