kraken-grid 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/.dist/ginit.js +39 -0
  2. package/.dist/init.js +38 -0
  3. package/.dist/jest.config.js +240 -0
  4. package/.eslintrc.json +90 -0
  5. package/.vscode/launch.json +8 -5
  6. package/.vscode/tasks.json +21 -0
  7. package/.~lock.capGains.ods# +1 -0
  8. package/README.md +65 -57
  9. package/TFCtest/APCache.json +762 -0
  10. package/TFCtest/BTCHist60.json +7208 -0
  11. package/TFCtest/Hidden/APG2K.json +15729 -0
  12. package/TFCtest/Hidden/GCOCache.json +190 -0
  13. package/TFCtest/Hidden/blockFile.json +8 -0
  14. package/TFCtest/Hidden/callCache.json +132565 -0
  15. package/TFCtest/Hidden/h1462911737.json +1 -0
  16. package/TFCtest/Hidden/lastFile.txt +1 -0
  17. package/TFCtest/callCache.json +29150 -0
  18. package/allocation.ts +674 -0
  19. package/balancer.ts +140 -0
  20. package/{bot.js → bot.ts} +395 -244
  21. package/capGains.csv +552 -0
  22. package/capGains.ods +0 -0
  23. package/cardsLog.txt +482 -0
  24. package/ginit.ts +39 -0
  25. package/init.js.NOT +38 -0
  26. package/init.ts +36 -0
  27. package/jest.config.js +43 -0
  28. package/{jest.config.mjs → jest.config.ts.not} +58 -6
  29. package/jsconfig.json +3 -0
  30. package/krak2gem.ts +807 -0
  31. package/kraken-grid.code-workspace +18 -0
  32. package/{manager.js → manager.ts} +515 -466
  33. package/package.json +47 -10
  34. package/reports.ts +320 -0
  35. package/safestore.ts +145 -0
  36. package/savings.ts +315 -0
  37. package/static/zec.png +0 -0
  38. package/test/51A.json +7629 -0
  39. package/test/51B.json +7750 -0
  40. package/test/51C.json +7750 -0
  41. package/test/8open.json +9 -1
  42. package/test/APCache.json +762 -0
  43. package/test/NACache.json +7577 -0
  44. package/test/NotesOnTesting.txt +7 -4
  45. package/test/ReadMe.md +9 -0
  46. package/test/balCache.json +374 -0
  47. package/test/cached.json +7581 -0
  48. package/test/co474.json +7707 -0
  49. package/test/customExpect.ts +29 -0
  50. package/test/customReporter.mjs +14 -0
  51. package/test/gem.test.ts +217 -0
  52. package/test/gemCache.json +2352 -0
  53. package/test/krakCache.json +375 -0
  54. package/test/kraken.test.ts +366 -0
  55. package/test/mock-example.test.ts +54 -0
  56. package/test/testEnvironment.mjs +13 -0
  57. package/testFasterCache.ts +253 -0
  58. package/tsconfig.json +42 -0
  59. package/web.ts +263 -0
  60. package/websocket.ts +35 -0
  61. package/xxbtBuys.json +4 -0
  62. package/.eslintrc +0 -32
  63. package/JestTesting/logAlot.js +0 -27
  64. package/JestTesting/testSpy.js +0 -9
  65. package/allocation.js +0 -583
  66. package/ava.config.js +0 -3
  67. package/balancer.js +0 -124
  68. package/coverage/clover.xml +0 -3452
  69. package/coverage/coverage-final.json +0 -12
  70. package/coverage/lcov-report/allocation.js.html +0 -1825
  71. package/coverage/lcov-report/balancer.js.html +0 -454
  72. package/coverage/lcov-report/base.css +0 -224
  73. package/coverage/lcov-report/block-navigation.js +0 -87
  74. package/coverage/lcov-report/bot.js.html +0 -3868
  75. package/coverage/lcov-report/favicon.png +0 -0
  76. package/coverage/lcov-report/index.html +0 -131
  77. package/coverage/lcov-report/init.js.html +0 -205
  78. package/coverage/lcov-report/kraken-grid/allocation.js.html +0 -1831
  79. package/coverage/lcov-report/kraken-grid/balancer.js.html +0 -454
  80. package/coverage/lcov-report/kraken-grid/bot.js.html +0 -3868
  81. package/coverage/lcov-report/kraken-grid/index.html +0 -251
  82. package/coverage/lcov-report/kraken-grid/init.js.html +0 -223
  83. package/coverage/lcov-report/kraken-grid/manager.js.html +0 -1483
  84. package/coverage/lcov-report/kraken-grid/pricers/index.html +0 -116
  85. package/coverage/lcov-report/kraken-grid/pricers/openex.js.html +0 -205
  86. package/coverage/lcov-report/kraken-grid/reports.js.html +0 -487
  87. package/coverage/lcov-report/kraken-grid/safestore.js.html +0 -433
  88. package/coverage/lcov-report/kraken-grid/savings.js.html +0 -754
  89. package/coverage/lcov-report/kraken-grid/testFasterCache.js.html +0 -661
  90. package/coverage/lcov-report/kraken-grid/web.js.html +0 -736
  91. package/coverage/lcov-report/manager.js.html +0 -1504
  92. package/coverage/lcov-report/prettify.css +0 -1
  93. package/coverage/lcov-report/prettify.js +0 -2
  94. package/coverage/lcov-report/reports.js.html +0 -475
  95. package/coverage/lcov-report/safestore.js.html +0 -433
  96. package/coverage/lcov-report/savings.js.html +0 -745
  97. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  98. package/coverage/lcov-report/sorter.js +0 -196
  99. package/coverage/lcov-report/testFasterCache.js.html +0 -661
  100. package/coverage/lcov-report/web.js.html +0 -724
  101. package/coverage/lcov.info +0 -4303
  102. package/exchange.js +0 -4
  103. package/gemini.js +0 -212
  104. package/ginit.js +0 -19
  105. package/init.js +0 -47
  106. package/krak2gem.js +0 -301
  107. package/pricers/openex.js +0 -41
  108. package/reports.js +0 -135
  109. package/safestore.js +0 -116
  110. package/savings.js +0 -223
  111. package/static/client.js +0 -520
  112. package/static/gallocation.js +0 -90
  113. package/static/imgByKtick.js +0 -288
  114. package/static/md-block.js +0 -301
  115. package/test/shared.js +0 -1
  116. package/test/test.js +0 -246
  117. package/testFasterCache.js +0 -192
  118. package/tt.js +0 -12
  119. package/web.js +0 -217
package/.dist/ginit.js ADDED
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ /* eslint-disable import/extensions */
3
+ import ClientCon from './krak2gem.js';
4
+ import Manager from './manager.js';
5
+ import Bot from './bot.js';
6
+ import { AllocCon } from './allocation.js';
7
+ import Savings from './savings.js';
8
+ import Balancer from './balancer.js';
9
+ import Web from './web.js';
10
+ process.on('unhandledRejection', (e) => { debugger; });
11
+ export default async function init(initMan = true) {
12
+ process.TESTING = process.TESTING || !(/ginit.js$|gemini-grid$/.test(process.argv[1]));
13
+ if (process.argv.length > 2)
14
+ [, , process.TESTING] = process.argv;
15
+ switch (typeof process.TESTING) {
16
+ case 'string': if (process.TESTING.toLowerCase() === 'cacheonly') {
17
+ if (process.argv.length > 3)
18
+ [, , , process.TESTING] = process.argv;
19
+ process.USECACHE = 'G';
20
+ }
21
+ }
22
+ console.log(`filename is ${process.argv[1]} in ${process.TESTING
23
+ ? `test(${process.TESTING})`
24
+ : 'production'} mode.`);
25
+ const allConfig = { AllocCon, Savings, Balancer, Web, ClientCon };
26
+ // The three following constructors assign their return
27
+ // values to allConfig.[man, bot, web].
28
+ Bot(allConfig);
29
+ Manager(allConfig);
30
+ if (process.TESTING)
31
+ global.kgPassword = "TestPWG";
32
+ if (initMan)
33
+ await allConfig.man.init(global.kgPassword);
34
+ // allConfig.gemWS = GemSock(allConfig);
35
+ return allConfig;
36
+ }
37
+ if (/ginit.js$|kraken-grid$/.test(process.argv[1]))
38
+ init();
39
+ //# sourceMappingURL=ginit.js.map
package/.dist/init.js ADDED
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+ /* eslint-disable import/extensions */
3
+ import ClientCon from 'kraka-djs';
4
+ import Manager from './manager.js';
5
+ import Bot from './bot.js';
6
+ import { AllocCon } from './allocation.js';
7
+ import Savings from './savings.js';
8
+ import Balancer from './balancer.js';
9
+ import Web from './web.js';
10
+ export default async function init(initMan = true) {
11
+ process.TESTING = process.TESTING || !(/init.js$|kraken-grid$/.test(process.argv[1]));
12
+ if (process.argv.length > 2)
13
+ [, , process.TESTING] = process.argv;
14
+ if (typeof process.TESTING === 'string') {
15
+ if (process.TESTING.toLowerCase() === 'cacheonly') {
16
+ if (process.argv.length > 3)
17
+ [, , , process.TESTING] = process.argv;
18
+ process.USECACHE = 'must';
19
+ }
20
+ }
21
+ // eslint-disable-next-line no-console
22
+ console.log(`filename is ${process.argv[1]} in ${process.TESTING
23
+ ? `test(${process.TESTING})`
24
+ : 'production'} mode.`);
25
+ const allConfig = { AllocCon, Savings, Balancer, Web, ClientCon };
26
+ // The two following constructors assign their return
27
+ // values to allConfig.[man, bot].
28
+ Bot(allConfig);
29
+ Manager(allConfig);
30
+ if (process.TESTING)
31
+ global.kgPassword = "TestPW";
32
+ if (initMan)
33
+ await allConfig.man.init("TestPW");
34
+ return allConfig;
35
+ }
36
+ if (/init.js$|kraken-grid$/.test(process.argv[1]))
37
+ init();
38
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1,240 @@
1
+ /**
2
+ * For a detailed explanation regarding each configuration property, visit:
3
+ * https://jestjs.io/docs/configuration
4
+ */
5
+ import { fileURLToPath } from 'url';
6
+ import { dirname } from 'path';
7
+ // Get the current directory
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = dirname(__filename);
10
+ const rootDir = __dirname;
11
+ const config = {
12
+ // All imported modules in your tests should be mocked automatically
13
+ // automock: false,
14
+ // Stop running tests after `n` failures
15
+ // bail: 0,
16
+ // The directory where Jest should store its cached dependency information
17
+ // cacheDirectory: "/tmp/jest_rs",
18
+ // Automatically clear mock calls, instances, contexts and results before every test
19
+ clearMocks: true,
20
+ // Indicates whether the coverage information should be collected while executing the test
21
+ collectCoverage: true,
22
+ // An array of glob patterns indicating a set of files for which coverage information should be collected
23
+ // collectCoverageFrom: undefined,
24
+ // The directory where Jest should output its coverage files
25
+ coverageDirectory: "coverage",
26
+ // An array of regexp pattern strings used to skip coverage collection
27
+ // coveragePathIgnorePatterns: [
28
+ // "/node_modules/"
29
+ // ],
30
+ // Indicates which provider should be used to instrument code for coverage
31
+ coverageProvider: "v8", // or Babel
32
+ /*
33
+
34
+ // A list of reporter names that Jest uses when writing coverage reports
35
+ // coverageReporters: [
36
+ // "json",
37
+ // "text",
38
+ // "lcov",
39
+ // "clover"
40
+ // ],
41
+
42
+ // An object that configures minimum threshold enforcement for coverage results
43
+ // coverageThreshold: undefined,
44
+
45
+ // A path to a custom dependency extractor
46
+ // dependencyExtractor: undefined,
47
+
48
+ // Make calling deprecated APIs throw helpful error messages
49
+ // errorOnDeprecated: false,
50
+
51
+ // The default configuration for fake timers
52
+ // fakeTimers: {
53
+ // "enableGlobally": false
54
+ // },
55
+
56
+ // Force coverage collection from ignored files using an array of glob patterns
57
+ // forceCoverageMatch: [],
58
+
59
+ // A path to a module which exports an async function that is triggered once before all test suites
60
+ // globalSetup: undefined,
61
+
62
+ // A path to a module which exports an async function that is triggered once after all test suites
63
+ // globalTeardown: undefined,
64
+
65
+ // A set of global variables that need to be available in all test environments
66
+ // globals: {},
67
+
68
+ // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
69
+ // maxWorkers: "50%",
70
+
71
+ // An array of directory names to be searched recursively up from the requiring module's location
72
+ // moduleDirectories: [
73
+ // "node_modules"
74
+ // ],
75
+
76
+ // An array of file extensions your modules use
77
+ // moduleFileExtensions: [
78
+ // "js",
79
+ // "mjs",
80
+ // "cjs",
81
+ // "jsx",
82
+ // "ts",
83
+ // "tsx",
84
+ // "json",
85
+ // "node"
86
+ // ],
87
+
88
+ // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
89
+ // moduleNameMapper: {},
90
+
91
+ // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
92
+ // modulePathIgnorePatterns: [],
93
+
94
+ // Activates notifications for test results
95
+ // notify: false,
96
+
97
+ // An enum that specifies notification mode. Requires { notify: true }
98
+ // notifyMode: "failure-change",
99
+
100
+ // A preset that is used as a base for Jest's configuration
101
+ // preset: undefined,
102
+
103
+ // Run tests from one or more projects
104
+ // projects: undefined,
105
+
106
+ // Use this configuration option to add custom reporters to Jest
107
+ // reporters: undefined,
108
+
109
+ // Automatically reset mock state before every test
110
+ // resetMocks: false,
111
+
112
+ // Reset the module registry before running each individual test
113
+ // resetModules: false,
114
+
115
+ // A path to a custom resolver
116
+ // resolver: undefined,
117
+
118
+ // Automatically restore mock state and implementation before every test
119
+ // restoreMocks: false,
120
+
121
+ // The root directory that Jest should scan for tests and modules within
122
+ // rootDir: undefined,
123
+
124
+ // A list of paths to directories that Jest should use to search for files in
125
+ // roots: [
126
+ // "<rootDir>"
127
+ // ],
128
+
129
+ // Allows you to use a custom runner instead of Jest's default test runner
130
+ // runner: "jest-runner",
131
+
132
+ // The paths to modules that run some code to configure or set up the testing environment before each test
133
+ // setupFiles: [],
134
+
135
+ // A list of paths to modules that run some code to configure or set up the testing framework before each test
136
+ // setupFilesAfterEnv: [],
137
+
138
+ // The number of seconds after which a test is considered as slow and reported as such in the results.
139
+ // slowTestThreshold: 5,
140
+
141
+ // A list of paths to snapshot serializer modules Jest should use for snapshot testing
142
+ // snapshotSerializers: [],
143
+
144
+ // The test environment that will be used for testing
145
+ // testEnvironment: "jest-environment-node",
146
+
147
+ // Options that will be passed to the testEnvironment
148
+ // testEnvironmentOptions: {},
149
+
150
+ // Adds a location field to test results
151
+ // testLocationInResults: false,
152
+
153
+ // The glob patterns Jest uses to detect test files
154
+ */
155
+ // testMatch: [
156
+ // "**/__tests__/**/*.[jt]s?(x)",
157
+ // "**/?(*.)+(spec|test).[tj]s?(x)"
158
+ // ],
159
+ /*
160
+ // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
161
+ // testPathIgnorePatterns: [
162
+ // "/node_modules/"
163
+ // ],
164
+
165
+ // The regexp pattern or array of patterns that Jest uses to detect test files
166
+ // testRegex: [],
167
+
168
+ // This option allows the use of a custom results processor
169
+ // testResultsProcessor: undefined,
170
+
171
+ // This option allows use of a custom test runner
172
+ // testRunner: "jest-circus/runner",
173
+
174
+ // A map from regular expressions to paths to transformers
175
+ // transform: undefined,
176
+ transform: {
177
+ '^.+\\.tsx?$': [
178
+ 'ts-jest',
179
+ {
180
+ useESM: true,
181
+ },
182
+ ],
183
+ },
184
+
185
+ // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
186
+ // transformIgnorePatterns: [
187
+ // "/node_modules/",
188
+ // "\\.pnp\\.[^\\/]+$"
189
+ // ],
190
+
191
+ // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
192
+ // unmockedModulePathPatterns: undefined,
193
+
194
+ // Indicates whether each individual test should be reported during the run
195
+ // verbose: undefined,
196
+
197
+ // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
198
+ // watchPathIgnorePatterns: [],
199
+
200
+ // Whether to use watchman for file crawling
201
+ // watchman: true,
202
+ testEnvironment: 'node', // replaces any previous testEnvironment setting
203
+ // reporters: [ 'default', './test/customReporter.mjs' ]
204
+
205
+ preset: 'ts-jest',
206
+ extensionsToTreatAsEsm: ['ts', 'js', 'json', 'node'],
207
+ moduleNameMapper: {
208
+ '^(\\.{1,2}/.*)\\.js$': '$1',
209
+ },
210
+ */
211
+ // From claude.ai:
212
+ preset: 'ts-jest/presets/default-esm',
213
+ testEnvironment: 'node',
214
+ transform: {
215
+ '^.+\\.(ts|tsx)$': 'ts-jest',
216
+ '^(?!.*\\.dist\\/).*\\.js$': 'babel-jest',
217
+ },
218
+ testMatch: [
219
+ '**/test/**/*.test.ts',
220
+ '**/?(*.)+(spec|test).ts'
221
+ ],
222
+ moduleFileExtensions: ['ts', 'js', 'json', 'node'],
223
+ // This ensures compiled files are used when running tests
224
+ moduleNameMapper: {
225
+ '^(\\.{1,2}/.*)\\.js$': '$1',
226
+ },
227
+ extensionsToTreatAsEsm: ['.ts'],
228
+ globals: {
229
+ 'ts-jest': {
230
+ useESM: true,
231
+ },
232
+ },
233
+ rootDir: rootDir,
234
+ verbose: true,
235
+ transformIgnorePatterns: [
236
+ '\\.dist/'
237
+ ],
238
+ };
239
+ export default config;
240
+ //# sourceMappingURL=jest.config.js.map
package/.eslintrc.json ADDED
@@ -0,0 +1,90 @@
1
+ {
2
+ "parser": "@typescript-eslint/parser",
3
+ "extends": [
4
+ "eslint:recommended",
5
+ "airbnb/base",
6
+ "plugin:react/recommended",
7
+ "plugin:react-hooks/recommended",
8
+ "@typescript-eslint/recommended",
9
+ "plugin:promise/recommended",
10
+ "prettier"
11
+ ],
12
+ "plugins": ["promise","@typescript-eslint"],
13
+ "rules": {
14
+ "no-unused-vars": "error",
15
+ "no-console": "off",
16
+ "no-nested-ternary": "error",
17
+ "arrow-body-style": ["error", "as-needed"],
18
+ "react/prop-types": "error",
19
+ "react/react-in-jsx-scope": "off",
20
+ "import/prefer-default-export": "off",
21
+ "promise/catch-or-return": "error",
22
+ "promise/always-return": "error",
23
+ "require-await": "error",
24
+ "no-async-promise-executor": "error",
25
+ "promise/prefer-await-to-then": "error",
26
+ "promise/prefer-await-to-callbacks": "error",
27
+ "no-return-await": "error",
28
+ "no-await-in-loop": "warn",
29
+ "no-void": ["error", { "allowAsStatement": true }],
30
+ "@typescript-eslint/no-floating-promises": "error",
31
+ "@typescript-eslint/ban-types": ["error", {
32
+ "types": {
33
+ "Number": {
34
+ "message": "Use 'number' instead of 'Number'. The wrapper object should not be used as a type.",
35
+ "fixWith": "number"
36
+ },
37
+ "String": {
38
+ "message": "Use 'string' instead of 'String'.",
39
+ "fixWith": "string"
40
+ },
41
+ "Boolean": {
42
+ "message": "Use 'boolean' instead of 'Boolean'.",
43
+ "fixWith": "boolean"
44
+ }
45
+ }}]
46
+ },
47
+ "overrides": [{
48
+ "files": ["test/**/*.js", "test/**/*.mjs"],
49
+ "rules": {
50
+ "no-debugger": "off"
51
+ }
52
+ },{
53
+ "files": ["static/**/*.js"],
54
+ "globals": {
55
+ "jQuery": "readonly",
56
+ "galloc": "readonly",
57
+ "imgByKtick": "readonly",
58
+ "sigdig": "readonly"
59
+ },
60
+ "rules": {
61
+ "no-undef": "warn",
62
+ "no-unused-vars": "warn",
63
+ "no-var": "off",
64
+ "prefer-const": "off",
65
+ "no-use-before-define": "off",
66
+ "no-redeclare": "off",
67
+ "no-plusplus": "off",
68
+ "vars-on-top": "off",
69
+ "block-scoped-var": "off",
70
+ "no-loop-func": "off"
71
+ }
72
+ }],
73
+ "settings": {
74
+ "react": {
75
+ "version": "detect"
76
+ }
77
+ },
78
+ "env": {
79
+ "node": true,
80
+ "browser": true,
81
+ "es2021": true,
82
+ "jest": true,
83
+ "jquery": true
84
+ },
85
+ "parserOptions": {
86
+ "ecmaVersion": "latest",
87
+ "sourceType": "module",
88
+ "project": "./tsconfig.json"
89
+ }
90
+ }
@@ -37,11 +37,14 @@
37
37
  {
38
38
  "type": "node",
39
39
  "request": "launch",
40
- "name": "Launch Program",
41
- "skipFiles": [
42
- "<node_internals>/**"
43
- ],
44
- "program": "${workspaceFolder}\\init.js"
40
+ "name": "Debug bot.ts",
41
+ "skipFiles": ["<node_internals>/**"],
42
+ "program": "${workspaceFolder}/bot.ts",
43
+ "preLaunchTask": "tsc: watch - tsconfig.json",
44
+ "outFiles": ["${workspaceFolder}/**/*.js"],
45
+ "sourceMaps": true,
46
+ "smartStep": true,
47
+ "resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"]
45
48
  }
46
49
  ]
47
50
  }
@@ -0,0 +1,21 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "type": "typescript",
6
+ "tsconfig": "tsconfig.json",
7
+ "option": "watch",
8
+ "problemMatcher": [
9
+ "$tsc-watch"
10
+ ],
11
+ "group": {
12
+ "kind": "build",
13
+ "isDefault": true
14
+ },
15
+ "label": "tsc: watch - tsconfig.json",
16
+ "runOptions": {
17
+ "runOn": "folderOpen"
18
+ }
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1 @@
1
+ ,Daves_Yoga/Dave,Daves_Yoga,08.02.2025 17:15,file:///C:/Users/Dave/AppData/Roaming/LibreOffice/4;
package/README.md CHANGED
@@ -1,60 +1,62 @@
1
- <!-- START doctoc generated TOC please keep comment here to allow auto update -->
2
- <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
1
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
2
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3
3
  **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
4
-
5
- - [kraken-grid BETA](#kraken-grid-beta)
6
- - [Upgrading](#upgrading)
7
- - [Installation](#installation)
8
- - [Usage](#usage)
9
- - [How the author (Dave) does it for himself and others:](#how-the-author-dave-does-it-for-himself-and-others)
10
- - [Discussion of the `adjust` command.](#discussion-of-the-adjust-command)
11
- - [Web UI](#web-ui)
12
- - [Orders table](#orders-table)
13
- - [Allocation table](#allocation-table)
14
- - [Assets table](#assets-table)
15
- - [Pie Charts](#pie-charts)
16
- - [Changing your password](#changing-your-password)
17
- - [Mistyped passwords](#mistyped-passwords)
18
- - [Command Line Interface](#command-line-interface)
19
- - [Trading](#trading)
20
- - [addlev](#addlev)
21
- - [delev](#delev)
22
- - [buy](#buy)
23
- - [sell](#sell)
24
- - [kill](#kill)
25
- - [limits](#limits)
26
- - [less](#less)
27
- - [more](#more)
28
- - [Information Gathering](#information-gathering)
29
- - [assets](#assets)
30
- - [list [Search]](#list-search)
31
- - [margin](#margin)
32
- - [report](#report)
33
- - [show](#show)
34
- - [verbose](#verbose)
35
- - [web](#web)
36
- - [Bot Management](#bot-management)
37
- - [adjust](#adjust)
38
- - [allocate](#allocate)
39
- - [allocation](#allocation)
40
- - [asset](#asset)
41
- - [auto](#auto)
42
- - [manual](#manual)
43
- - [balance](#balance)
44
- - [quit](#quit)
45
- - [risky](#risky)
46
- - [refnum](#refnum)
47
- - [reset](#reset)
48
- - [safe](#safe)
49
- - [set](#set)
50
- - [Experimental features (Not Recommended and not well tested)](#experimental-features-not-recommended-and-not-well-tested)
51
- - [ws - EXPERIMENTAL](#ws---experimental)
52
- - [Internals](#internals)
53
- - [Userref](#userref)
54
- - [Partial Execution](#partial-execution)
55
- - [HELP!](#help)
56
-
57
- <!-- END doctoc generated TOC please keep comment here to allow auto update -->
4
+
5
+ - [kraken-grid BETA](#kraken-grid-beta)
6
+ - [Upgrading](#upgrading)
7
+ - [Installation](#installation)
8
+ - [Usage](#usage)
9
+ - [How the author (Dave) does it for himself and others:](#how-the-author-dave-does-it-for-himself-and-others)
10
+ - [Discussion of the `adjust` command.](#discussion-of-the-adjust-command)
11
+ - [Web UI](#web-ui)
12
+ - [Orders table](#orders-table)
13
+ - [Allocation table](#allocation-table)
14
+ - [Assets table](#assets-table)
15
+ - [Pie Charts](#pie-charts)
16
+ - [Changing your password](#changing-your-password)
17
+ - [Mistyped passwords](#mistyped-passwords)
18
+ - [Command Line Interface](#command-line-interface)
19
+ - [Trading](#trading)
20
+ - [addlev](#addlev)
21
+ - [delev](#delev)
22
+ - [buy](#buy)
23
+ - [sell](#sell)
24
+ - [kill](#kill)
25
+ - [limits](#limits)
26
+ - [less](#less)
27
+ - [more](#more)
28
+ - [Information Gathering](#information-gathering)
29
+ - [assets](#assets)
30
+ - [capGains](#capgains)
31
+ - [list [Search]](#list-search)
32
+ - [margin](#margin)
33
+ - [report](#report)
34
+ - [show](#show)
35
+ - [verbose](#verbose)
36
+ - [web](#web)
37
+ - [Bot Management](#bot-management)
38
+ - [adjust](#adjust)
39
+ - [allocate](#allocate)
40
+ - [allocation](#allocation)
41
+ - [asset](#asset)
42
+ - [auto](#auto)
43
+ - [manual](#manual)
44
+ - [balance](#balance)
45
+ - [notest](#notest)
46
+ - [quit](#quit)
47
+ - [risky](#risky)
48
+ - [refnum](#refnum)
49
+ - [reset](#reset)
50
+ - [safe](#safe)
51
+ - [set](#set)
52
+ - [Experimental features (Not Recommended and not well tested)](#experimental-features-not-recommended-and-not-well-tested)
53
+ - [ws - EXPERIMENTAL](#ws---experimental)
54
+ - [Internals](#internals)
55
+ - [Userref](#userref)
56
+ - [Partial Execution](#partial-execution)
57
+ - [HELP!](#help)
58
+
59
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
58
60
 
59
61
  # kraken-grid BETA
60
62
  A bot that extends grid trading once you use it to create a grid using orders with conditional closes.
@@ -156,7 +158,7 @@ The semantics are the same as for [buy](#buy)
156
158
 
157
159
  #### kill
158
160
  `kill X`
159
- X can be an Order ID from Kraken (recognized by the presence of dashes), a [userref](#userref) (which often identifies more than one order, and, importantly, _both_ the initial buy or sell, _and_ the series of sells and buys resulting from partial executions), or a `Counter` as shown from [list](#list). This cancels the order or orders. `list` will still show such orders, prefixed with `Killed`, until [report](#report) runs again to update the internal record of open orders.
161
+ X can be an Order ID from Kraken (recognized by the presence of dashes), a [userref](#userref) (which often identifies more than one order, and, importantly, _both_ the initial buy or sell, _and_ the series of sells and buys resulting from partial executions), or a `Counter` as shown from [list](#list). This cancels the order or orders. `list` will still show such orders, prefixed with `Killed`, until [report](#report) runs again to update the internal record of open orders. `kill 0` can be used to cancel all orders, but it prompts for confirmation and so should be used onlyin the console where the bot was started.
160
162
 
161
163
  #### limits
162
164
  `limits AtLeast AtMost`
@@ -176,6 +178,12 @@ Increase the amount of crypto to be traded. Otherwise, this command is the same
176
178
  `assets [Filter]`
177
179
  This provides you with a list of assets in each account (see [asset](#asset) under bot management), and if Filter is anything, only accounts and assets with the label or ticker Filter.
178
180
 
181
+ #### capGains
182
+ capGains Price Symbol [ISOStart] [BuyFile] [outFile]
183
+ Price is the purchase price of what you held when the year started or at ISOStart, a timestamp of the form YYYY-MM-DD. Symbol is self-explanatory. If BuyFile is present, it will be read as a .json file that lists purchases that were deposited to the exchange:
184
+ <pre>[{'date': '2024-01-01', 'cost': 1000.00,'amount': 0.05},
185
+ {'date': '2024-06-01', 'cost': 1000.00,'amount': 0.02}]</pre>
186
+
179
187
  #### list [Search]
180
188
  This simply prints out a list of all the open orders the code last retrieved (it does NOT retrieve them again, so...) It may have orders in it that have already been executed or which you canceled. Each order is presented as:
181
189
  `Counter K trade amount pair @ limit price [with A:B leverage] userref [close position @ limit price]`