dao-treasury 0.0.17__cp312-cp312-win32.whl → 0.0.61__cp312-cp312-win32.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 (56) hide show
  1. dao_treasury/.grafana/provisioning/dashboards/breakdowns/Expenses.json +526 -0
  2. dao_treasury/.grafana/provisioning/dashboards/breakdowns/Revenue.json +526 -0
  3. dao_treasury/.grafana/provisioning/dashboards/dashboards.yaml +76 -2
  4. dao_treasury/.grafana/provisioning/dashboards/streams/LlamaPay.json +225 -0
  5. dao_treasury/.grafana/provisioning/dashboards/summary/Monthly.json +13 -17
  6. dao_treasury/.grafana/provisioning/dashboards/transactions/Treasury Transactions.json +167 -19
  7. dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow (Including Unsorted).json +876 -0
  8. dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow.json +645 -0
  9. dao_treasury/.grafana/provisioning/dashboards/treasury/Current Treasury Assets.json +593 -0
  10. dao_treasury/.grafana/provisioning/dashboards/treasury/Historical Treasury Balances.json +2999 -0
  11. dao_treasury/.grafana/provisioning/dashboards/treasury/Operating Cashflow.json +513 -0
  12. dao_treasury/.grafana/provisioning/datasources/datasources.yaml +17 -0
  13. dao_treasury/ENVIRONMENT_VARIABLES.py +20 -0
  14. dao_treasury/__init__.py +24 -0
  15. dao_treasury/_docker.cp312-win32.pyd +0 -0
  16. dao_treasury/_docker.py +48 -23
  17. dao_treasury/_nicknames.cp312-win32.pyd +0 -0
  18. dao_treasury/_nicknames.py +32 -0
  19. dao_treasury/_wallet.cp312-win32.pyd +0 -0
  20. dao_treasury/_wallet.py +162 -10
  21. dao_treasury/constants.cp312-win32.pyd +0 -0
  22. dao_treasury/constants.py +39 -0
  23. dao_treasury/db.py +429 -57
  24. dao_treasury/docker-compose.yaml +6 -5
  25. dao_treasury/main.py +102 -13
  26. dao_treasury/sorting/__init__.cp312-win32.pyd +0 -0
  27. dao_treasury/sorting/__init__.py +181 -105
  28. dao_treasury/sorting/_matchers.cp312-win32.pyd +0 -0
  29. dao_treasury/sorting/_rules.cp312-win32.pyd +0 -0
  30. dao_treasury/sorting/_rules.py +1 -3
  31. dao_treasury/sorting/factory.cp312-win32.pyd +0 -0
  32. dao_treasury/sorting/factory.py +2 -6
  33. dao_treasury/sorting/rule.cp312-win32.pyd +0 -0
  34. dao_treasury/sorting/rule.py +16 -13
  35. dao_treasury/sorting/rules/__init__.cp312-win32.pyd +0 -0
  36. dao_treasury/sorting/rules/__init__.py +1 -0
  37. dao_treasury/sorting/rules/ignore/__init__.cp312-win32.pyd +0 -0
  38. dao_treasury/sorting/rules/ignore/__init__.py +1 -0
  39. dao_treasury/sorting/rules/ignore/llamapay.cp312-win32.pyd +0 -0
  40. dao_treasury/sorting/rules/ignore/llamapay.py +20 -0
  41. dao_treasury/streams/__init__.cp312-win32.pyd +0 -0
  42. dao_treasury/streams/__init__.py +0 -0
  43. dao_treasury/streams/llamapay.cp312-win32.pyd +0 -0
  44. dao_treasury/streams/llamapay.py +388 -0
  45. dao_treasury/treasury.py +75 -28
  46. dao_treasury/types.cp312-win32.pyd +0 -0
  47. dao_treasury-0.0.61.dist-info/METADATA +120 -0
  48. dao_treasury-0.0.61.dist-info/RECORD +54 -0
  49. dao_treasury-0.0.61.dist-info/top_level.txt +2 -0
  50. dao_treasury__mypyc.cp312-win32.pyd +0 -0
  51. 52b51d40e96d4333695d__mypyc.cp312-win32.pyd +0 -0
  52. dao_treasury/.grafana/provisioning/datasources/sqlite.yaml +0 -10
  53. dao_treasury-0.0.17.dist-info/METADATA +0 -36
  54. dao_treasury-0.0.17.dist-info/RECORD +0 -30
  55. dao_treasury-0.0.17.dist-info/top_level.txt +0 -2
  56. {dao_treasury-0.0.17.dist-info → dao_treasury-0.0.61.dist-info}/WHEEL +0 -0
@@ -0,0 +1,225 @@
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": 0,
21
+ "id": 11,
22
+ "links": [],
23
+ "panels": [
24
+ {
25
+ "datasource": {
26
+ "type": "frser-sqlite-datasource",
27
+ "uid": "P2D2EEF3E092AF52B"
28
+ },
29
+ "description": "",
30
+ "fieldConfig": {
31
+ "defaults": {
32
+ "color": {
33
+ "mode": "thresholds"
34
+ },
35
+ "custom": {
36
+ "align": "auto",
37
+ "cellOptions": {
38
+ "type": "auto"
39
+ },
40
+ "inspect": false
41
+ },
42
+ "mappings": [],
43
+ "thresholds": {
44
+ "mode": "absolute",
45
+ "steps": [
46
+ {
47
+ "color": "green",
48
+ "value": 0
49
+ },
50
+ {
51
+ "color": "red",
52
+ "value": 80
53
+ }
54
+ ]
55
+ }
56
+ },
57
+ "overrides": [
58
+ {
59
+ "matcher": {
60
+ "id": "byName",
61
+ "options": "Factory"
62
+ },
63
+ "properties": [
64
+ {
65
+ "id": "links",
66
+ "value": [
67
+ {
68
+ "targetBlank": true,
69
+ "title": "View on Etherscan",
70
+ "url": "https://etherscan.io/address/${__value.raw}"
71
+ }
72
+ ]
73
+ }
74
+ ]
75
+ },
76
+ {
77
+ "matcher": {
78
+ "id": "byName",
79
+ "options": "From"
80
+ },
81
+ "properties": [
82
+ {
83
+ "id": "links",
84
+ "value": [
85
+ {
86
+ "targetBlank": true,
87
+ "title": "View on Etherscan",
88
+ "url": "https://etherscan.io/address/${__value.raw}"
89
+ }
90
+ ]
91
+ }
92
+ ]
93
+ },
94
+ {
95
+ "matcher": {
96
+ "id": "byName",
97
+ "options": "To"
98
+ },
99
+ "properties": [
100
+ {
101
+ "id": "links",
102
+ "value": [
103
+ {
104
+ "targetBlank": true,
105
+ "title": "View on Etherscan",
106
+ "url": "https://etherscan.io/address/${__value.raw}"
107
+ }
108
+ ]
109
+ }
110
+ ]
111
+ },
112
+ {
113
+ "matcher": {
114
+ "id": "byName",
115
+ "options": "Start Block"
116
+ },
117
+ "properties": [
118
+ {
119
+ "id": "links",
120
+ "value": [
121
+ {
122
+ "targetBlank": true,
123
+ "title": "View on Etherscan",
124
+ "url": "https://etherscan.io/block/${__value.raw}"
125
+ }
126
+ ]
127
+ }
128
+ ]
129
+ },
130
+ {
131
+ "matcher": {
132
+ "id": "byName",
133
+ "options": "End Block"
134
+ },
135
+ "properties": [
136
+ {
137
+ "id": "links",
138
+ "value": [
139
+ {
140
+ "targetBlank": true,
141
+ "title": "View on Etherscan",
142
+ "url": "https://etherscan.io/block/${__value.raw}"
143
+ }
144
+ ]
145
+ }
146
+ ]
147
+ },
148
+ {
149
+ "matcher": {
150
+ "id": "byName",
151
+ "options": "Budget Request"
152
+ },
153
+ "properties": [
154
+ {
155
+ "id": "links",
156
+ "value": [
157
+ {
158
+ "targetBlank": true,
159
+ "title": "View Budget Request on Github",
160
+ "url": "https://github.com/yearn/budget/issues/${__value.raw}"
161
+ }
162
+ ]
163
+ }
164
+ ]
165
+ }
166
+ ]
167
+ },
168
+ "gridPos": {
169
+ "h": 19,
170
+ "w": 24,
171
+ "x": 0,
172
+ "y": 0
173
+ },
174
+ "id": 1,
175
+ "options": {
176
+ "cellHeight": "sm",
177
+ "footer": {
178
+ "countRows": false,
179
+ "fields": "",
180
+ "reducer": [
181
+ "sum"
182
+ ],
183
+ "show": false
184
+ },
185
+ "showHeader": true
186
+ },
187
+ "pluginVersion": "12.1.1",
188
+ "targets": [
189
+ {
190
+ "datasource": {
191
+ "type": "frser-sqlite-datasource",
192
+ "uid": "P2D2EEF3E092AF52B"
193
+ },
194
+ "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",
195
+ "queryType": "table",
196
+ "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",
197
+ "refId": "A",
198
+ "timeColumns": [
199
+ "time",
200
+ "ts"
201
+ ]
202
+ }
203
+ ],
204
+ "title": "LlamaPay Streams",
205
+ "type": "table"
206
+ }
207
+ ],
208
+ "preload": false,
209
+ "refresh": "",
210
+ "schemaVersion": 41,
211
+ "tags": [],
212
+ "templating": {
213
+ "list": []
214
+ },
215
+ "time": {
216
+ "from": "now-6h",
217
+ "to": "now"
218
+ },
219
+ "timepicker": {},
220
+ "timezone": "",
221
+ "title": "LlamaPay",
222
+ "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.",
223
+ "uid": "aa4d62a2-9e52-4acc-8f38-a96c77810aca",
224
+ "version": 1
225
+ }
@@ -17,7 +17,6 @@
17
17
  "graphTooltip": 0,
18
18
  "id": 2,
19
19
  "links": [],
20
- "liveNow": false,
21
20
  "panels": [
22
21
  {
23
22
  "datasource": "SQLite",
@@ -39,7 +38,7 @@
39
38
  "steps": [
40
39
  {
41
40
  "color": "green",
42
- "value": null
41
+ "value": 0
43
42
  },
44
43
  {
45
44
  "color": "red",
@@ -71,42 +70,39 @@
71
70
  "sortBy": [
72
71
  {
73
72
  "desc": true,
74
- "displayName": "month"
73
+ "displayName": "Month"
75
74
  }
76
75
  ]
77
76
  },
78
- "pluginVersion": "10.2.0",
77
+ "pluginVersion": "12.1.1",
79
78
  "targets": [
80
79
  {
81
80
  "datasource": "SQLite",
82
- "queryText": "SELECT\n month,\n SUM(CASE WHEN top_category = 'Revenue' THEN value_usd ELSE 0 END) AS revenue,\n SUM(CASE WHEN top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END) AS \"cost of revenue\",\n SUM(CASE WHEN top_category = 'Expenses' THEN value_usd ELSE 0 END) AS expenses,\n SUM(CASE WHEN top_category = 'Other Income' THEN value_usd ELSE 0 END) AS \"other income\",\n SUM(CASE WHEN top_category = 'Other Expenses' THEN value_usd ELSE 0 END) AS \"other expense\",\n (\n SUM(CASE WHEN top_category = 'Revenue' THEN value_usd ELSE 0 END) -\n SUM(CASE WHEN top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END) -\n SUM(CASE WHEN top_category = 'Expenses' THEN value_usd ELSE 0 END) +\n SUM(CASE WHEN top_category = 'Other Income' THEN value_usd ELSE 0 END) -\n SUM(CASE WHEN top_category = 'Other Expenses' THEN value_usd ELSE 0 END)\n ) AS \"sorted net\",\n SUM(CASE WHEN top_category = 'Sort Me (Inbound)' THEN value_usd ELSE 0 END) AS \"unsorted income\",\n SUM(CASE WHEN top_category = 'Sort Me (Outbound)' THEN value_usd ELSE 0 END) AS \"unsorted expense\",\n (\n SUM(CASE WHEN top_category = 'Revenue' THEN value_usd ELSE 0 END) -\n SUM(CASE WHEN top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END) -\n SUM(CASE WHEN top_category = 'Expenses' THEN value_usd ELSE 0 END) +\n SUM(CASE WHEN top_category = 'Other Income' THEN value_usd ELSE 0 END) -\n SUM(CASE WHEN top_category = 'Other Expenses' THEN value_usd ELSE 0 END) +\n SUM(CASE WHEN top_category = 'Sort Me (Inbound)' THEN value_usd ELSE 0 END) -\n SUM(CASE WHEN top_category = 'Sort Me (Outbound)' THEN value_usd ELSE 0 END)\n ) AS net\nFROM (\n SELECT\n strftime('%Y-%m', datetime(t.timestamp, 'unixepoch')) AS month,\n CASE\n WHEN p.name IS NOT NULL THEN p.name\n ELSE tg.name\n END AS top_category,\n COALESCE(t.value_usd, 0) AS value_usd\n --COALESCE(t.gas_used, 0) * COALESCE(t.gas_price, 0) AS gas_cost\n FROM treasury_txs t\n JOIN txgroups tg ON t.txgroup_id = tg.txgroup_id\n LEFT JOIN txgroups p ON tg.parent_txgroup = p.txgroup_id\n WHERE t.timestamp >= strftime('%s', '2025-01-01') and tg.name <> 'Ignore'\n) as s\nGROUP BY month;",
81
+ "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 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 Expense\",\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 Expense\",\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\"\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 >= $__from / 1000 AND tg.name <> 'Ignore'\n) AS s\nGROUP BY month;",
83
82
  "queryType": "table",
84
- "rawQueryText": "SELECT\n month,\n SUM(CASE WHEN top_category = 'Revenue' THEN value_usd ELSE 0 END) AS revenue,\n SUM(CASE WHEN top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END) AS \"cost of revenue\",\n SUM(CASE WHEN top_category = 'Expenses' THEN value_usd ELSE 0 END) AS expenses,\n SUM(CASE WHEN top_category = 'Other Income' THEN value_usd ELSE 0 END) AS \"other income\",\n SUM(CASE WHEN top_category = 'Other Expenses' THEN value_usd ELSE 0 END) AS \"other expense\",\n (\n SUM(CASE WHEN top_category = 'Revenue' THEN value_usd ELSE 0 END) -\n SUM(CASE WHEN top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END) -\n SUM(CASE WHEN top_category = 'Expenses' THEN value_usd ELSE 0 END) +\n SUM(CASE WHEN top_category = 'Other Income' THEN value_usd ELSE 0 END) -\n SUM(CASE WHEN top_category = 'Other Expenses' THEN value_usd ELSE 0 END)\n ) AS \"sorted net\",\n SUM(CASE WHEN top_category = 'Sort Me (Inbound)' THEN value_usd ELSE 0 END) AS \"unsorted income\",\n SUM(CASE WHEN top_category = 'Sort Me (Outbound)' THEN value_usd ELSE 0 END) AS \"unsorted expense\",\n (\n SUM(CASE WHEN top_category = 'Revenue' THEN value_usd ELSE 0 END) -\n SUM(CASE WHEN top_category = 'Cost of Revenue' THEN value_usd ELSE 0 END) -\n SUM(CASE WHEN top_category = 'Expenses' THEN value_usd ELSE 0 END) +\n SUM(CASE WHEN top_category = 'Other Income' THEN value_usd ELSE 0 END) -\n SUM(CASE WHEN top_category = 'Other Expenses' THEN value_usd ELSE 0 END) +\n SUM(CASE WHEN top_category = 'Sort Me (Inbound)' THEN value_usd ELSE 0 END) -\n SUM(CASE WHEN top_category = 'Sort Me (Outbound)' THEN value_usd ELSE 0 END)\n ) AS net\nFROM (\n SELECT\n strftime('%Y-%m', datetime(t.timestamp, 'unixepoch')) AS month,\n CASE\n WHEN p.name IS NOT NULL THEN p.name\n ELSE tg.name\n END AS top_category,\n COALESCE(t.value_usd, 0) AS value_usd\n --COALESCE(t.gas_used, 0) * COALESCE(t.gas_price, 0) AS gas_cost\n FROM treasury_txs t\n JOIN txgroups tg ON t.txgroup_id = tg.txgroup_id\n LEFT JOIN txgroups p ON tg.parent_txgroup = p.txgroup_id\n WHERE t.timestamp >= strftime('%s', '2025-01-01') and tg.name <> 'Ignore'\n) as s\nGROUP BY month;",
85
- "refId": "A",
86
- "timeColumns": [
87
- "time",
88
- "ts"
89
- ]
83
+ "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 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 Expense\",\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 Expense\",\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\"\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;",
84
+ "refId": "A"
90
85
  }
91
86
  ],
92
- "title": "Panel Title",
87
+ "title": "Monthly Profit & Loss",
93
88
  "type": "table"
94
89
  }
95
90
  ],
91
+ "preload": false,
96
92
  "refresh": "",
97
- "schemaVersion": 38,
93
+ "schemaVersion": 41,
98
94
  "tags": [],
99
95
  "templating": {
100
96
  "list": []
101
97
  },
102
98
  "time": {
103
- "from": "now-6h",
99
+ "from": "now/y",
104
100
  "to": "now"
105
101
  },
106
102
  "timepicker": {},
107
103
  "timezone": "",
108
104
  "title": "Monthly P&L",
105
+ "description": "Summarizes the DAO's monthly profit and loss, providing a breakdown of sorted and unsorted financial activity for each month. Supports financial reporting and tracking the progress of transaction categorization.",
109
106
  "uid": "a63fa9a7-d4f3-4092-9bde-194add8bcbeb",
110
- "version": 1,
111
- "weekStart": ""
112
- }
107
+ "version": 2
108
+ }
@@ -15,9 +15,8 @@
15
15
  "editable": true,
16
16
  "fiscalYearStartMonth": 0,
17
17
  "graphTooltip": 0,
18
- "id": 1,
18
+ "id": 9,
19
19
  "links": [],
20
- "liveNow": false,
21
20
  "panels": [
22
21
  {
23
22
  "datasource": "SQLite",
@@ -30,13 +29,14 @@
30
29
  },
31
30
  "inspect": false
32
31
  },
32
+ "decimals": 8,
33
33
  "mappings": [],
34
34
  "thresholds": {
35
35
  "mode": "absolute",
36
36
  "steps": [
37
37
  {
38
38
  "color": "green",
39
- "value": null
39
+ "value": 0
40
40
  },
41
41
  {
42
42
  "color": "red",
@@ -49,7 +49,7 @@
49
49
  {
50
50
  "matcher": {
51
51
  "id": "byName",
52
- "options": "hash"
52
+ "options": "Hash"
53
53
  },
54
54
  "properties": [
55
55
  {
@@ -67,7 +67,7 @@
67
67
  {
68
68
  "matcher": {
69
69
  "id": "byName",
70
- "options": "block"
70
+ "options": "Block"
71
71
  },
72
72
  "properties": [
73
73
  {
@@ -85,7 +85,7 @@
85
85
  {
86
86
  "matcher": {
87
87
  "id": "byName",
88
- "options": "to"
88
+ "options": "To"
89
89
  },
90
90
  "properties": [
91
91
  {
@@ -103,7 +103,7 @@
103
103
  {
104
104
  "matcher": {
105
105
  "id": "byName",
106
- "options": "from"
106
+ "options": "From"
107
107
  },
108
108
  "properties": [
109
109
  {
@@ -121,7 +121,7 @@
121
121
  {
122
122
  "matcher": {
123
123
  "id": "byName",
124
- "options": "from nickname"
124
+ "options": "From Nickname"
125
125
  },
126
126
  "properties": [
127
127
  {
@@ -130,7 +130,7 @@
130
130
  {
131
131
  "targetBlank": true,
132
132
  "title": "View on Etherscan",
133
- "url": "https://etherscan.io/address/${__data.fields.from}"
133
+ "url": "https://etherscan.io/address/${__data.fields.From}"
134
134
  }
135
135
  ]
136
136
  }
@@ -139,7 +139,7 @@
139
139
  {
140
140
  "matcher": {
141
141
  "id": "byName",
142
- "options": "to nickname"
142
+ "options": "To Nickname"
143
143
  },
144
144
  "properties": [
145
145
  {
@@ -148,11 +148,33 @@
148
148
  {
149
149
  "targetBlank": true,
150
150
  "title": "View on Etherscan",
151
- "url": "https://etherscan.io/address/${__data.fields.to}"
151
+ "url": "https://etherscan.io/address/${__data.fields.To}"
152
152
  }
153
153
  ]
154
154
  }
155
155
  ]
156
+ },
157
+ {
158
+ "matcher": {
159
+ "id": "byName",
160
+ "options": "Block"
161
+ },
162
+ "properties": [
163
+ {
164
+ "id": "decimals"
165
+ }
166
+ ]
167
+ },
168
+ {
169
+ "matcher": {
170
+ "id": "byName",
171
+ "options": "Log Index"
172
+ },
173
+ "properties": [
174
+ {
175
+ "id": "decimals"
176
+ }
177
+ ]
156
178
  }
157
179
  ]
158
180
  },
@@ -173,15 +195,21 @@
173
195
  ],
174
196
  "show": false
175
197
  },
176
- "showHeader": true
198
+ "showHeader": true,
199
+ "sortBy": [
200
+ {
201
+ "desc": true,
202
+ "displayName": "Timestamp"
203
+ }
204
+ ]
177
205
  },
178
- "pluginVersion": "10.2.0",
206
+ "pluginVersion": "12.1.1",
179
207
  "targets": [
180
208
  {
181
209
  "datasource": "SQLite",
182
- "queryText": "select chain_name as chain, timestamp, block, hash, token, \"from\", from_nickname as \"from nickname\", \"to\", to_nickname as \"to nickname\", amount, price, value_usd as \"value usd\", txgroup, parent_txgroup\nfrom (\n SELECT treasury_tx_id, b.chain_name, datetime(a.timestamp, 'unixepoch') AS timestamp, a.block, a.hash, a.log_index, c.symbol AS token, d.address AS \"from\", d.nickname as from_nickname, e.address AS \"to\", e.nickname as to_nickname, a.amount, a.price, a.value_usd, f.name AS txgroup, g.name AS parent_txgroup, f.txgroup_id\n FROM treasury_txs a\n LEFT JOIN chains b ON a.chain = b.chain_dbid\n LEFT JOIN tokens c ON a.token_id = c.token_id\n LEFT JOIN addresses d ON a.\"from\" = d.address_id\n LEFT JOIN addresses e ON a.\"to\" = e.address_id\n LEFT JOIN txgroups f ON a.txgroup_id = f.txgroup_id\n LEFT JOIN txgroups g ON f.parent_txgroup = g.txgroup_id\n WHERE a.timestamp >= $__from / 1000 and a.timestamp < $__to / 1000\n --UNION\n --SELECT -1, chain_name, TIMESTAMP, cast(block AS integer) block, hash, CAST(log_index AS integer) as log_index, token, \"from\", from_nickname, \"to\", to_nickname, amount, price, value_usd, txgroup, parent_txgroup, txgroup_id\n --FROM stream_ledger\n --UNION\n --SELECT -1, *\n --FROM vesting_ledger \n) a\nORDER BY timestamp",
210
+ "queryText": "select timestamp as \"Timestamp\", block as \"Block\", hash as \"Hash\", token as \"Token\", \"from\" as \"From\", from_nickname as \"From Nickname\", \"to\" as \"To\", to_nickname as \"To Nickname\", amount as \"Amount\", price as \"Price\", value_usd as \"Value USD\", txgroup as \"TxGroup\", a.parent_txgroup as \"Parent TxGroup\", log_index as \"Log Index\" from ( SELECT datetime(a.timestamp, 'unixepoch') AS timestamp, a.block, a.hash, c.symbol AS token, d.address AS \"from\", d.nickname as from_nickname, e.address AS \"to\", e.nickname as to_nickname, a.amount, a.price, a.value_usd, f.name AS txgroup, g.name AS parent_txgroup, f.txgroup_id, a.log_index FROM treasury_txs a LEFT JOIN chains b ON a.chain = b.chain_dbid LEFT JOIN tokens c ON a.token_id = c.token_id LEFT JOIN addresses d ON a.\"from\" = d.address_id LEFT JOIN addresses e ON a.\"to\" = e.address_id LEFT JOIN txgroups f ON a.txgroup_id = f.txgroup_id LEFT JOIN txgroups g ON f.parent_txgroup = g.txgroup_id WHERE a.timestamp >= $__from / 1000 and a.timestamp < $__to / 1000 and ('$Chain' like '{%' or b.chain_name = '$Chain') and ('$Token' like '{%' or c.symbol = '$Token') and ('$From' like '{%' or d.address = '$From') and ('$To' like '{%' or e.address = '$To') and ('$FromNickname' like '{%' or d.nickname = '$FromNickname') and ('$ToNickname' like '{%' or e.nickname = '$ToNickname') ) a left join txgroup_hierarchy b on a.txgroup_id = b.txgroup_id WHERE ('$Top' LIKE '{%' OR b.top_category = '$Top') ORDER BY timestamp",
183
211
  "queryType": "table",
184
- "rawQueryText": "select chain_name as chain, timestamp, block, hash, token, \"from\", from_nickname as \"from nickname\", \"to\", to_nickname as \"to nickname\", amount, price, value_usd as \"value usd\", txgroup, parent_txgroup\nfrom (\n SELECT treasury_tx_id, b.chain_name, datetime(a.timestamp, 'unixepoch') AS timestamp, a.block, a.hash, a.log_index, c.symbol AS token, d.address AS \"from\", d.nickname as from_nickname, e.address AS \"to\", e.nickname as to_nickname, a.amount, a.price, a.value_usd, f.name AS txgroup, g.name AS parent_txgroup, f.txgroup_id\n FROM treasury_txs a\n LEFT JOIN chains b ON a.chain = b.chain_dbid\n LEFT JOIN tokens c ON a.token_id = c.token_id\n LEFT JOIN addresses d ON a.\"from\" = d.address_id\n LEFT JOIN addresses e ON a.\"to\" = e.address_id\n LEFT JOIN txgroups f ON a.txgroup_id = f.txgroup_id\n LEFT JOIN txgroups g ON f.parent_txgroup = g.txgroup_id\n WHERE a.timestamp >= $__from / 1000 and a.timestamp < $__to / 1000\n --UNION\n --SELECT -1, chain_name, TIMESTAMP, cast(block AS integer) block, hash, CAST(log_index AS integer) as log_index, token, \"from\", from_nickname, \"to\", to_nickname, amount, price, value_usd, txgroup, parent_txgroup, txgroup_id\n --FROM stream_ledger\n --UNION\n --SELECT -1, *\n --FROM vesting_ledger \n) a\nORDER BY timestamp",
212
+ "rawQueryText": "select timestamp as \"Timestamp\", block as \"Block\", hash as \"Hash\", token as \"Token\", \"from\" as \"From\", from_nickname as \"From Nickname\", \"to\" as \"To\", to_nickname as \"To Nickname\", amount as \"Amount\", price as \"Price\", value_usd as \"Value USD\", txgroup as \"TxGroup\", a.parent_txgroup as \"Parent TxGroup\", log_index as \"Log Index\" from ( SELECT datetime(a.timestamp, 'unixepoch') AS timestamp, a.block, a.hash, c.symbol AS token, d.address AS \"from\", d.nickname as from_nickname, e.address AS \"to\", e.nickname as to_nickname, a.amount, a.price, a.value_usd, f.name AS txgroup, g.name AS parent_txgroup, f.txgroup_id, a.log_index FROM treasury_txs a LEFT JOIN chains b ON a.chain = b.chain_dbid LEFT JOIN tokens c ON a.token_id = c.token_id LEFT JOIN addresses d ON a.\"from\" = d.address_id LEFT JOIN addresses e ON a.\"to\" = e.address_id LEFT JOIN txgroups f ON a.txgroup_id = f.txgroup_id LEFT JOIN txgroups g ON f.parent_txgroup = g.txgroup_id WHERE a.timestamp >= $__from / 1000 and a.timestamp < $__to / 1000 and ('$Chain' like '{%' or b.chain_name = '$Chain') and ('$Token' like '{%' or c.symbol = '$Token') and ('$From' like '{%' or d.address = '$From') and ('$To' like '{%' or e.address = '$To') and ('$FromNickname' like '{%' or d.nickname = '$FromNickname') and ('$ToNickname' like '{%' or e.nickname = '$ToNickname') ) a left join txgroup_hierarchy b on a.txgroup_id = b.txgroup_id WHERE ('$Top' LIKE '{%' OR b.top_category = '$Top') ORDER BY timestamp",
185
213
  "refId": "A",
186
214
  "timeColumns": [
187
215
  "time",
@@ -193,11 +221,131 @@
193
221
  "type": "table"
194
222
  }
195
223
  ],
224
+ "preload": false,
196
225
  "refresh": "",
197
- "schemaVersion": 38,
226
+ "schemaVersion": 41,
198
227
  "tags": [],
199
228
  "templating": {
200
- "list": []
229
+ "list": [
230
+ {
231
+ "current": {
232
+ "text": "All",
233
+ "value": "$__all"
234
+ },
235
+ "datasource": "SQLite",
236
+ "definition": "SELECT DISTINCT gh.top_category FROM treasury_txs a INNER JOIN txgroup_hierarchy gh ON a.txgroup_id = gh.txgroup_id;",
237
+ "includeAll": true,
238
+ "label": "Top Level",
239
+ "name": "Top",
240
+ "options": [],
241
+ "query": "SELECT DISTINCT gh.top_category FROM treasury_txs a INNER JOIN txgroup_hierarchy gh ON a.txgroup_id = gh.txgroup_id;",
242
+ "refresh": 2,
243
+ "regex": "",
244
+ "sort": 5,
245
+ "type": "query"
246
+ },
247
+ {
248
+ "current": {
249
+ "text": "All",
250
+ "value": "$__all"
251
+ },
252
+ "datasource": "SQLite",
253
+ "definition": "select distinct chain_name from treasury_txs a left join chains b on a.chain = b.chain_dbid",
254
+ "description": "",
255
+ "includeAll": true,
256
+ "name": "Chain",
257
+ "options": [],
258
+ "query": "select distinct chain_name from treasury_txs a left join chains b on a.chain = b.chain_dbid",
259
+ "refresh": 2,
260
+ "regex": "",
261
+ "sort": 5,
262
+ "type": "query"
263
+ },
264
+ {
265
+ "current": {
266
+ "text": "All",
267
+ "value": "$__all"
268
+ },
269
+ "datasource": "SQLite",
270
+ "definition": "select distinct symbol from treasury_txs a left join tokens b on a.token_id = b.token_id",
271
+ "includeAll": true,
272
+ "name": "Token",
273
+ "options": [],
274
+ "query": "select distinct symbol from treasury_txs a left join tokens b on a.token_id = b.token_id",
275
+ "refresh": 2,
276
+ "regex": "",
277
+ "sort": 5,
278
+ "type": "query"
279
+ },
280
+ {
281
+ "current": {
282
+ "text": "All",
283
+ "value": "$__all"
284
+ },
285
+ "datasource": "SQLite",
286
+ "definition": "select distinct address from treasury_txs a left join addresses b on a.\"from\" = b.address_id",
287
+ "includeAll": true,
288
+ "label": "From Address",
289
+ "name": "From",
290
+ "options": [],
291
+ "query": "select distinct address from treasury_txs a left join addresses b on a.\"from\" = b.address_id",
292
+ "refresh": 2,
293
+ "regex": "",
294
+ "sort": 5,
295
+ "type": "query"
296
+ },
297
+ {
298
+ "current": {
299
+ "text": "All",
300
+ "value": "$__all"
301
+ },
302
+ "datasource": "SQLite",
303
+ "definition": "select distinct nickname from treasury_txs a inner join addresses b on a.\"from\" = b.address_id",
304
+ "includeAll": true,
305
+ "label": "From Nickname",
306
+ "name": "FromNickname",
307
+ "options": [],
308
+ "query": "select distinct nickname from treasury_txs a inner join addresses b on a.\"from\" = b.address_id",
309
+ "refresh": 2,
310
+ "regex": "",
311
+ "sort": 5,
312
+ "type": "query"
313
+ },
314
+ {
315
+ "current": {
316
+ "text": "All",
317
+ "value": "$__all"
318
+ },
319
+ "datasource": "SQLite",
320
+ "definition": "select distinct address from treasury_txs a left join addresses b on a.\"to\" = b.address_id",
321
+ "includeAll": true,
322
+ "label": "To Address",
323
+ "name": "To",
324
+ "options": [],
325
+ "query": "select distinct address from treasury_txs a left join addresses b on a.\"to\" = b.address_id",
326
+ "refresh": 2,
327
+ "regex": "",
328
+ "sort": 5,
329
+ "type": "query"
330
+ },
331
+ {
332
+ "current": {
333
+ "text": "All",
334
+ "value": "$__all"
335
+ },
336
+ "datasource": "SQLite",
337
+ "definition": "select distinct nickname from treasury_txs a inner join addresses b on a.\"to\" = b.address_id",
338
+ "includeAll": true,
339
+ "label": "To Nickname",
340
+ "name": "ToNickname",
341
+ "options": [],
342
+ "query": "select distinct nickname from treasury_txs a inner join addresses b on a.\"to\" = b.address_id",
343
+ "refresh": 2,
344
+ "regex": "",
345
+ "sort": 5,
346
+ "type": "query"
347
+ }
348
+ ]
201
349
  },
202
350
  "time": {
203
351
  "from": "now-7d",
@@ -206,7 +354,7 @@
206
354
  "timepicker": {},
207
355
  "timezone": "",
208
356
  "title": "Treasury Transactions",
357
+ "description": "Provides a real-time, filterable table of all transactions in the DAO treasury database, including timestamp, block, hash, token, addresses, nicknames, amount, price, and value in USD. Enables detailed analysis and monitoring of all value transfers.",
209
358
  "uid": "b21f1092-66a4-4fb0-90ef-ed77d2becaa4",
210
- "version": 5,
211
- "weekStart": ""
359
+ "version": 1
212
360
  }