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
@@ -15,19 +15,21 @@
15
15
  }
16
16
  ]
17
17
  },
18
- "description": "Provides a detailed breakdown of DAO revenue over time, including totals and averages by period and transaction group. Intended for monitoring income streams, identifying trends, and supporting financial reporting. Use the 'Tx Group' filter to view specific revenue categories (e.g., Revenue, Other Income) or all groups. Data Links in panels allow quick navigation to filtered transaction details.",
18
+ "description": "Provides a detailed breakdown of DAO revenue over time, including totals and averages by period and transaction group. Intended for monitoring income streams, identifying trends, and supporting financial reporting. Use the 'Top Level' and 'Tx Group' filters to view specific revenue categories. Data Links in panels allow quick navigation to filtered transaction details.",
19
19
  "editable": true,
20
20
  "fiscalYearStartMonth": 0,
21
21
  "graphTooltip": 1,
22
- "id": 15,
22
+ "id": 9,
23
23
  "links": [],
24
24
  "panels": [
25
25
  {
26
- "datasource": "SQLite",
26
+ "datasource": "PostgreSQL",
27
+ "description": "Displays the total revenue for the selected period, aggregated across all revenue transaction groups.\n\nClicking the value opens a filtered transactions dashboard for this period and group.",
27
28
  "fieldConfig": {
28
29
  "defaults": {
29
30
  "color": {
30
- "mode": "thresholds"
31
+ "fixedColor": "semi-dark-green",
32
+ "mode": "fixed"
31
33
  },
32
34
  "mappings": [],
33
35
  "thresholds": {
@@ -56,9 +58,9 @@
56
58
  "id": "links",
57
59
  "value": [
58
60
  {
61
+ "targetBlank": true,
59
62
  "title": "View Revenue Transactions For This Period",
60
- "url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=Revenue&from=$__from&to=$__to",
61
- "targetBlank": true
63
+ "url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=Revenue&from=$__from&to=$__to"
62
64
  }
63
65
  ]
64
66
  }
@@ -74,7 +76,7 @@
74
76
  },
75
77
  "id": 1,
76
78
  "options": {
77
- "colorMode": "value",
79
+ "colorMode": "background",
78
80
  "graphMode": "area",
79
81
  "justifyMode": "auto",
80
82
  "orientation": "auto",
@@ -88,27 +90,27 @@
88
90
  "textMode": "auto",
89
91
  "wideLayout": true
90
92
  },
91
- "pluginVersion": "12.2.0",
93
+ "pluginVersion": "12.2.1",
92
94
  "targets": [
93
95
  {
94
- "datasource": "SQLite",
95
- "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) inner join txgroups t USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND t.name IN (${Txgroup:sqlstring})",
96
- "queryType": "table",
97
- "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) inner join txgroups t USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND t.name IN (${Txgroup:sqlstring})",
96
+ "datasource": "PostgreSQL",
97
+ "format": "table",
98
+ "rawSql": "SELECT SUM(value_usd) AS total_revenue FROM usdvalue_presum_revenue WHERE timestamp >= $__from/1000 AND timestamp <= $__to/1000 AND top_category IN (${TopLevel:sqlstring}) AND txgroup_name IN (${Txgroup:sqlstring})",
98
99
  "refId": "A",
99
100
  "timeColumns": ["time", "ts"]
100
101
  }
101
102
  ],
102
103
  "title": "Revenue",
103
- "type": "stat",
104
- "description": "Displays the total revenue for the selected period, aggregated across all revenue transaction groups.\n\nClicking the value opens a filtered transactions dashboard for this period and group."
104
+ "type": "stat"
105
105
  },
106
106
  {
107
- "datasource": "SQLite",
107
+ "datasource": "PostgreSQL",
108
+ "description": "Shows the average revenue per month for the selected period.\n\nClicking the value opens a filtered transactions dashboard for this period and group.",
108
109
  "fieldConfig": {
109
110
  "defaults": {
110
111
  "color": {
111
- "mode": "thresholds"
112
+ "fixedColor": "semi-dark-green",
113
+ "mode": "fixed"
112
114
  },
113
115
  "mappings": [],
114
116
  "thresholds": {
@@ -137,9 +139,9 @@
137
139
  "id": "links",
138
140
  "value": [
139
141
  {
142
+ "targetBlank": true,
140
143
  "title": "View Revenue Transactions For This Period",
141
- "url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=Revenue&from=$__from&to=$__to",
142
- "targetBlank": true
144
+ "url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=Revenue&from=$__from&to=$__to"
143
145
  }
144
146
  ]
145
147
  }
@@ -155,7 +157,7 @@
155
157
  },
156
158
  "id": 4,
157
159
  "options": {
158
- "colorMode": "value",
160
+ "colorMode": "background",
159
161
  "graphMode": "area",
160
162
  "justifyMode": "auto",
161
163
  "orientation": "auto",
@@ -169,27 +171,27 @@
169
171
  "textMode": "auto",
170
172
  "wideLayout": true
171
173
  },
172
- "pluginVersion": "12.2.0",
174
+ "pluginVersion": "12.2.1",
173
175
  "targets": [
174
176
  {
175
- "datasource": "SQLite",
176
- "queryText": "SELECT SUM(t.value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24 / 30.436875)) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) INNER JOIN txgroups t USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND t.name IN (${Txgroup:sqlstring})",
177
- "queryType": "table",
178
- "rawQueryText": "SELECT SUM(t.value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24 / 30.436875)) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) INNER JOIN txgroups t USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND t.name IN (${Txgroup:sqlstring})",
177
+ "datasource": "PostgreSQL",
178
+ "format": "table",
179
+ "rawSql": "SELECT SUM(value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24 / 30.436875)) AS total_revenue FROM usdvalue_presum_revenue WHERE timestamp >= $__from/1000 AND timestamp <= $__to/1000 AND top_category IN (${TopLevel:sqlstring}) AND txgroup_name IN (${Txgroup:sqlstring})",
179
180
  "refId": "A",
180
181
  "timeColumns": ["time", "ts"]
181
182
  }
182
183
  ],
183
184
  "title": "Monthly Revenue",
184
- "type": "stat",
185
- "description": "Shows the average revenue per month for the selected period.\n\nClicking the value opens a filtered transactions dashboard for this period and group."
185
+ "type": "stat"
186
186
  },
187
187
  {
188
- "datasource": "SQLite",
188
+ "datasource": "PostgreSQL",
189
+ "description": "Shows the average revenue per week for the selected period.\n\nClicking the value opens a filtered transactions dashboard for this period and group.",
189
190
  "fieldConfig": {
190
191
  "defaults": {
191
192
  "color": {
192
- "mode": "thresholds"
193
+ "fixedColor": "semi-dark-green",
194
+ "mode": "fixed"
193
195
  },
194
196
  "mappings": [],
195
197
  "thresholds": {
@@ -218,9 +220,9 @@
218
220
  "id": "links",
219
221
  "value": [
220
222
  {
223
+ "targetBlank": true,
221
224
  "title": "View Revenue Transactions For This Period",
222
- "url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=Revenue&from=$__from&to=$__to",
223
- "targetBlank": true
225
+ "url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=Revenue&from=$__from&to=$__to"
224
226
  }
225
227
  ]
226
228
  }
@@ -236,7 +238,7 @@
236
238
  },
237
239
  "id": 2,
238
240
  "options": {
239
- "colorMode": "value",
241
+ "colorMode": "background",
240
242
  "graphMode": "area",
241
243
  "justifyMode": "auto",
242
244
  "orientation": "auto",
@@ -250,27 +252,27 @@
250
252
  "textMode": "auto",
251
253
  "wideLayout": true
252
254
  },
253
- "pluginVersion": "12.2.0",
255
+ "pluginVersion": "12.2.1",
254
256
  "targets": [
255
257
  {
256
- "datasource": "SQLite",
257
- "queryText": "SELECT SUM(t.value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24 / 7)) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) INNER JOIN txgroups t USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND t.name IN (${Txgroup:sqlstring})",
258
- "queryType": "table",
259
- "rawQueryText": "SELECT SUM(t.value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24 / 7)) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) INNER JOIN txgroups t USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND t.name IN (${Txgroup:sqlstring})",
258
+ "datasource": "PostgreSQL",
259
+ "format": "table",
260
+ "rawSql": "SELECT SUM(value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24 / 7)) AS total_revenue FROM usdvalue_presum_revenue WHERE timestamp >= $__from/1000 AND timestamp <= $__to/1000 AND top_category IN (${TopLevel:sqlstring}) AND txgroup_name IN (${Txgroup:sqlstring})",
260
261
  "refId": "A",
261
262
  "timeColumns": ["time", "ts"]
262
263
  }
263
264
  ],
264
265
  "title": "Weekly Revenue",
265
- "type": "stat",
266
- "description": "Shows the average revenue per week for the selected period.\n\nClicking the value opens a filtered transactions dashboard for this period and group."
266
+ "type": "stat"
267
267
  },
268
268
  {
269
- "datasource": "SQLite",
269
+ "datasource": "PostgreSQL",
270
+ "description": "Shows the average revenue per day for the selected period.\n\nClicking the value opens a filtered transactions dashboard for this period and group.",
270
271
  "fieldConfig": {
271
272
  "defaults": {
272
273
  "color": {
273
- "mode": "thresholds"
274
+ "fixedColor": "semi-dark-green",
275
+ "mode": "fixed"
274
276
  },
275
277
  "mappings": [],
276
278
  "thresholds": {
@@ -299,9 +301,9 @@
299
301
  "id": "links",
300
302
  "value": [
301
303
  {
304
+ "targetBlank": true,
302
305
  "title": "View Revenue Transactions For This Period",
303
- "url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=Revenue&from=$__from&to=$__to",
304
- "targetBlank": true
306
+ "url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=Revenue&from=$__from&to=$__to"
305
307
  }
306
308
  ]
307
309
  }
@@ -317,7 +319,7 @@
317
319
  },
318
320
  "id": 3,
319
321
  "options": {
320
- "colorMode": "value",
322
+ "colorMode": "background",
321
323
  "graphMode": "area",
322
324
  "justifyMode": "auto",
323
325
  "orientation": "auto",
@@ -331,23 +333,21 @@
331
333
  "textMode": "auto",
332
334
  "wideLayout": true
333
335
  },
334
- "pluginVersion": "12.2.0",
336
+ "pluginVersion": "12.2.1",
335
337
  "targets": [
336
338
  {
337
- "datasource": "SQLite",
338
- "queryText": "SELECT SUM(t.value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24)) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) INNER JOIN txgroups t USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND t.name IN (${Txgroup:sqlstring})",
339
- "queryType": "table",
340
- "rawQueryText": "SELECT SUM(t.value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24)) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) INNER JOIN txgroups t USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND t.name IN (${Txgroup:sqlstring})",
339
+ "datasource": "PostgreSQL",
340
+ "format": "table",
341
+ "rawSql": "SELECT SUM(value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24)) AS total_revenue FROM usdvalue_presum_revenue WHERE timestamp >= $__from/1000 AND timestamp <= $__to/1000 AND top_category IN (${TopLevel:sqlstring}) AND txgroup_name IN (${Txgroup:sqlstring})",
341
342
  "refId": "A",
342
343
  "timeColumns": ["time", "ts"]
343
344
  }
344
345
  ],
345
346
  "title": "Daily Revenue",
346
- "type": "stat",
347
- "description": "Shows the average revenue per day for the selected period.\n\nClicking the value opens a filtered transactions dashboard for this period and group."
347
+ "type": "stat"
348
348
  },
349
349
  {
350
- "datasource": "SQLite",
350
+ "datasource": "PostgreSQL",
351
351
  "description": "Time series chart of revenue by transaction group, aggregated weekly for the selected period.\n\nClicking a group name opens a filtered transactions dashboard for that group and period.",
352
352
  "fieldConfig": {
353
353
  "defaults": {
@@ -415,9 +415,9 @@
415
415
  "id": "links",
416
416
  "value": [
417
417
  {
418
+ "targetBlank": true,
418
419
  "title": "View ${__series.name} Transactions",
419
- "url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=${__series.name}&from=$__from&to=$__to",
420
- "targetBlank": true
420
+ "url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=${__series.name}&from=$__from&to=$__to"
421
421
  }
422
422
  ]
423
423
  }
@@ -432,7 +432,6 @@
432
432
  "y": 4
433
433
  },
434
434
  "id": 11,
435
- "type": "timeseries",
436
435
  "options": {
437
436
  "legend": {
438
437
  "calcs": ["sum"],
@@ -446,13 +445,12 @@
446
445
  "sort": "none"
447
446
  }
448
447
  },
449
- "pluginVersion": "12.2.0",
448
+ "pluginVersion": "12.2.1",
450
449
  "targets": [
451
450
  {
452
- "datasource": "SQLite",
453
- "queryText": "SELECT t.timestamp, g.name AS \"TxGroup\", SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN t.value_usd ELSE 0 END) AS \"Revenue\" FROM general_ledger AS t JOIN txgroup_hierarchy gh ON t.txgroup_id = gh.txgroup_id INNER JOIN txgroups g USING (txgroup_id) WHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring}) GROUP BY t.timestamp, g.name ORDER BY t.timestamp;",
454
- "queryType": "table",
455
- "rawQueryText": "SELECT t.timestamp, g.name AS \"TxGroup\", SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN t.value_usd ELSE 0 END) AS \"Revenue\" FROM general_ledger AS t JOIN txgroup_hierarchy gh ON t.txgroup_id = gh.txgroup_id INNER JOIN txgroups g USING (txgroup_id) WHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring}) GROUP BY t.timestamp, g.name ORDER BY t.timestamp;",
451
+ "datasource": "PostgreSQL",
452
+ "format": "table",
453
+ "rawSql": "SELECT to_timestamp(timestamp) AS \"timestamp\", txgroup_name AS \"TxGroup\", SUM(value_usd) AS \"Revenue\" FROM usdvalue_presum_revenue WHERE timestamp >= $__from/1000 AND timestamp <= $__to/1000 AND top_category IN (${TopLevel:sqlstring}) AND txgroup_name IN (${Txgroup:sqlstring}) GROUP BY timestamp, txgroup_name ORDER BY timestamp;",
456
454
  "refId": "A",
457
455
  "timeColumns": ["timestamp"]
458
456
  }
@@ -485,14 +483,14 @@
485
483
  "id": "groupBy",
486
484
  "options": {
487
485
  "fields": {
488
- "TxGroup": {
489
- "aggregations": [],
490
- "operation": "groupby"
491
- },
492
486
  "Revenue": {
493
487
  "aggregations": ["sum"],
494
488
  "operation": "aggregate"
495
489
  },
490
+ "TxGroup": {
491
+ "aggregations": [],
492
+ "operation": "groupby"
493
+ },
496
494
  "timestamp": {
497
495
  "aggregations": [],
498
496
  "operation": "groupby"
@@ -510,7 +508,8 @@
510
508
  }
511
509
  }
512
510
  }
513
- ]
511
+ ],
512
+ "type": "timeseries"
514
513
  }
515
514
  ],
516
515
  "preload": false,
@@ -519,19 +518,38 @@
519
518
  "tags": ["breakdown", "revenue"],
520
519
  "templating": {
521
520
  "list": [
521
+ {
522
+ "name": "TopLevel",
523
+ "label": "Top Level",
524
+ "type": "query",
525
+ "query": "SELECT DISTINCT top_category FROM usdvalue_presum_revenue WHERE timestamp >= $__from/1000 AND timestamp <= $__to/1000;",
526
+ "definition": "SELECT DISTINCT top_category FROM usdvalue_presum_revenue WHERE timestamp >= $__from/1000 AND timestamp <= $__to/1000;",
527
+ "description": "Filter the dashboard by top-level revenue category.",
528
+ "includeAll": true,
529
+ "multi": true,
530
+ "current": {
531
+ "text": "All",
532
+ "value": "$__all"
533
+ },
534
+ "options": [],
535
+ "refresh": 2,
536
+ "regex": "",
537
+ "sort": 5
538
+ },
522
539
  {
523
540
  "allowCustomValue": true,
524
541
  "current": {
525
542
  "text": "All",
526
543
  "value": "$__all"
527
544
  },
528
- "definition": "SELECT DISTINCT t.name FROM treasury_txs a INNER JOIN txgroup_hierarchy gh ON a.txgroup_id = gh.txgroup_id LEFT JOIN txgroups t ON gh.txgroup_id = t.txgroup_id WHERE (gh.top_category = 'Revenue' OR gh.top_category = 'Other Income') AND a.timestamp >= $__from/1000 AND a.timestamp <= $__to/1000;",
529
- "description": "Filter the dashboard by transaction group.\n\nSelect one or more groups to view revenue for specific categories, or 'All' to include every group.",
545
+ "definition": "SELECT DISTINCT txgroup_name FROM usdvalue_presum_revenue WHERE top_category IN (${TopLevel:sqlstring}) AND timestamp >= $__from/1000 AND timestamp <= $__to/1000;",
546
+ "description": "Filter the dashboard by transaction group within the selected top-level categories.",
530
547
  "includeAll": true,
548
+ "multi": true,
531
549
  "label": "Tx Group",
532
550
  "name": "Txgroup",
533
551
  "options": [],
534
- "query": "SELECT DISTINCT t.name FROM treasury_txs a INNER JOIN txgroup_hierarchy gh ON a.txgroup_id = gh.txgroup_id LEFT JOIN txgroups t ON gh.txgroup_id = t.txgroup_id WHERE (gh.top_category = 'Revenue' OR gh.top_category = 'Other Income') AND a.timestamp >= $__from/1000 AND a.timestamp <= $__to/1000;",
552
+ "query": "SELECT DISTINCT txgroup_name FROM usdvalue_presum_revenue WHERE top_category IN (${TopLevel:sqlstring}) AND timestamp >= $__from/1000 AND timestamp <= $__to/1000;",
535
553
  "refresh": 2,
536
554
  "regex": "",
537
555
  "sort": 5,
@@ -547,5 +565,5 @@
547
565
  "timezone": "",
548
566
  "title": "Revenue Over Time",
549
567
  "uid": "5284bb56-b9fb-4f36-b971-eb125bfdac7d",
550
- "version": 11
568
+ "version": 19
551
569
  }
@@ -22,10 +22,7 @@
22
22
  "links": [],
23
23
  "panels": [
24
24
  {
25
- "datasource": {
26
- "type": "frser-sqlite-datasource",
27
- "uid": "P2D2EEF3E092AF52B"
28
- },
25
+ "datasource": "PostgreSQL",
29
26
  "description": "Displays all LlamaPay payment streams managed by the DAO, including stream ID, factory, start/end block, token, sender, recipient, reason, budget request, amount per second, status, and transaction group.\n\nData Links: Click on addresses or blocks to view them on Etherscan. Click on a budget request to view the related Github issue.",
30
27
  "fieldConfig": {
31
28
  "defaults": {
@@ -185,13 +182,9 @@
185
182
  "pluginVersion": "12.1.1",
186
183
  "targets": [
187
184
  {
188
- "datasource": {
189
- "type": "frser-sqlite-datasource",
190
- "uid": "P2D2EEF3E092AF52B"
191
- },
192
- "queryText": "SELECT\n stream_id as \"Stream ID\",\n b.address as \"Factory\",\n start_block as \"Start Block\",\n end_block as \"End Block\",\n c.symbol as \"Token\",\n d.address as \"From\",\n e.address as \"To\",\n reason as \"Reason\",\n CASE\n WHEN reason LIKE 'gh-%' AND\n -- ensures all after \"gh-\" is digits\n REPLACE(SUBSTR(reason, 4), '0', '') >= '' AND\n CAST(SUBSTR(reason, 4) AS INTEGER) || '' = SUBSTR(reason, 4)\n THEN CAST(SUBSTR(reason, 4) AS INTEGER)\n ELSE NULL\n END AS \"Budget Request\",\n amount_per_second as \"Amount Per Second\",\n status as \"Status\",\n txgroup as \"TxGroup\"\n\nFROM streams a\nLEFT JOIN addresses b ON a.contract = b.address_id\nLEFT JOIN tokens c ON a.token = c.token_id\nLEFT JOIN addresses d ON a.from_address = d.address_id\nLEFT JOIN addresses e ON a.to_address = e.address_id",
193
- "queryType": "table",
194
- "rawQueryText": "SELECT\n stream_id as \"Stream ID\",\n b.address as \"Factory\",\n start_block as \"Start Block\",\n end_block as \"End Block\",\n c.symbol as \"Token\",\n d.address as \"From\",\n e.address as \"To\",\n reason as \"Reason\",\n CASE\n WHEN reason LIKE 'gh-%' AND\n -- ensures all after \"gh-\" is digits\n REPLACE(SUBSTR(reason, 4), '0', '') >= '' AND\n CAST(SUBSTR(reason, 4) AS INTEGER) || '' = SUBSTR(reason, 4)\n THEN CAST(SUBSTR(reason, 4) AS INTEGER)\n ELSE NULL\n END AS \"Budget Request\",\n amount_per_second as \"Amount Per Second\",\n status as \"Status\",\n txgroup as \"TxGroup\"\n\nFROM streams a\nLEFT JOIN addresses b ON a.contract = b.address_id\nLEFT JOIN tokens c ON a.token = c.token_id\nLEFT JOIN addresses d ON a.from_address = d.address_id\nLEFT JOIN addresses e ON a.to_address = e.address_id",
185
+ "datasource": "PostgreSQL",
186
+ "format": "table",
187
+ "rawSql": "SELECT\n stream_id as \"Stream ID\",\n b.address as \"Factory\",\n start_block as \"Start Block\",\n end_block as \"End Block\",\n c.symbol as \"Token\",\n d.address as \"From\",\n e.address as \"To\",\n reason as \"Reason\",\n CASE\n WHEN reason LIKE 'gh-%' AND\n -- ensures all after \"gh-\" is digits\n REPLACE(SUBSTR(reason, 4), '0', '') >= '' AND\n CAST(SUBSTR(reason, 4) AS INTEGER) || '' = SUBSTR(reason, 4)\n THEN CAST(SUBSTR(reason, 4) AS INTEGER)\n ELSE NULL\n END AS \"Budget Request\",\n amount_per_second as \"Amount Per Second\",\n status as \"Status\",\n txgroup as \"TxGroup\"\n\nFROM streams a\nLEFT JOIN addresses b ON a.contract = b.address_id\nLEFT JOIN tokens c ON a.token = c.token_id\nLEFT JOIN addresses d ON a.from_address = d.address_id\nLEFT JOIN addresses e ON a.to_address = e.address_id",
195
188
  "refId": "A",
196
189
  "timeColumns": ["time", "ts"]
197
190
  }
@@ -216,5 +209,5 @@
216
209
  "title": "LlamaPay",
217
210
  "description": "A simple dashboard with a comprehensive view of all LlamaPay payment streams managed by the DAO, including stream status, participants, configuration, and transaction group.",
218
211
  "uid": "aa4d62a2-9e52-4acc-8f38-a96c77810aca",
219
- "version": 3
212
+ "version": 5
220
213
  }
@@ -20,7 +20,7 @@
20
20
  "links": [],
21
21
  "panels": [
22
22
  {
23
- "datasource": "SQLite",
23
+ "datasource": "PostgreSQL",
24
24
  "description": "Displays a table of monthly profit and loss for the DAO, including Revenue, Cost of Revenue, Expenses, Other Income, Other Expense, Sorted Net, Unsorted Income, Unsorted Expense.\n\nUseful for high-level financial reporting and tracking the progress of transaction categorization.\n\nClick on any underlined cell value to see all transactions for that transaction group and time period.\n\nYou can download this table as a CSV. Click on the three dots in the upper right corner, navigate \"Inspect\" -> \"Data\", select your desired options and click \"Download CSV\".",
25
25
  "fieldConfig": {
26
26
  "defaults": {
@@ -338,10 +338,9 @@
338
338
  "pluginVersion": "12.2.1",
339
339
  "targets": [
340
340
  {
341
- "datasource": "SQLite",
342
- "queryText": "SELECT\n month AS \"Month\",\n SUM(CASE WHEN s.top_category = 'Revenue' THEN value_usd ELSE 0 END) AS \"Revenue\",\n SUM(CASE WHEN s.top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END) AS \"Cost of Revenue\",\n SUM(CASE WHEN s.top_category = 'Expenses' THEN value_usd ELSE 0 END) AS \"Expenses\",\n (\n SUM(CASE WHEN s.top_category = 'Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Expenses' THEN value_usd ELSE 0 END)\n ) AS \"Operating Net\",\n SUM(CASE WHEN s.top_category = 'Other Income' THEN value_usd ELSE 0 END) AS \"Other Income\",\n SUM(CASE WHEN s.top_category = 'Other Expenses' THEN value_usd ELSE 0 END) AS \"Other Expenses\",\n (\n SUM(CASE WHEN s.top_category = 'Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Expenses' THEN value_usd ELSE 0 END)\n + SUM(CASE WHEN s.top_category = 'Other Income' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Other Expenses' THEN value_usd ELSE 0 END)\n ) AS \"Sorted Net\",\n SUM(CASE WHEN s.top_category = 'Sort Me (Inbound)' THEN value_usd ELSE 0 END) AS \"Unsorted Income\",\n SUM(CASE WHEN s.top_category = 'Sort Me (Outbound)' THEN value_usd ELSE 0 END) AS \"Unsorted Expenses\",\n (\n SUM(CASE WHEN s.top_category = 'Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Expenses' THEN value_usd ELSE 0 END)\n + SUM(CASE WHEN s.top_category = 'Other Income' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Other Expenses' THEN value_usd ELSE 0 END)\n + SUM(CASE WHEN s.top_category = 'Sort Me (Inbound)' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Sort Me (Outbound)' THEN value_usd ELSE 0 END)\n ) AS \"Net\",\n -- Month Start as UNIX timestamp (midnight on the first day)\n CAST(strftime('%s', month || '-01') * 1000 AS TEXT) AS \"month_start\",\n -- Month End as UNIX timestamp (one millisecond before the next month starts)\n CAST(strftime('%s', date(month || '-01', '+1 month')) * 1000 - 1 AS TEXT) AS \"month_end\"\nFROM (\n SELECT\n strftime('%Y-%m', datetime(t.timestamp, 'unixepoch')) AS month,\n gh.top_category,\n COALESCE(t.value_usd, 0) AS value_usd\n FROM treasury_txs AS t\n JOIN txgroups AS tg ON t.txgroup_id = tg.txgroup_id\n JOIN txgroup_hierarchy AS gh ON tg.txgroup_id = gh.txgroup_id\n WHERE t.timestamp >= strftime('%s', '2025-01-01') AND tg.name <> 'Ignore'\n) AS s\nGROUP BY month;",
343
- "queryType": "table",
344
- "rawQueryText": "SELECT\n month AS \"Month\",\n SUM(CASE WHEN s.top_category = 'Revenue' THEN value_usd ELSE 0 END) AS \"Revenue\",\n SUM(CASE WHEN s.top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END) AS \"Cost of Revenue\",\n SUM(CASE WHEN s.top_category = 'Expenses' THEN value_usd ELSE 0 END) AS \"Expenses\",\n (\n SUM(CASE WHEN s.top_category = 'Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Expenses' THEN value_usd ELSE 0 END)\n ) AS \"Operating Net\",\n SUM(CASE WHEN s.top_category = 'Other Income' THEN value_usd ELSE 0 END) AS \"Other Income\",\n SUM(CASE WHEN s.top_category = 'Other Expenses' THEN value_usd ELSE 0 END) AS \"Other Expenses\",\n (\n SUM(CASE WHEN s.top_category = 'Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Expenses' THEN value_usd ELSE 0 END)\n + SUM(CASE WHEN s.top_category = 'Other Income' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Other Expenses' THEN value_usd ELSE 0 END)\n ) AS \"Sorted Net\",\n SUM(CASE WHEN s.top_category = 'Sort Me (Inbound)' THEN value_usd ELSE 0 END) AS \"Unsorted Income\",\n SUM(CASE WHEN s.top_category = 'Sort Me (Outbound)' THEN value_usd ELSE 0 END) AS \"Unsorted Expenses\",\n (\n SUM(CASE WHEN s.top_category = 'Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Expenses' THEN value_usd ELSE 0 END)\n + SUM(CASE WHEN s.top_category = 'Other Income' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Other Expenses' THEN value_usd ELSE 0 END)\n + SUM(CASE WHEN s.top_category = 'Sort Me (Inbound)' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Sort Me (Outbound)' THEN value_usd ELSE 0 END)\n ) AS \"Net\",\n -- Month Start as UNIX timestamp (midnight on the first day)\n CAST(strftime('%s', month || '-01') * 1000 AS TEXT) AS \"month_start\",\n -- Month End as UNIX timestamp (one millisecond before the next month starts)\n CAST(strftime('%s', date(month || '-01', '+1 month')) * 1000 - 1 AS TEXT) AS \"month_end\"\nFROM (\n SELECT\n strftime('%Y-%m', datetime(t.timestamp, 'unixepoch')) AS month,\n gh.top_category,\n COALESCE(t.value_usd, 0) AS value_usd\n FROM treasury_txs AS t\n JOIN txgroups AS tg ON t.txgroup_id = tg.txgroup_id\n JOIN txgroup_hierarchy AS gh ON tg.txgroup_id = gh.txgroup_id\n WHERE t.timestamp >= strftime('%s', '2025-01-01') AND tg.name <> 'Ignore'\n) AS s\nGROUP BY month;",
341
+ "datasource": "PostgreSQL",
342
+ "format": "table",
343
+ "rawSql": "SELECT\n month AS \"Month\",\n SUM(CASE WHEN s.top_category = 'Revenue' THEN value_usd ELSE 0 END) AS \"Revenue\",\n SUM(CASE WHEN s.top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END) AS \"Cost of Revenue\",\n SUM(CASE WHEN s.top_category = 'Expenses' THEN value_usd ELSE 0 END) AS \"Expenses\",\n (\n SUM(CASE WHEN s.top_category = 'Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Expenses' THEN value_usd ELSE 0 END)\n ) AS \"Operating Net\",\n SUM(CASE WHEN s.top_category = 'Other Income' THEN value_usd ELSE 0 END) AS \"Other Income\",\n SUM(CASE WHEN s.top_category = 'Other Expenses' THEN value_usd ELSE 0 END) AS \"Other Expenses\",\n (\n SUM(CASE WHEN s.top_category = 'Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Expenses' THEN value_usd ELSE 0 END)\n + SUM(CASE WHEN s.top_category = 'Other Income' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Other Expenses' THEN value_usd ELSE 0 END)\n ) AS \"Sorted Net\",\n SUM(CASE WHEN s.top_category = 'Sort Me (Inbound)' THEN value_usd ELSE 0 END) AS \"Unsorted Income\",\n SUM(CASE WHEN s.top_category = 'Sort Me (Outbound)' THEN value_usd ELSE 0 END) AS \"Unsorted Expenses\",\n (\n SUM(CASE WHEN s.top_category = 'Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Expenses' THEN value_usd ELSE 0 END)\n + SUM(CASE WHEN s.top_category = 'Other Income' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Other Expenses' THEN value_usd ELSE 0 END)\n + SUM(CASE WHEN s.top_category = 'Sort Me (Inbound)' THEN value_usd ELSE 0 END)\n - SUM(CASE WHEN s.top_category = 'Sort Me (Outbound)' THEN value_usd ELSE 0 END)\n ) AS \"Net\",\n -- Month Start as UNIX timestamp (midnight on the first day)\n CAST(EXTRACT(EPOCH FROM (to_date(month || '-01', 'YYYY-MM-DD'))) * 1000 AS TEXT) AS \"month_start\",\n -- Month End as UNIX timestamp (one millisecond before the next month starts)\n CAST(EXTRACT(EPOCH FROM (to_date(month || '-01', 'YYYY-MM-DD') + INTERVAL '1 month' - INTERVAL '1 millisecond')) * 1000 AS TEXT) AS \"month_end\"\nFROM (\n SELECT\n to_char(to_timestamp(t.timestamp), 'YYYY-MM') AS month,\n gh.top_category,\n COALESCE(t.value_usd, 0) AS value_usd\n FROM treasury_txs AS t\n JOIN txgroups AS tg ON t.txgroup_id = tg.txgroup_id\n JOIN txgroup_hierarchy AS gh ON tg.txgroup_id = gh.txgroup_id\n WHERE t.timestamp >= EXTRACT(EPOCH FROM TIMESTAMP '2025-01-01') AND tg.name <> 'Ignore'\n) AS s\nGROUP BY month;",
345
344
  "refId": "A",
346
345
  "timeColumns": ["time", "ts"]
347
346
  }
@@ -365,5 +364,5 @@
365
364
  "timezone": "",
366
365
  "title": "Monthly P&L",
367
366
  "uid": "a63fa9a7-d4f3-4092-9bde-194add8bcbeb",
368
- "version": 6
367
+ "version": 9
369
368
  }