dao-treasury 0.0.71__cp311-cp311-win_amd64.whl → 0.1.1__cp311-cp311-win_amd64.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.

Potentially problematic release.


This version of dao-treasury might be problematic. Click here for more details.

Files changed (40) hide show
  1. dao_treasury/.grafana/provisioning/dashboards/breakdowns/Expenses.json +89 -73
  2. dao_treasury/.grafana/provisioning/dashboards/breakdowns/Revenue.json +86 -68
  3. dao_treasury/.grafana/provisioning/dashboards/streams/LlamaPay.json +5 -12
  4. dao_treasury/.grafana/provisioning/dashboards/summary/Monthly.json +5 -6
  5. dao_treasury/.grafana/provisioning/dashboards/transactions/Treasury Transactions.json +220 -195
  6. dao_treasury/.grafana/provisioning/dashboards/transactions/Unsorted Transactions.json +367 -0
  7. dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow (Including Unsorted).json +61 -71
  8. dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow.json +43 -50
  9. dao_treasury/.grafana/provisioning/dashboards/treasury/Current Treasury Assets.json +50 -90
  10. dao_treasury/.grafana/provisioning/dashboards/treasury/Historical Treasury Balances.json +1403 -532
  11. dao_treasury/.grafana/provisioning/dashboards/treasury/Operating Cashflow.json +31 -36
  12. dao_treasury/.grafana/provisioning/datasources/datasources.yaml +9 -4
  13. dao_treasury/__init__.py +0 -4
  14. dao_treasury/_docker.cp311-win_amd64.pyd +0 -0
  15. dao_treasury/_docker.py +6 -2
  16. dao_treasury/_nicknames.cp311-win_amd64.pyd +0 -0
  17. dao_treasury/_nicknames.py +3 -2
  18. dao_treasury/_wallet.cp311-win_amd64.pyd +0 -0
  19. dao_treasury/constants.cp311-win_amd64.pyd +0 -0
  20. dao_treasury/db.py +340 -120
  21. dao_treasury/docker-compose.yaml +18 -2
  22. dao_treasury/main.py +5 -2
  23. dao_treasury/sorting/__init__.cp311-win_amd64.pyd +0 -0
  24. dao_treasury/sorting/__init__.py +38 -21
  25. dao_treasury/sorting/_matchers.cp311-win_amd64.pyd +0 -0
  26. dao_treasury/sorting/_rules.cp311-win_amd64.pyd +0 -0
  27. dao_treasury/sorting/factory.cp311-win_amd64.pyd +0 -0
  28. dao_treasury/sorting/rule.cp311-win_amd64.pyd +0 -0
  29. dao_treasury/sorting/rules/__init__.cp311-win_amd64.pyd +0 -0
  30. dao_treasury/sorting/rules/ignore/__init__.cp311-win_amd64.pyd +0 -0
  31. dao_treasury/sorting/rules/ignore/llamapay.cp311-win_amd64.pyd +0 -0
  32. dao_treasury/types.cp311-win_amd64.pyd +0 -0
  33. {dao_treasury-0.0.71.dist-info → dao_treasury-0.1.1.dist-info}/METADATA +3 -2
  34. dao_treasury-0.1.1.dist-info/RECORD +53 -0
  35. dao_treasury__mypyc.cp311-win_amd64.pyd +0 -0
  36. dao_treasury/streams/__init__.cp311-win_amd64.pyd +0 -0
  37. dao_treasury/streams/llamapay.cp311-win_amd64.pyd +0 -0
  38. dao_treasury-0.0.71.dist-info/RECORD +0 -54
  39. {dao_treasury-0.0.71.dist-info → dao_treasury-0.1.1.dist-info}/WHEEL +0 -0
  40. {dao_treasury-0.0.71.dist-info → dao_treasury-0.1.1.dist-info}/top_level.txt +0 -0
@@ -22,9 +22,8 @@
22
22
  "links": [],
23
23
  "panels": [
24
24
  {
25
- "datasource": "SQLite",
25
+ "datasource": "PostgreSQL",
26
26
  "fieldConfig": {
27
- "unit": "currencyUSD",
28
27
  "defaults": {
29
28
  "color": {
30
29
  "mode": "thresholds"
@@ -42,7 +41,8 @@
42
41
  "value": 80
43
42
  }
44
43
  ]
45
- }
44
+ },
45
+ "unit": "currencyUSD"
46
46
  },
47
47
  "overrides": []
48
48
  },
@@ -71,10 +71,9 @@
71
71
  "pluginVersion": "12.1.1",
72
72
  "targets": [
73
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",
74
+ "datasource": "PostgreSQL",
75
+ "format": "table",
76
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
78
77
  "refId": "A",
79
78
  "timeColumns": ["time", "ts"]
80
79
  }
@@ -84,9 +83,8 @@
84
83
  "description": "Displays the total value of all transactions sorted as revenue for the selected period."
85
84
  },
86
85
  {
87
- "datasource": "SQLite",
86
+ "datasource": "PostgreSQL",
88
87
  "fieldConfig": {
89
- "unit": "currencyUSD",
90
88
  "defaults": {
91
89
  "color": {
92
90
  "mode": "thresholds"
@@ -104,7 +102,8 @@
104
102
  "value": 80
105
103
  }
106
104
  ]
107
- }
105
+ },
106
+ "unit": "currencyUSD"
108
107
  },
109
108
  "overrides": []
110
109
  },
@@ -133,10 +132,9 @@
133
132
  "pluginVersion": "12.1.1",
134
133
  "targets": [
135
134
  {
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",
135
+ "datasource": "PostgreSQL",
136
+ "format": "table",
137
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Expenses' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
140
138
  "refId": "A",
141
139
  "timeColumns": ["time", "ts"]
142
140
  }
@@ -146,9 +144,8 @@
146
144
  "description": "Displays the total value of all transactions sorted as expenses for the selected period."
147
145
  },
148
146
  {
149
- "datasource": "SQLite",
147
+ "datasource": "PostgreSQL",
150
148
  "fieldConfig": {
151
- "unit": "currencyUSD",
152
149
  "defaults": {
153
150
  "color": {
154
151
  "mode": "thresholds"
@@ -166,7 +163,8 @@
166
163
  "value": 80
167
164
  }
168
165
  ]
169
- }
166
+ },
167
+ "unit": "currencyUSD"
170
168
  },
171
169
  "overrides": []
172
170
  },
@@ -195,10 +193,9 @@
195
193
  "pluginVersion": "12.1.1",
196
194
  "targets": [
197
195
  {
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",
196
+ "datasource": "PostgreSQL",
197
+ "format": "table",
198
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Cost of Revenue' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
202
199
  "refId": "A",
203
200
  "timeColumns": ["time", "ts"]
204
201
  }
@@ -208,9 +205,8 @@
208
205
  "description": "Displays the total value of all transactions sorted as cost of revenue for the selected period."
209
206
  },
210
207
  {
211
- "datasource": "SQLite",
208
+ "datasource": "PostgreSQL",
212
209
  "fieldConfig": {
213
- "unit": "currencyUSD",
214
210
  "defaults": {
215
211
  "color": {
216
212
  "mode": "thresholds"
@@ -228,7 +224,8 @@
228
224
  "value": 80
229
225
  }
230
226
  ]
231
- }
227
+ },
228
+ "unit": "currencyUSD"
232
229
  },
233
230
  "overrides": []
234
231
  },
@@ -257,10 +254,9 @@
257
254
  "pluginVersion": "12.1.1",
258
255
  "targets": [
259
256
  {
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",
257
+ "datasource": "PostgreSQL",
258
+ "format": "table",
259
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Income' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
264
260
  "refId": "A",
265
261
  "timeColumns": ["time", "ts"]
266
262
  }
@@ -270,9 +266,8 @@
270
266
  "description": "Displays the total value of all transactions sorted as other income for the selected period."
271
267
  },
272
268
  {
273
- "datasource": "SQLite",
269
+ "datasource": "PostgreSQL",
274
270
  "fieldConfig": {
275
- "unit": "currencyUSD",
276
271
  "defaults": {
277
272
  "color": {
278
273
  "mode": "thresholds"
@@ -290,7 +285,8 @@
290
285
  "value": 80
291
286
  }
292
287
  ]
293
- }
288
+ },
289
+ "unit": "currencyUSD"
294
290
  },
295
291
  "overrides": []
296
292
  },
@@ -319,10 +315,9 @@
319
315
  "pluginVersion": "12.1.1",
320
316
  "targets": [
321
317
  {
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",
318
+ "datasource": "PostgreSQL",
319
+ "format": "table",
320
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Expenses' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
326
321
  "refId": "A",
327
322
  "timeColumns": ["time", "ts"]
328
323
  }
@@ -332,10 +327,9 @@
332
327
  "description": "Displays the total value of all transactions sorted as other expenses for the selected period."
333
328
  },
334
329
  {
335
- "datasource": "SQLite",
330
+ "datasource": "PostgreSQL",
336
331
  "description": "Shows the net total cashflow (all revenue minus all expenses) for the selected period, including both sorted and unsorted transactions.",
337
332
  "fieldConfig": {
338
- "unit": "currencyUSD",
339
333
  "defaults": {
340
334
  "color": {
341
335
  "mode": "thresholds"
@@ -353,7 +347,8 @@
353
347
  "value": 80
354
348
  }
355
349
  ]
356
- }
350
+ },
351
+ "unit": "currencyUSD"
357
352
  },
358
353
  "overrides": []
359
354
  },
@@ -382,10 +377,9 @@
382
377
  "pluginVersion": "12.1.1",
383
378
  "targets": [
384
379
  {
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",
380
+ "datasource": "PostgreSQL",
381
+ "format": "table",
382
+ "rawSql": "SELECT (\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN p.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN p.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN p.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Other Income' THEN p.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Other Expenses' THEN p.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Sort Me (Inbound)' THEN p.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Sort Me (Outbound)' THEN p.value_usd ELSE 0 END)\n) AS total_net\nFROM usdvalue_presum p\nJOIN txgroup_hierarchy gh USING (txgroup_id)\nWHERE p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
389
383
  "refId": "A",
390
384
  "timeColumns": ["time", "ts"]
391
385
  }
@@ -394,10 +388,9 @@
394
388
  "type": "stat"
395
389
  },
396
390
  {
397
- "datasource": "SQLite",
391
+ "datasource": "PostgreSQL",
398
392
  "description": "Time series chart of all cashflows (including unsorted), grouped by category, for the selected period.",
399
393
  "fieldConfig": {
400
- "unit": "currencyUSD",
401
394
  "defaults": {
402
395
  "color": {
403
396
  "mode": "palette-classic"
@@ -448,7 +441,8 @@
448
441
  "value": 80
449
442
  }
450
443
  ]
451
- }
444
+ },
445
+ "unit": "currencyUSD"
452
446
  },
453
447
  "overrides": [
454
448
  {
@@ -499,10 +493,9 @@
499
493
  "pluginVersion": "12.1.1",
500
494
  "targets": [
501
495
  {
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;",
496
+ "datasource": "PostgreSQL",
497
+ "format": "table",
498
+ "rawSql": "SELECT to_timestamp(p.timestamp) AS \"timestamp\",\n SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income','Sort Me (Inbound)') THEN p.value_usd ELSE 0 END) AS \"Total Received\",\n SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses','Sort Me (Outbound)') THEN p.value_usd ELSE 0 END) * -1 AS \"Total Sent\",\n SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income','Sort Me (Inbound)') THEN p.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses','Sort Me (Outbound)') THEN p.value_usd ELSE 0 END) AS \"Net\"\nFROM usdvalue_presum AS p\nJOIN txgroup_hierarchy gh ON p.txgroup_id = gh.txgroup_id\nWHERE p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000\nGROUP BY timestamp\nORDER BY timestamp;",
506
499
  "refId": "A",
507
500
  "timeColumns": ["timestamp"]
508
501
  }
@@ -602,10 +595,9 @@
602
595
  "type": "timeseries"
603
596
  },
604
597
  {
605
- "datasource": "SQLite",
598
+ "datasource": "PostgreSQL",
606
599
  "description": "Displays the total value of inbound transactions pending categorization for the selected period.",
607
600
  "fieldConfig": {
608
- "unit": "currencyUSD",
609
601
  "defaults": {
610
602
  "color": {
611
603
  "mode": "thresholds"
@@ -623,7 +615,8 @@
623
615
  "value": 80
624
616
  }
625
617
  ]
626
- }
618
+ },
619
+ "unit": "currencyUSD"
627
620
  },
628
621
  "overrides": []
629
622
  },
@@ -652,10 +645,9 @@
652
645
  "pluginVersion": "12.1.1",
653
646
  "targets": [
654
647
  {
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",
648
+ "datasource": "PostgreSQL",
649
+ "format": "table",
650
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Sort Me (Inbound)' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
659
651
  "refId": "A",
660
652
  "timeColumns": ["time", "ts"]
661
653
  }
@@ -664,10 +656,9 @@
664
656
  "type": "stat"
665
657
  },
666
658
  {
667
- "datasource": "SQLite",
659
+ "datasource": "PostgreSQL",
668
660
  "description": "Displays the total value of outbound transactions pending categorization for the selected period.",
669
661
  "fieldConfig": {
670
- "unit": "currencyUSD",
671
662
  "defaults": {
672
663
  "color": {
673
664
  "mode": "thresholds"
@@ -685,7 +676,8 @@
685
676
  "value": 80
686
677
  }
687
678
  ]
688
- }
679
+ },
680
+ "unit": "currencyUSD"
689
681
  },
690
682
  "overrides": []
691
683
  },
@@ -714,10 +706,9 @@
714
706
  "pluginVersion": "12.1.1",
715
707
  "targets": [
716
708
  {
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",
709
+ "datasource": "PostgreSQL",
710
+ "format": "table",
711
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Sort Me (Outbound)' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
721
712
  "refId": "A",
722
713
  "timeColumns": ["time", "ts"]
723
714
  }
@@ -726,10 +717,9 @@
726
717
  "type": "stat"
727
718
  },
728
719
  {
729
- "datasource": "SQLite",
720
+ "datasource": "PostgreSQL",
730
721
  "description": "Shows the overall net cashflow (including unsorted) for the selected period.",
731
722
  "fieldConfig": {
732
- "unit": "currencyUSD",
733
723
  "defaults": {
734
724
  "color": {
735
725
  "mode": "thresholds"
@@ -747,7 +737,8 @@
747
737
  "value": 80
748
738
  }
749
739
  ]
750
- }
740
+ },
741
+ "unit": "currencyUSD"
751
742
  },
752
743
  "overrides": []
753
744
  },
@@ -776,10 +767,9 @@
776
767
  "pluginVersion": "12.1.1",
777
768
  "targets": [
778
769
  {
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",
770
+ "datasource": "PostgreSQL",
771
+ "format": "table",
772
+ "rawSql": "SELECT (\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN p.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN p.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN p.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Other Income' THEN p.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Other Expenses' THEN p.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Sort Me (Inbound)' THEN p.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Sort Me (Outbound)' THEN p.value_usd ELSE 0 END)\n) AS total_net\nFROM usdvalue_presum p\nJOIN txgroup_hierarchy gh USING (txgroup_id)\nWHERE p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
783
773
  "refId": "A",
784
774
  "timeColumns": ["time", "ts"]
785
775
  }
@@ -804,5 +794,5 @@
804
794
  "title": "Total Cashflow Summary (Including Unsorted)",
805
795
  "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
796
  "uid": "2b6e7c1d-8f4a-4e3b-9b2a-1c7d8e9f0a2b",
807
- "version": 100
797
+ "version": 105
808
798
  }
@@ -22,9 +22,8 @@
22
22
  "links": [],
23
23
  "panels": [
24
24
  {
25
- "datasource": "SQLite",
25
+ "datasource": "PostgreSQL",
26
26
  "fieldConfig": {
27
- "unit": "currencyUSD",
28
27
  "defaults": {
29
28
  "color": {
30
29
  "mode": "thresholds"
@@ -42,7 +41,8 @@
42
41
  "value": 80
43
42
  }
44
43
  ]
45
- }
44
+ },
45
+ "unit": "currencyUSD"
46
46
  },
47
47
  "overrides": []
48
48
  },
@@ -71,10 +71,9 @@
71
71
  "pluginVersion": "12.1.1",
72
72
  "targets": [
73
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",
74
+ "datasource": "PostgreSQL",
75
+ "format": "table",
76
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
78
77
  "refId": "A",
79
78
  "timeColumns": ["time", "ts"]
80
79
  }
@@ -84,9 +83,8 @@
84
83
  "description": "Displays the total value of all transactions sorted as Revenue for the selected period."
85
84
  },
86
85
  {
87
- "datasource": "SQLite",
86
+ "datasource": "PostgreSQL",
88
87
  "fieldConfig": {
89
- "unit": "currencyUSD",
90
88
  "defaults": {
91
89
  "color": {
92
90
  "mode": "thresholds"
@@ -104,7 +102,8 @@
104
102
  "value": 80
105
103
  }
106
104
  ]
107
- }
105
+ },
106
+ "unit": "currencyUSD"
108
107
  },
109
108
  "overrides": []
110
109
  },
@@ -133,10 +132,9 @@
133
132
  "pluginVersion": "12.1.1",
134
133
  "targets": [
135
134
  {
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",
135
+ "datasource": "PostgreSQL",
136
+ "format": "table",
137
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Expenses' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
140
138
  "refId": "A",
141
139
  "timeColumns": ["time", "ts"]
142
140
  }
@@ -146,9 +144,8 @@
146
144
  "description": "Displays the total value of all transactions sorted as Expenses for the selected period."
147
145
  },
148
146
  {
149
- "datasource": "SQLite",
147
+ "datasource": "PostgreSQL",
150
148
  "fieldConfig": {
151
- "unit": "currencyUSD",
152
149
  "defaults": {
153
150
  "color": {
154
151
  "mode": "thresholds"
@@ -166,7 +163,8 @@
166
163
  "value": 80
167
164
  }
168
165
  ]
169
- }
166
+ },
167
+ "unit": "currencyUSD"
170
168
  },
171
169
  "overrides": []
172
170
  },
@@ -195,10 +193,9 @@
195
193
  "pluginVersion": "12.1.1",
196
194
  "targets": [
197
195
  {
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",
196
+ "datasource": "PostgreSQL",
197
+ "format": "table",
198
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Cost of Revenue' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
202
199
  "refId": "A",
203
200
  "timeColumns": ["time", "ts"]
204
201
  }
@@ -208,9 +205,8 @@
208
205
  "description": "Displays the total value of all transactions sorted as Cost of Revenue for the selected period."
209
206
  },
210
207
  {
211
- "datasource": "SQLite",
208
+ "datasource": "PostgreSQL",
212
209
  "fieldConfig": {
213
- "unit": "currencyUSD",
214
210
  "defaults": {
215
211
  "color": {
216
212
  "mode": "thresholds"
@@ -228,7 +224,8 @@
228
224
  "value": 80
229
225
  }
230
226
  ]
231
- }
227
+ },
228
+ "unit": "currencyUSD"
232
229
  },
233
230
  "overrides": []
234
231
  },
@@ -257,10 +254,9 @@
257
254
  "pluginVersion": "12.1.1",
258
255
  "targets": [
259
256
  {
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",
257
+ "datasource": "PostgreSQL",
258
+ "format": "table",
259
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Income' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
264
260
  "refId": "A",
265
261
  "timeColumns": ["time", "ts"]
266
262
  }
@@ -270,9 +266,8 @@
270
266
  "description": "Displays the total value of all transactions sorted as Other Income for the selected period."
271
267
  },
272
268
  {
273
- "datasource": "SQLite",
269
+ "datasource": "PostgreSQL",
274
270
  "fieldConfig": {
275
- "unit": "currencyUSD",
276
271
  "defaults": {
277
272
  "color": {
278
273
  "mode": "thresholds"
@@ -290,7 +285,8 @@
290
285
  "value": 80
291
286
  }
292
287
  ]
293
- }
288
+ },
289
+ "unit": "currencyUSD"
294
290
  },
295
291
  "overrides": []
296
292
  },
@@ -319,10 +315,9 @@
319
315
  "pluginVersion": "12.1.1",
320
316
  "targets": [
321
317
  {
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",
318
+ "datasource": "PostgreSQL",
319
+ "format": "table",
320
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Expenses' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
326
321
  "refId": "A",
327
322
  "timeColumns": ["time", "ts"]
328
323
  }
@@ -332,10 +327,9 @@
332
327
  "description": "Displays the total value of all transactions sorted as Other Expenses for the selected period."
333
328
  },
334
329
  {
335
- "datasource": "SQLite",
330
+ "datasource": "PostgreSQL",
336
331
  "description": "Shows the net total cashflow (all Revenue and Other Income minus all Expenses, Cost of Revenue, and Other Expenses) for the selected period.",
337
332
  "fieldConfig": {
338
- "unit": "currencyUSD",
339
333
  "defaults": {
340
334
  "color": {
341
335
  "mode": "thresholds"
@@ -353,7 +347,8 @@
353
347
  "value": 80
354
348
  }
355
349
  ]
356
- }
350
+ },
351
+ "unit": "currencyUSD"
357
352
  },
358
353
  "overrides": []
359
354
  },
@@ -382,10 +377,9 @@
382
377
  "pluginVersion": "12.1.1",
383
378
  "targets": [
384
379
  {
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",
380
+ "datasource": "PostgreSQL",
381
+ "format": "table",
382
+ "rawSql": "SELECT (\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN p.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN p.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN p.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Other Income' THEN p.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Other Expenses' THEN p.value_usd ELSE 0 END)\n) AS total_net\nFROM usdvalue_presum p\nJOIN txgroup_hierarchy gh USING (txgroup_id)\nWHERE p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
389
383
  "refId": "A",
390
384
  "timeColumns": ["time", "ts"]
391
385
  }
@@ -394,10 +388,9 @@
394
388
  "type": "stat"
395
389
  },
396
390
  {
397
- "datasource": "SQLite",
391
+ "datasource": "PostgreSQL",
398
392
  "description": "Time series chart of all sorted cashflows, grouped by category, for the selected period. Shows Total Revenue, Total Expenses, and Net for each week, helping to analyze trends in the DAO's financial flows over time.",
399
393
  "fieldConfig": {
400
- "unit": "currencyUSD",
401
394
  "defaults": {
402
395
  "color": {
403
396
  "mode": "palette-classic"
@@ -448,7 +441,8 @@
448
441
  "value": 80
449
442
  }
450
443
  ]
451
- }
444
+ },
445
+ "unit": "currencyUSD"
452
446
  },
453
447
  "overrides": [
454
448
  {
@@ -499,10 +493,9 @@
499
493
  "pluginVersion": "12.1.1",
500
494
  "targets": [
501
495
  {
502
- "datasource": "SQLite",
503
- "queryText": "SELECT t.timestamp, SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN t.value_usd ELSE 0 END) AS \"Total Revenue\", SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN t.value_usd ELSE 0 END) * -1 AS \"Total Expenses\", SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN t.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN t.value_usd ELSE 0 END) AS \"Net\" FROM general_ledger AS t JOIN txgroup_hierarchy gh ON t.txgroup_id = gh.txgroup_id WHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 GROUP BY timestamp ORDER BY timestamp;",
504
- "queryType": "table",
505
- "rawQueryText": "SELECT t.timestamp, SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN t.value_usd ELSE 0 END) AS \"Total Revenue\", SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN t.value_usd ELSE 0 END) * -1 AS \"Total Expenses\", SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN t.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN t.value_usd ELSE 0 END) AS \"Net\" FROM general_ledger AS t JOIN txgroup_hierarchy gh ON t.txgroup_id = gh.txgroup_id WHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 GROUP BY timestamp ORDER BY timestamp;",
496
+ "datasource": "PostgreSQL",
497
+ "format": "table",
498
+ "rawSql": "SELECT to_timestamp(p.timestamp) AS \"timestamp\", SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN p.value_usd ELSE 0 END) AS \"Total Revenue\", SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN p.value_usd ELSE 0 END) * -1 AS \"Total Expenses\", SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN p.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN p.value_usd ELSE 0 END) AS \"Net\" FROM usdvalue_presum AS p JOIN txgroup_hierarchy gh ON p.txgroup_id = gh.txgroup_id WHERE p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000 GROUP BY timestamp ORDER BY timestamp;",
506
499
  "refId": "A",
507
500
  "timeColumns": ["timestamp"]
508
501
  }
@@ -598,5 +591,5 @@
598
591
  "title": "Total Cashflow Summary",
599
592
  "description": "Shows all sorted cashflows, including Revenue, Cost of Revenue, Expenses, Other Income, and Other Expense, but omits transactions pending categorization. Useful for analyzing the DAO's complete sorted financial flows.",
600
593
  "uid": "7e2b1c8a-4e2d-4b7a-9c1a-2f8e6b7d9c3f",
601
- "version": 100
594
+ "version": 105
602
595
  }