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