From 359d0211ca389503494e3bab8448981fe18a4460 Mon Sep 17 00:00:00 2001 From: coltoneshaw Date: Fri, 30 Jul 2021 12:19:41 -0400 Subject: [PATCH] fixed bankroll calculations, improved readability of the formulas - position already included on_orders, fixed this across the app. - added additional global values under metrics for total bank, available bank, and in orders to prevent calculating on the component level. - reworded some items to be a bit cleaner. - activeSum now is totalBoughtVolume - added formulas and known issues --- .gitignore | 3 +- CHANGELOG.md | 26 ++++++++++ FORMULA_DESCRIPTIONS.md | 21 ++++++++ KNOWNISSUES.md | 6 +++ src/Components/Charts/Bar/SoDistribution.js | 2 +- src/Components/Charts/Pie/BalancePie.js | 13 ++--- src/Components/Pages/BotManager/BotManager.js | 2 +- src/Components/Pages/BotManager/Risk.js | 8 +-- .../Settings/StatSettings/AccountDropdown.js | 52 +++++++++++++------ src/Components/Pages/Stats/Stats.js | 8 +-- .../Pages/Stats/Views/RiskMonitor.js | 8 +-- src/Components/Sidebar/Sidebar.js | 4 +- src/Context/DataContext.js | 42 +++++++++++---- src/index.html | 2 +- src/utils/3Commas.js | 6 +-- 15 files changed, 147 insertions(+), 56 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 FORMULA_DESCRIPTIONS.md create mode 100644 KNOWNISSUES.md diff --git a/.gitignore b/.gitignore index b6084d6c..fc0a8cf7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules/ node/ /node_modules src/main-app.js -dist/* \ No newline at end of file +dist/* +/src/main-app.js \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..d9071eb1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,26 @@ +v0.0.2-RC1 + +- Fixed issue where the data table hid the overflow and prevented scrolling. Will need further improvements for responsiveness. +- Added alerts when making changes to the settings page to inform you of a needed refresh +- Alternating colors on the data table +- try/catch block to the data functions so it properly changes the state of the spinner +- conditional routing rules based on if API keys are set up or not. +- Spinning icons when the data is updating. +- Added a rough description of API key perms needed to the settings page +- Increased pie chart size (praise), added formatting to the tooltips +- fixed application height issues +- settings button height, and scrolling on that page. + +v0.0.1-RC1 +- added spinner to the update data icons +- added description of API keys +- modified the chart to show thousands +- application height issues resolved +- settings button height has been updated + +v0.0.1 +- implemented and tested the mac dmg installer +- moved files from public into the src +- moved asset files around +- fixed a bug in the lenght of the name array for filters causing an error +- added columns to the bots table \ No newline at end of file diff --git a/FORMULA_DESCRIPTIONS.md b/FORMULA_DESCRIPTIONS.md new file mode 100644 index 00000000..6871fbf7 --- /dev/null +++ b/FORMULA_DESCRIPTIONS.md @@ -0,0 +1,21 @@ +## Bank Roll Calculations + +### Total Bankroll +Formula: +`Total Bankroll = Position ( Funds in that currency ) + funds currently in deals` + +Additional information: + - What is in position? + - Position is a sum of what you have in active deals + what you have in available funds. This + - Why doesn't it match exactly to my crypto account? + - Your crypto account also takes into account any coins that you hold that are not a part of your DCA bots. For example, if you've made a smart trade, holding coins, etc. + - Additionally, the data from your crypto account to 3Commas is not always up to date, there may be slight variances in the numbers. But you should see within 1-4% the number is right. + +### Bankroll Available: +Formula: +` ( 1 - ( ( funds currently in deals ) / ( Total Bankroll )) ) * 100 = remaining bankroll percent` + + +Additional information: + - This takes into account all the bankroll you have for the selected currency and gives the percent remaining after you remove what's on an order plus funds in a deal. + - This is calculated within the `calculateMetrics` inside `DataContext.js` diff --git a/KNOWNISSUES.md b/KNOWNISSUES.md new file mode 100644 index 00000000..bc9d8bb0 --- /dev/null +++ b/KNOWNISSUES.md @@ -0,0 +1,6 @@ + +- when you save config settings it does not auto start to sync. You have to manually start it. +- scroll bars on the bot manager table can be weird. Resize to a bigger window for now. +- dark mode isn't built yet, but the button is there +- the Trading View tab may require a refresh to show. Somethign is weird with that +- active deals on stats is just a blank page, you're not crazy \ No newline at end of file diff --git a/src/Components/Charts/Bar/SoDistribution.js b/src/Components/Charts/Bar/SoDistribution.js index e6b0b319..9d84efd9 100644 --- a/src/Components/Charts/Bar/SoDistribution.js +++ b/src/Components/Charts/Bar/SoDistribution.js @@ -37,7 +37,7 @@ export default class SoDistribution extends PureComponent { const MaxSO = Math.max( ...data.map( deal => deal.completed_safety_orders_count )) const soNumbers = Array.from(Array(MaxSO + 1).keys()) const totalDeals = data.length - const totalDealFunds = metrics.activeSum + const totalDealFunds = metrics.totalBoughtVolume dataArray = soNumbers.map(SO => { let matchingDeals = data.filter( deal => deal.completed_safety_orders_count === SO) diff --git a/src/Components/Charts/Pie/BalancePie.js b/src/Components/Charts/Pie/BalancePie.js index 5fa428b0..cd369953 100644 --- a/src/Components/Charts/Pie/BalancePie.js +++ b/src/Components/Charts/Pie/BalancePie.js @@ -13,20 +13,21 @@ class BalancePie extends PureComponent { render() { const { title, balance, metrics } = this.props - console.log(metrics) + + const { availableBankroll, position, totalBoughtVolume, on_orders } = metrics const chartData = [{ name: 'Available', - metric: parseInt(balance.position - balance.on_orders), + metric: parseInt( availableBankroll ), key: 1 }, { - name: 'On Orders', - metric: parseInt(balance.on_orders), + name: 'Limit Orders', + metric: parseInt( on_orders ), key: 2 }, { - name: "In Deals", - metric: parseInt(metrics.activeSum), + name: "Purchased", + metric: parseInt(totalBoughtVolume), key: 3 } diff --git a/src/Components/Pages/BotManager/BotManager.js b/src/Components/Pages/BotManager/BotManager.js index d1147453..d7785a49 100644 --- a/src/Components/Pages/BotManager/BotManager.js +++ b/src/Components/Pages/BotManager/BotManager.js @@ -98,7 +98,7 @@ const BotManagerPage = (props) => { return ( <> -

Bot Manager

+

Bot Planner

- return + return }) } @@ -135,9 +135,9 @@ const StatsPage = () => {
- + - +
diff --git a/src/Components/Pages/Stats/Views/RiskMonitor.js b/src/Components/Pages/Stats/Views/RiskMonitor.js index 56e906e9..9da45329 100644 --- a/src/Components/Pages/Stats/Views/RiskMonitor.js +++ b/src/Components/Pages/Stats/Views/RiskMonitor.js @@ -17,12 +17,8 @@ const RiskMonitor = () => { return ( <> diff --git a/src/Components/Sidebar/Sidebar.js b/src/Components/Sidebar/Sidebar.js index f4455f40..83a27884 100644 --- a/src/Components/Sidebar/Sidebar.js +++ b/src/Components/Sidebar/Sidebar.js @@ -19,9 +19,9 @@ class Sidebar extends Component { return (