dao-treasury 0.0.42__cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl

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 (51) hide show
  1. bf2b4fe1f86ad2ea158b__mypyc.cpython-312-i386-linux-gnu.so +0 -0
  2. dao_treasury/.grafana/provisioning/dashboards/dashboards.yaml +60 -0
  3. dao_treasury/.grafana/provisioning/dashboards/streams/LlamaPay.json +225 -0
  4. dao_treasury/.grafana/provisioning/dashboards/summary/Monthly.json +107 -0
  5. dao_treasury/.grafana/provisioning/dashboards/transactions/Treasury Transactions.json +387 -0
  6. dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow (Including Unsorted).json +835 -0
  7. dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow.json +615 -0
  8. dao_treasury/.grafana/provisioning/dashboards/treasury/Operating Cashflow.json +492 -0
  9. dao_treasury/.grafana/provisioning/dashboards/treasury/Treasury.json +2018 -0
  10. dao_treasury/.grafana/provisioning/datasources/datasources.yaml +17 -0
  11. dao_treasury/ENVIRONMENT_VARIABLES.py +20 -0
  12. dao_treasury/__init__.py +62 -0
  13. dao_treasury/_docker.cpython-312-i386-linux-gnu.so +0 -0
  14. dao_treasury/_docker.py +190 -0
  15. dao_treasury/_nicknames.cpython-312-i386-linux-gnu.so +0 -0
  16. dao_treasury/_nicknames.py +32 -0
  17. dao_treasury/_wallet.cpython-312-i386-linux-gnu.so +0 -0
  18. dao_treasury/_wallet.py +250 -0
  19. dao_treasury/constants.cpython-312-i386-linux-gnu.so +0 -0
  20. dao_treasury/constants.py +34 -0
  21. dao_treasury/db.py +1408 -0
  22. dao_treasury/docker-compose.yaml +41 -0
  23. dao_treasury/main.py +247 -0
  24. dao_treasury/py.typed +0 -0
  25. dao_treasury/sorting/__init__.cpython-312-i386-linux-gnu.so +0 -0
  26. dao_treasury/sorting/__init__.py +295 -0
  27. dao_treasury/sorting/_matchers.cpython-312-i386-linux-gnu.so +0 -0
  28. dao_treasury/sorting/_matchers.py +387 -0
  29. dao_treasury/sorting/_rules.cpython-312-i386-linux-gnu.so +0 -0
  30. dao_treasury/sorting/_rules.py +235 -0
  31. dao_treasury/sorting/factory.cpython-312-i386-linux-gnu.so +0 -0
  32. dao_treasury/sorting/factory.py +299 -0
  33. dao_treasury/sorting/rule.cpython-312-i386-linux-gnu.so +0 -0
  34. dao_treasury/sorting/rule.py +346 -0
  35. dao_treasury/sorting/rules/__init__.cpython-312-i386-linux-gnu.so +0 -0
  36. dao_treasury/sorting/rules/__init__.py +1 -0
  37. dao_treasury/sorting/rules/ignore/__init__.cpython-312-i386-linux-gnu.so +0 -0
  38. dao_treasury/sorting/rules/ignore/__init__.py +1 -0
  39. dao_treasury/sorting/rules/ignore/llamapay.cpython-312-i386-linux-gnu.so +0 -0
  40. dao_treasury/sorting/rules/ignore/llamapay.py +20 -0
  41. dao_treasury/streams/__init__.cpython-312-i386-linux-gnu.so +0 -0
  42. dao_treasury/streams/__init__.py +0 -0
  43. dao_treasury/streams/llamapay.cpython-312-i386-linux-gnu.so +0 -0
  44. dao_treasury/streams/llamapay.py +388 -0
  45. dao_treasury/treasury.py +191 -0
  46. dao_treasury/types.cpython-312-i386-linux-gnu.so +0 -0
  47. dao_treasury/types.py +133 -0
  48. dao_treasury-0.0.42.dist-info/METADATA +119 -0
  49. dao_treasury-0.0.42.dist-info/RECORD +51 -0
  50. dao_treasury-0.0.42.dist-info/WHEEL +7 -0
  51. dao_treasury-0.0.42.dist-info/top_level.txt +2 -0
@@ -0,0 +1,835 @@
1
+ {
2
+ "annotations": {
3
+ "list": [
4
+ {
5
+ "builtIn": 1,
6
+ "datasource": {
7
+ "type": "grafana",
8
+ "uid": "-- Grafana --"
9
+ },
10
+ "enable": true,
11
+ "hide": true,
12
+ "iconColor": "rgba(0, 211, 255, 1)",
13
+ "name": "Annotations & Alerts",
14
+ "type": "dashboard"
15
+ }
16
+ ]
17
+ },
18
+ "editable": true,
19
+ "fiscalYearStartMonth": 0,
20
+ "graphTooltip": 1,
21
+ "links": [],
22
+ "liveNow": false,
23
+ "panels": [
24
+ {
25
+ "datasource": "SQLite",
26
+ "fieldConfig": {
27
+ "defaults": {
28
+ "color": {
29
+ "mode": "thresholds"
30
+ },
31
+ "mappings": [],
32
+ "thresholds": {
33
+ "mode": "absolute",
34
+ "steps": [
35
+ {
36
+ "color": "green",
37
+ "value": null
38
+ },
39
+ {
40
+ "color": "red",
41
+ "value": 80
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ "overrides": []
47
+ },
48
+ "gridPos": {
49
+ "h": 4,
50
+ "w": 4,
51
+ "x": 0,
52
+ "y": 0
53
+ },
54
+ "id": 1,
55
+ "options": {
56
+ "colorMode": "value",
57
+ "graphMode": "area",
58
+ "justifyMode": "auto",
59
+ "orientation": "auto",
60
+ "reduceOptions": {
61
+ "calcs": [
62
+ "lastNotNull"
63
+ ],
64
+ "fields": "",
65
+ "values": false
66
+ },
67
+ "textMode": "auto"
68
+ },
69
+ "pluginVersion": "10.2.0",
70
+ "targets": [
71
+ {
72
+ "datasource": "SQLite",
73
+ "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
74
+ "queryType": "table",
75
+ "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
76
+ "refId": "A",
77
+ "timeColumns": [
78
+ "time",
79
+ "ts"
80
+ ]
81
+ }
82
+ ],
83
+ "title": "Revenue",
84
+ "type": "stat"
85
+ },
86
+ {
87
+ "datasource": "SQLite",
88
+ "fieldConfig": {
89
+ "defaults": {
90
+ "color": {
91
+ "mode": "thresholds"
92
+ },
93
+ "mappings": [],
94
+ "thresholds": {
95
+ "mode": "absolute",
96
+ "steps": [
97
+ {
98
+ "color": "green",
99
+ "value": null
100
+ },
101
+ {
102
+ "color": "red",
103
+ "value": 80
104
+ }
105
+ ]
106
+ }
107
+ },
108
+ "overrides": []
109
+ },
110
+ "gridPos": {
111
+ "h": 4,
112
+ "w": 4,
113
+ "x": 4,
114
+ "y": 0
115
+ },
116
+ "id": 2,
117
+ "options": {
118
+ "colorMode": "value",
119
+ "graphMode": "area",
120
+ "justifyMode": "auto",
121
+ "orientation": "auto",
122
+ "reduceOptions": {
123
+ "calcs": [
124
+ "lastNotNull"
125
+ ],
126
+ "fields": "",
127
+ "values": false
128
+ },
129
+ "textMode": "auto"
130
+ },
131
+ "pluginVersion": "10.2.0",
132
+ "targets": [
133
+ {
134
+ "datasource": "SQLite",
135
+ "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Expenses' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
136
+ "queryType": "table",
137
+ "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Expenses' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
138
+ "refId": "A",
139
+ "timeColumns": [
140
+ "time",
141
+ "ts"
142
+ ]
143
+ }
144
+ ],
145
+ "title": "Expenses",
146
+ "type": "stat"
147
+ },
148
+ {
149
+ "datasource": "SQLite",
150
+ "fieldConfig": {
151
+ "defaults": {
152
+ "color": {
153
+ "mode": "thresholds"
154
+ },
155
+ "mappings": [],
156
+ "thresholds": {
157
+ "mode": "absolute",
158
+ "steps": [
159
+ {
160
+ "color": "green",
161
+ "value": null
162
+ },
163
+ {
164
+ "color": "red",
165
+ "value": 80
166
+ }
167
+ ]
168
+ }
169
+ },
170
+ "overrides": []
171
+ },
172
+ "gridPos": {
173
+ "h": 4,
174
+ "w": 4,
175
+ "x": 8,
176
+ "y": 0
177
+ },
178
+ "id": 3,
179
+ "options": {
180
+ "colorMode": "value",
181
+ "graphMode": "area",
182
+ "justifyMode": "auto",
183
+ "orientation": "auto",
184
+ "reduceOptions": {
185
+ "calcs": [
186
+ "lastNotNull"
187
+ ],
188
+ "fields": "",
189
+ "values": false
190
+ },
191
+ "textMode": "auto"
192
+ },
193
+ "pluginVersion": "10.2.0",
194
+ "targets": [
195
+ {
196
+ "datasource": "SQLite",
197
+ "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Cost of Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
198
+ "queryType": "table",
199
+ "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Cost of Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
200
+ "refId": "A",
201
+ "timeColumns": [
202
+ "time",
203
+ "ts"
204
+ ]
205
+ }
206
+ ],
207
+ "title": "Cost of Revenue",
208
+ "type": "stat"
209
+ },
210
+ {
211
+ "datasource": "SQLite",
212
+ "fieldConfig": {
213
+ "defaults": {
214
+ "color": {
215
+ "mode": "thresholds"
216
+ },
217
+ "mappings": [],
218
+ "thresholds": {
219
+ "mode": "absolute",
220
+ "steps": [
221
+ {
222
+ "color": "green",
223
+ "value": null
224
+ },
225
+ {
226
+ "color": "red",
227
+ "value": 80
228
+ }
229
+ ]
230
+ }
231
+ },
232
+ "overrides": []
233
+ },
234
+ "gridPos": {
235
+ "h": 4,
236
+ "w": 4,
237
+ "x": 12,
238
+ "y": 0
239
+ },
240
+ "id": 4,
241
+ "options": {
242
+ "colorMode": "value",
243
+ "graphMode": "area",
244
+ "justifyMode": "auto",
245
+ "orientation": "auto",
246
+ "reduceOptions": {
247
+ "calcs": [
248
+ "lastNotNull"
249
+ ],
250
+ "fields": "",
251
+ "values": false
252
+ },
253
+ "textMode": "auto"
254
+ },
255
+ "pluginVersion": "10.2.0",
256
+ "targets": [
257
+ {
258
+ "datasource": "SQLite",
259
+ "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Income' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
260
+ "queryType": "table",
261
+ "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Income' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
262
+ "refId": "A",
263
+ "timeColumns": [
264
+ "time",
265
+ "ts"
266
+ ]
267
+ }
268
+ ],
269
+ "title": "Other Income",
270
+ "type": "stat"
271
+ },
272
+ {
273
+ "datasource": "SQLite",
274
+ "fieldConfig": {
275
+ "defaults": {
276
+ "color": {
277
+ "mode": "thresholds"
278
+ },
279
+ "mappings": [],
280
+ "thresholds": {
281
+ "mode": "absolute",
282
+ "steps": [
283
+ {
284
+ "color": "green",
285
+ "value": null
286
+ },
287
+ {
288
+ "color": "red",
289
+ "value": 80
290
+ }
291
+ ]
292
+ }
293
+ },
294
+ "overrides": []
295
+ },
296
+ "gridPos": {
297
+ "h": 4,
298
+ "w": 4,
299
+ "x": 16,
300
+ "y": 0
301
+ },
302
+ "id": 5,
303
+ "options": {
304
+ "colorMode": "value",
305
+ "graphMode": "area",
306
+ "justifyMode": "auto",
307
+ "orientation": "auto",
308
+ "reduceOptions": {
309
+ "calcs": [
310
+ "lastNotNull"
311
+ ],
312
+ "fields": "",
313
+ "values": false
314
+ },
315
+ "textMode": "auto"
316
+ },
317
+ "pluginVersion": "10.2.0",
318
+ "targets": [
319
+ {
320
+ "datasource": "SQLite",
321
+ "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Expenses' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
322
+ "queryType": "table",
323
+ "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Expenses' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
324
+ "refId": "A",
325
+ "timeColumns": [
326
+ "time",
327
+ "ts"
328
+ ]
329
+ }
330
+ ],
331
+ "title": "Other Expenses",
332
+ "type": "stat"
333
+ },
334
+ {
335
+ "datasource": "SQLite",
336
+ "description": "",
337
+ "fieldConfig": {
338
+ "defaults": {
339
+ "color": {
340
+ "mode": "thresholds"
341
+ },
342
+ "mappings": [],
343
+ "thresholds": {
344
+ "mode": "absolute",
345
+ "steps": [
346
+ {
347
+ "color": "green",
348
+ "value": null
349
+ },
350
+ {
351
+ "color": "red",
352
+ "value": 80
353
+ }
354
+ ]
355
+ }
356
+ },
357
+ "overrides": []
358
+ },
359
+ "gridPos": {
360
+ "h": 4,
361
+ "w": 4,
362
+ "x": 20,
363
+ "y": 0
364
+ },
365
+ "id": 10,
366
+ "options": {
367
+ "colorMode": "value",
368
+ "graphMode": "area",
369
+ "justifyMode": "auto",
370
+ "orientation": "auto",
371
+ "reduceOptions": {
372
+ "calcs": [
373
+ "lastNotNull"
374
+ ],
375
+ "fields": "",
376
+ "values": false
377
+ },
378
+ "textMode": "auto"
379
+ },
380
+ "pluginVersion": "10.2.0",
381
+ "targets": [
382
+ {
383
+ "datasource": "SQLite",
384
+ "queryText": "SELECT (\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN t.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Other Income' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Other Expenses' THEN t.value_usd ELSE 0 END)\n) AS total_net\nFROM general_ledger t\nJOIN txgroup_hierarchy gh USING (txgroup_id)\nWHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
385
+ "queryType": "table",
386
+ "rawQueryText": "SELECT (\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN t.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Other Income' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Other Expenses' THEN t.value_usd ELSE 0 END)\n) AS total_net\nFROM general_ledger t\nJOIN txgroup_hierarchy gh USING (txgroup_id)\nWHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
387
+ "refId": "A",
388
+ "timeColumns": [
389
+ "time",
390
+ "ts"
391
+ ]
392
+ }
393
+ ],
394
+ "title": "Sorted Total",
395
+ "type": "stat"
396
+ },
397
+ {
398
+ "datasource": "SQLite",
399
+ "description": "",
400
+ "fieldConfig": {
401
+ "defaults": {
402
+ "color": {
403
+ "mode": "palette-classic"
404
+ },
405
+ "custom": {
406
+ "axisBorderShow": false,
407
+ "axisCenteredZero": false,
408
+ "axisColorMode": "text",
409
+ "axisLabel": "",
410
+ "axisPlacement": "auto",
411
+ "barAlignment": 0,
412
+ "drawStyle": "bars",
413
+ "fillOpacity": 70,
414
+ "gradientMode": "none",
415
+ "hideFrom": {
416
+ "legend": false,
417
+ "tooltip": false,
418
+ "viz": false
419
+ },
420
+ "insertNulls": false,
421
+ "lineInterpolation": "linear",
422
+ "lineWidth": 1,
423
+ "pointSize": 5,
424
+ "scaleDistribution": {
425
+ "type": "linear"
426
+ },
427
+ "showPoints": "auto",
428
+ "spanNulls": false,
429
+ "stacking": {
430
+ "group": "A",
431
+ "mode": "normal"
432
+ },
433
+ "thresholdsStyle": {
434
+ "mode": "off"
435
+ }
436
+ },
437
+ "mappings": [],
438
+ "thresholds": {
439
+ "mode": "absolute",
440
+ "steps": [
441
+ {
442
+ "color": "green",
443
+ "value": null
444
+ },
445
+ {
446
+ "color": "red",
447
+ "value": 80
448
+ }
449
+ ]
450
+ }
451
+ },
452
+ "overrides": [
453
+ {
454
+ "matcher": {
455
+ "id": "byName",
456
+ "options": "Net (sum)"
457
+ },
458
+ "properties": [
459
+ {
460
+ "id": "custom.drawStyle",
461
+ "value": "line"
462
+ },
463
+ {
464
+ "id": "custom.stacking",
465
+ "value": {
466
+ "group": "A",
467
+ "mode": "none"
468
+ }
469
+ },
470
+ {
471
+ "id": "custom.fillOpacity",
472
+ "value": 19
473
+ }
474
+ ]
475
+ }
476
+ ]
477
+ },
478
+ "gridPos": {
479
+ "h": 12,
480
+ "w": 20,
481
+ "x": 0,
482
+ "y": 4
483
+ },
484
+ "id": 11,
485
+ "options": {
486
+ "legend": {
487
+ "calcs": [],
488
+ "displayMode": "list",
489
+ "placement": "bottom",
490
+ "showLegend": true
491
+ },
492
+ "tooltip": {
493
+ "mode": "single",
494
+ "sort": "none"
495
+ }
496
+ },
497
+ "targets": [
498
+ {
499
+ "datasource": "SQLite",
500
+ "queryText": "SELECT t.timestamp,\r\n SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income','Sort Me (Inbound)') THEN t.value_usd ELSE 0 END) AS \"Total Received\",\r\n SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses','Sort Me (Outbound)') THEN t.value_usd ELSE 0 END) * -1 AS \"Total Sent\",\r\n SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income','Sort Me (Inbound)') THEN t.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses','Sort Me (Outbound)') THEN t.value_usd ELSE 0 END) AS \"Net\"\r\nFROM general_ledger AS t\r\nJOIN txgroup_hierarchy gh ON t.txgroup_id = gh.txgroup_id\r\nWHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000\r\nGROUP BY timestamp\r\nORDER BY timestamp;",
501
+ "queryType": "table",
502
+ "rawQueryText": "SELECT t.timestamp,\r\n SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income','Sort Me (Inbound)') THEN t.value_usd ELSE 0 END) AS \"Total Received\",\r\n SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses','Sort Me (Outbound)') THEN t.value_usd ELSE 0 END) * -1 AS \"Total Sent\",\r\n SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income','Sort Me (Inbound)') THEN t.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses','Sort Me (Outbound)') THEN t.value_usd ELSE 0 END) AS \"Net\"\r\nFROM general_ledger AS t\r\nJOIN txgroup_hierarchy gh ON t.txgroup_id = gh.txgroup_id\r\nWHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000\r\nGROUP BY timestamp\r\nORDER BY timestamp;",
503
+ "refId": "A",
504
+ "timeColumns": [
505
+ "timestamp"
506
+ ]
507
+ }
508
+ ],
509
+ "title": "Weekly Cashflow",
510
+ "transformations": [
511
+ {
512
+ "id": "formatTime",
513
+ "options": {
514
+ "outputFormat": "YYYY-WW",
515
+ "timeField": "timestamp",
516
+ "timezone": "browser",
517
+ "useTimezone": true
518
+ }
519
+ },
520
+ {
521
+ "id": "convertFieldType",
522
+ "options": {
523
+ "conversions": [
524
+ {
525
+ "dateFormat": "YYYY-WW",
526
+ "destinationType": "time",
527
+ "targetField": "timestamp"
528
+ }
529
+ ],
530
+ "fields": {}
531
+ }
532
+ },
533
+ {
534
+ "id": "groupBy",
535
+ "options": {
536
+ "fields": {
537
+ "Cost of Revenue": {
538
+ "aggregations": [
539
+ "sum"
540
+ ],
541
+ "operation": "aggregate"
542
+ },
543
+ "Expenses": {
544
+ "aggregations": [
545
+ "sum"
546
+ ],
547
+ "operation": "aggregate"
548
+ },
549
+ "Net": {
550
+ "aggregations": [
551
+ "sum"
552
+ ],
553
+ "operation": "aggregate"
554
+ },
555
+ "Net (Including Unsorted)": {
556
+ "aggregations": [
557
+ "sum"
558
+ ],
559
+ "operation": "aggregate"
560
+ },
561
+ "Other Expenses": {
562
+ "aggregations": [
563
+ "sum"
564
+ ],
565
+ "operation": "aggregate"
566
+ },
567
+ "Other Income": {
568
+ "aggregations": [
569
+ "sum"
570
+ ],
571
+ "operation": "aggregate"
572
+ },
573
+ "Revenue": {
574
+ "aggregations": [
575
+ "sum"
576
+ ],
577
+ "operation": "aggregate"
578
+ },
579
+ "Timestamp": {
580
+ "aggregations": [],
581
+ "operation": "groupby"
582
+ },
583
+ "Total Expenses": {
584
+ "aggregations": [
585
+ "sum"
586
+ ],
587
+ "operation": "aggregate"
588
+ },
589
+ "Total Expenses (Including Unsorted)": {
590
+ "aggregations": [
591
+ "sum"
592
+ ],
593
+ "operation": "aggregate"
594
+ },
595
+ "Total Received": {
596
+ "aggregations": [
597
+ "sum"
598
+ ],
599
+ "operation": "aggregate"
600
+ },
601
+ "Total Revenue": {
602
+ "aggregations": [
603
+ "sum"
604
+ ],
605
+ "operation": "aggregate"
606
+ },
607
+ "Total Revenue (Including Unsorted)": {
608
+ "aggregations": [
609
+ "sum"
610
+ ],
611
+ "operation": "aggregate"
612
+ },
613
+ "Total Sent": {
614
+ "aggregations": [
615
+ "sum"
616
+ ],
617
+ "operation": "aggregate"
618
+ },
619
+ "timestamp": {
620
+ "aggregations": [],
621
+ "operation": "groupby"
622
+ }
623
+ }
624
+ }
625
+ }
626
+ ],
627
+ "type": "timeseries"
628
+ },
629
+ {
630
+ "datasource": "SQLite",
631
+ "description": "",
632
+ "fieldConfig": {
633
+ "defaults": {
634
+ "color": {
635
+ "mode": "thresholds"
636
+ },
637
+ "mappings": [],
638
+ "thresholds": {
639
+ "mode": "absolute",
640
+ "steps": [
641
+ {
642
+ "color": "green",
643
+ "value": null
644
+ },
645
+ {
646
+ "color": "red",
647
+ "value": 80
648
+ }
649
+ ]
650
+ }
651
+ },
652
+ "overrides": []
653
+ },
654
+ "gridPos": {
655
+ "h": 4,
656
+ "w": 4,
657
+ "x": 20,
658
+ "y": 4
659
+ },
660
+ "id": 8,
661
+ "options": {
662
+ "colorMode": "value",
663
+ "graphMode": "area",
664
+ "justifyMode": "auto",
665
+ "orientation": "auto",
666
+ "reduceOptions": {
667
+ "calcs": [
668
+ "lastNotNull"
669
+ ],
670
+ "fields": "",
671
+ "values": false
672
+ },
673
+ "textMode": "auto"
674
+ },
675
+ "pluginVersion": "10.2.0",
676
+ "targets": [
677
+ {
678
+ "datasource": "SQLite",
679
+ "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Sort Me (Inbound)' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
680
+ "queryType": "table",
681
+ "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Sort Me (Inbound)' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
682
+ "refId": "A",
683
+ "timeColumns": [
684
+ "time",
685
+ "ts"
686
+ ]
687
+ }
688
+ ],
689
+ "title": "Unsorted (Inbound)",
690
+ "type": "stat"
691
+ },
692
+ {
693
+ "datasource": "SQLite",
694
+ "description": "",
695
+ "fieldConfig": {
696
+ "defaults": {
697
+ "color": {
698
+ "mode": "thresholds"
699
+ },
700
+ "mappings": [],
701
+ "thresholds": {
702
+ "mode": "absolute",
703
+ "steps": [
704
+ {
705
+ "color": "green",
706
+ "value": null
707
+ },
708
+ {
709
+ "color": "red",
710
+ "value": 80
711
+ }
712
+ ]
713
+ }
714
+ },
715
+ "overrides": []
716
+ },
717
+ "gridPos": {
718
+ "h": 4,
719
+ "w": 4,
720
+ "x": 20,
721
+ "y": 8
722
+ },
723
+ "id": 9,
724
+ "options": {
725
+ "colorMode": "value",
726
+ "graphMode": "area",
727
+ "justifyMode": "auto",
728
+ "orientation": "auto",
729
+ "reduceOptions": {
730
+ "calcs": [
731
+ "lastNotNull"
732
+ ],
733
+ "fields": "",
734
+ "values": false
735
+ },
736
+ "textMode": "auto"
737
+ },
738
+ "pluginVersion": "10.2.0",
739
+ "targets": [
740
+ {
741
+ "datasource": "SQLite",
742
+ "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Sort Me (Outbound)' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
743
+ "queryType": "table",
744
+ "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Sort Me (Outbound)' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
745
+ "refId": "A",
746
+ "timeColumns": [
747
+ "time",
748
+ "ts"
749
+ ]
750
+ }
751
+ ],
752
+ "title": "Unsorted (Outbound)",
753
+ "type": "stat"
754
+ },
755
+ {
756
+ "datasource": "SQLite",
757
+ "description": "",
758
+ "fieldConfig": {
759
+ "defaults": {
760
+ "color": {
761
+ "mode": "thresholds"
762
+ },
763
+ "mappings": [],
764
+ "thresholds": {
765
+ "mode": "absolute",
766
+ "steps": [
767
+ {
768
+ "color": "green",
769
+ "value": null
770
+ },
771
+ {
772
+ "color": "red",
773
+ "value": 80
774
+ }
775
+ ]
776
+ }
777
+ },
778
+ "overrides": []
779
+ },
780
+ "gridPos": {
781
+ "h": 4,
782
+ "w": 4,
783
+ "x": 20,
784
+ "y": 12
785
+ },
786
+ "id": 6,
787
+ "options": {
788
+ "colorMode": "value",
789
+ "graphMode": "area",
790
+ "justifyMode": "auto",
791
+ "orientation": "auto",
792
+ "reduceOptions": {
793
+ "calcs": [
794
+ "lastNotNull"
795
+ ],
796
+ "fields": "",
797
+ "values": false
798
+ },
799
+ "textMode": "auto"
800
+ },
801
+ "pluginVersion": "10.2.0",
802
+ "targets": [
803
+ {
804
+ "datasource": "SQLite",
805
+ "queryText": "SELECT (\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN t.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Other Income' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Other Expenses' THEN t.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Sort Me (Inbound)' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Sort Me (Outbound)' THEN t.value_usd ELSE 0 END)\n) AS total_net\nFROM general_ledger t\nJOIN txgroup_hierarchy gh USING (txgroup_id)\nWHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
806
+ "queryType": "table",
807
+ "rawQueryText": "SELECT (\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN t.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Other Income' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Other Expenses' THEN t.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Sort Me (Inbound)' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Sort Me (Outbound)' THEN t.value_usd ELSE 0 END)\n) AS total_net\nFROM general_ledger t\nJOIN txgroup_hierarchy gh USING (txgroup_id)\nWHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
808
+ "refId": "A",
809
+ "timeColumns": [
810
+ "time",
811
+ "ts"
812
+ ]
813
+ }
814
+ ],
815
+ "title": "Total",
816
+ "type": "stat"
817
+ }
818
+ ],
819
+ "refresh": false,
820
+ "schemaVersion": 38,
821
+ "tags": [],
822
+ "templating": {
823
+ "list": []
824
+ },
825
+ "time": {
826
+ "from": "now-6M",
827
+ "to": "now"
828
+ },
829
+ "timepicker": {},
830
+ "timezone": "",
831
+ "title": "Total Cashflow Summary (Including Unsorted)",
832
+ "uid": "2b6e7c1d-8f4a-4e3b-9b2a-1c7d8e9f0a2b",
833
+ "version": 1,
834
+ "weekStart": ""
835
+ }