Code Monkey home page Code Monkey logo

cryptoetf's Introduction

CryptoETF

DISCLAIMER: This tool neither is, nor should be construed as an offer, solicitation, or recommendation to buy or sell any cryptoassets.

A CLI app, that pulls the cryptocoin balances from your exchanges and displayes your portoflio in comparison to the overall market. A recommendation is shown based on the ideal capitalization-weighted portfolio.

Installation

npm install
npm run build
cp settings.example.json settings.json

Usage

Run the sample: node sample Edit settings.json with your exchange api keys, then: node index

Exchanges

CryptoETF has API integrations with the following exchanges:

With these exchanges, you can easily build yourself your own CryptoETF.

Settings

The tool expects your settings in settings.json. Take a look at settings.example.json for a starting point.

  • accounts: Under accounts, fill in your api credentials for the exchange that you want to use. Delete the exchanges that you do not need.
  • symbolMapping: Some exchanges use different symbols that coinmarketcap.com. Hence here you can map the symbols, e.g.: map MIOTA to IOTA.
  • otherHoldings: A place to manually add some of your holdings. Notation is key: Symbol, value is amount of native currency.
  • allocations: Here you can manually define allocations of coins. The allocations is calculated from the amount of points it gets relative to the total amount of points. Filling in 66.67 and 33.33 for two currencies will yield the same result as 6 and 3 for example. If allocations is not mentioned in settings.json the allocations will reflect the coin's market cap relative to the other coins in the portfolio.
  • options: These are specific options for the tool:
    • targetValueUsd: The target value for your ETF; A general rule of thumb is to keep your crypto at a certain percentage of your overall investment portfolio. This could be 5, 10, 20 or more percent, depending on your risk tolerance.
      • Default [false]: Use current portfolio value as target value.
      • Number [1 - 999999999999]: Use fixed number as target value.
    • rebalanceDeltaTotalPct: Treshold in percent, that will show a Y in the rebalance column, once rebalancing of total portfolio is recommended.
    • rebalanceDeltaPct: Treshold in percent, that will show a Y in the rebalance column, once rebalancing of individual position is recommended.
    • minValueBtc: Ignore coins that only have a holdingsvalue under a certain bitcoin value.
    • exchangeMinValueBtc: Don't list exchanges in the exchanges column, with less than the specified BTC value. The complete holding value will still be added in the total sum.
    • hideMissingCoins: By default CryptoETF will add all missing coins up to your last coin holding by rank of the coin (global market cap). This option disables that behaviour.
  • outputFile: Path to a file to forward the output to as json.

Test

  • npm test To run all the unit tests, without the integrations, which require api keys.
  • npm testLocal To run all the unit tests, with the integrations, which require you to set all api keys in settings.json.

Contributing

Please send PR's to the develop branch!

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request to the develop branch :D

Releasing

git checkout develop
git flow release start "1.6.2"
git rebase master
npm run test
npm --no-git-tag-version version 1.6.2
git flow release finish "1.6.2"
git push
git checkout master && git push && git push --tags

License

See LICENSE.md

Donate

  • BTC: 1jzYq6yo4MCZnjsGFahhV8ZQd7TwLeCL6
  • ETH: 0xfE131Eb3dc3E0476d7eD26134A4A17Cc253C1689
  • LTC: LUVz63UPLqsQG5LHD3zgnaHGts7bm4Yxm8

cryptoetf's People

Contributors

barryvdh avatar benmarten avatar createthis avatar gosuto-inzasheru avatar rtlsilva avatar terox 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cryptoetf's Issues

Coins with 0 value are displayed despite having set minValueBtc

If I understand correctly, setting minValueBtc makes CryptoETF ignore coins which have a value under a certain threshold. Good for ignoring dust or coins with zero balance. Much like the "Hide 0 Balances" option on Poloniex' balance page.

However, I am doubting whether minValueBtc is doing what it says it does. The only time it is checked (as far as I can tell) is by updateHighestRankWithBalance(). This means that despite having minValueBtc set, coins with a value below minValueBtc are still displayed.

coinmarketcap API broken

Personal APIs are now required for coinmarketcap so the code should be modified to allow the use personal APIs in coinmarketcap so that the rest of the code can be up to date.

Async loading of portfolio

Right now, you're using await for each integration (and coinmarket), wouldn't it be better to run all the integrations async, and wait for all of them to finish?

Issue with colors

TypeError: Cannot read property 'italic' of undefined at Coin.getExchangesString (CryptoETF/dist/model/Coin.js:156:61)

BCH data from Coinbase showing incorrect balance

BCH is off by about 1 BCH.
All the other values it pulled in appear to be accurate, regardless of exchange.
Still throws off all the allocation %'s though :\

From CryptoETF:
screen shot 2018-01-07 at 10 37 29 pm

Actual:
screen shot 2018-01-07 at 10 37 41 pm

Can't isolate why this is the case only for BCH...any ideas?

Ability to set allocation target manually

It would be a great addition if it were possible to setting the target allocation percentage per coin manually (through an array in settings.json maybe) instead of deriving it from the market share.

Contributing & Releases ;)

Hi @barryvdh! I saw you pushed some commits directly to master. Unfortunately I had to revert them, pushing a new release...

I generally follow the git flow practice for this repo. Hence all new commit should go to the develop branch first. Then for a new release I follow this: https://github.com/benmarten/CryptoETF/blob/develop/README.md#releasing

This will create nice tags, and once the commit messages are in the conventional changeling style (https://www.npmjs.com/package/conventional-changelog-cli), they will show up nicely in the CHANGELOG: https://github.com/benmarten/CryptoETF/blob/master/CHANGELOG.md done via: https://github.com/benmarten/CryptoETF/blob/master/package.json#L30

So please feel free to commit your fixes again to develop. Unfortunately I lost them, after I realized they were in master.... Sorry about that ;)

Feature Request: Track balance/price by public address

Some of us don't like to keep our coins on exchanges as they have a history of being hacked.

It would be cool to be able to track the balance/price of paper wallets and application wallets by address.

Many coins have block websites with public APIs that we can use to fetch the balance by address. For example, Ethereum has: https://etherscan.io/apis#accounts

And bitcoin has: https://blockchain.info/api/blockchain_api

This would be a convenient feature for miners and security conscious HODLers alike.

Support for fiat currencies

On some of the exchanges supported we are also able to hold fiat currencies. I think it would be a nice addition to see these fiat currencies in the portfolio too. They wouldn't participate in the market allocation obviously but as an alternative to targetValueUsd we could set a targetValuePerc relative to the total portfolio's value.

Consider formally separating API from frontend

I've been looking today for a general purpose JS library that would allow me to:

  1. Grab coin market price in USD (or any other currency) from various exchanges via API
  2. Grab coin balance by address (see #19 )

CryptoETF looks like it has functionality to achieve the first goal already. However, it has been packaged with a CLI frontend. It seems like it may reach a wider audience if the Node library API was moved into a separate project and documented.

This would allow reuse in more than one frontend. React web frontends, for example.

node index error

API keys are entered:

TypeError: Cannot read property 'reduce' of undefined
at Function.forEachPromise (CryptoETF-master/dist/PromiseUtils.js:26:20)
at Function.getBalance (CryptoETF-master/dist/model/CoinbaseWallet.js:34:36)
at CryptoETF-master/dist/index.js:32:58
at
Error getting data, retrying..

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.