npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

crypto-index-fund

v1.0.0

Published

I was curious if I could build a crypto fund for myself. And it looks like I can. Currently, 80% of the ex-stablecoin crypto market consists of 21 cryptocurrencies. There's few enough that makes it possible for one person to buy some in each. Alternativel

Downloads

2

Readme

crypto-index-fund

I was curious if I could build a crypto fund for myself. And it looks like I can. Currently, 80% of the ex-stablecoin crypto market consists of 21 cryptocurrencies. There's few enough that makes it possible for one person to buy some in each. Alternatively, one could pick the top 10 crypto currencies, which would make the allocation possible with fewer funds.

example allocation

This repository contains a CLI tool for building your own crypto fund. It supports the following strategies:

  • Market Dominance Top 10 Coins ex-Stablecoin
  • Market Dominance 80% ex-Stablecoin

Happy to add other allocation types as well.

If you want to stay up to date with announcements please consider following me on twitter.

Installation

Clone the repository and cd into it.

$ git clone https://github.com/doodzik/crypto-index-fund
$ cd $_

Usage

Before getting started make sure to set the COINMARKET_API_KEY env variable. You can get the key here.

$ export COINMARKET_API_KEY="xxx-xxx-xxx-xxx"

When you are in the repository execute the following command.

$ node ./src/crypto-index-fund.js

The output will be something like this:

{
  dominance: '80.30%',
  meta: { thresholdDominance: 80, strategyID: 'TOP_80_PERCENT_DOMINANCE' },
  entriesCount: 23,
  entries: [
    {
      dominance: '40.62%',
      symbol: 'BTC',
      name: 'Bitcoin',
      baseCurrency: 'USD',
      price: '$41,938.87',
      distribution: '50.72%',
      amountBaseCurrency: '$11,809.92',
      amount: '₿0.281598431240517422',
      currentHolding: '₿0.534809920691298957',
      changeNominal: '-₿0.253211489450781535',
      changeBaseCurrency: '-$10,619.40'
    },
    // etc...
  ]
}

Flags

--strategy=STRING

specify the strategy to allocate funds defaults to TOP_10_COINS

strategies:

  • TOP_10_COINS: selects the top 10 coins weighted by market dominance
  • TOP_80_PERCENT_DOMINANCE: selects the coins constituting 80% of the market dominance

--funds=DECIMAL

specify funds to allocate to the fund defaults to 1000.0

--currency=STRING

base currency for all conversions defaults to USD

--holdings=PATH

add a path to a holdings file in the format that can be seen in test/holdings.json file. Defaults to empty

--cache=PATH

takes a path to the marketplace API response data defaults to false

--no-colors/--colors

Will the output of the output have color encoding defaults to colors true

Testing

$ npm test

Potential Improvements

Disclaimer

The information provided in this repository does not constitute investment advice, financial advice, trading advice, or any other sort of advice and you should not treat any of the repository's content as such. I do not recommend that any cryptocurrency should be bought, sold, or held by you. Do conduct your own due diligence and consult your financial advisor before making any investment decisions.

The data in this repository is provided by CoinMarketCap and I don't take any responsibility for any missing or wrong information. CoinMarketCap provides all information as is. You understand that you are using any and all information available here at your own risk.

Hyperlinks in this repository do not constitute an endorsement, guarantee, warranty, or recommendation by me. Do conduct your own due diligence before deciding to use any third party services.

License

Copyright (c) The year when you are reading this | Frederik Dudzik

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.