From f47a63f2d35b56c4156880d2e76a2862a02406c4 Mon Sep 17 00:00:00 2001 From: Jorijn Smit Date: Tue, 23 Jan 2018 00:23:06 +0700 Subject: [PATCH 1/2] feat(strategy): allow for manual allocation recommendation (#41) --- README.md | 1 + settings.example.json | 11 +++++++++-- src/model/Coin.js | 12 ++++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 229dd77..fd23ae4 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ The tool expects your settings in settings.json. Take a look at settings.example - *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. diff --git a/settings.example.json b/settings.example.json index 06a1147..55fce0f 100644 --- a/settings.example.json +++ b/settings.example.json @@ -49,19 +49,26 @@ }] }, "symbolNameMapping": { - "Bitgem": "BITG" + "Remicoin": "REMI", + "KingN Coin": "KINGN", + "ENTCash": "ENTCASH" }, "symbolMapping": { "USD": "USDT", "STR": "XLM", "IOTA": "MIOTA", - "XBT": "BTC" + "XBT": "BTC", + "XDG": "DOGE" }, "otherHoldings": [{ "BCH": 1.0 }, { "BTG": 1.0 }], + "allocations": { + "BTC": 66, + "ETH": 33 + }, "options": { "targetValueUsd": false, "rebalanceDeltaPct": 1.0, diff --git a/src/model/Coin.js b/src/model/Coin.js index f19fd0a..c8f1221 100644 --- a/src/model/Coin.js +++ b/src/model/Coin.js @@ -60,7 +60,15 @@ export default class Coin { } getRelativeMarketCapRecommended() { - return Coinmarket.getRelativeMarketCapForX(this.symbol) + if (Settings.hasOwnProperty('allocations')) { + if (Settings.allocations.hasOwnProperty(this.symbol)) { + return Settings.allocations[this.symbol] + } else { + return 0 + } + } else { + return Coinmarket.getRelativeMarketCapForX(this.symbol) + } } getAllocationDeltaPct() { @@ -114,4 +122,4 @@ export default class Coin { return (result.charAt(result.length - 1) === ',') ? result.slice(0, -1) : result } -} \ No newline at end of file +} From 05352c4074cf4c741e012829fa73b75c5996b5b2 Mon Sep 17 00:00:00 2001 From: Ben Marten Date: Mon, 22 Jan 2018 09:25:55 -0800 Subject: [PATCH 2/2] CryptoETF 1.8.0 --- CHANGELOG.md | 10 ++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a73b8d..9b8dc39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ + +# [1.8.0](https://github.com/benmarten/CryptoETF/compare/1.7.0...1.8.0) (2018-01-22) + + +### Features + +* **strategy:** allow for manual allocation recommendation ([#41](https://github.com/benmarten/CryptoETF/issues/41)) ([f47a63f](https://github.com/benmarten/CryptoETF/commit/f47a63f)) + + + # [1.7.0](https://github.com/benmarten/CryptoETF/compare/1.6.2...1.7.0) (2018-01-22) diff --git a/package-lock.json b/package-lock.json index b5cabcc..875af27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5402,5 +5402,5 @@ "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" } }, - "version": "1.7.0" + "version": "1.8.0" } diff --git a/package.json b/package.json index 1525ba7..81359dd 100644 --- a/package.json +++ b/package.json @@ -32,5 +32,5 @@ "testLocal": "./node_modules/.bin/nyc mocha --require babel-core/register test/**/*.js test/**/**/*.js", "test": "NODE_ENV=test npm run testLocal" }, - "version": "1.7.0" + "version": "1.8.0" }