dao-treasury 0.0.35__cp311-cp311-win_amd64.whl → 0.0.71__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 (46) hide show
  1. dao_treasury/.grafana/provisioning/dashboards/breakdowns/Expenses.json +551 -0
  2. dao_treasury/.grafana/provisioning/dashboards/breakdowns/Revenue.json +551 -0
  3. dao_treasury/.grafana/provisioning/dashboards/dashboards.yaml +7 -57
  4. dao_treasury/.grafana/provisioning/dashboards/streams/LlamaPay.json +11 -16
  5. dao_treasury/.grafana/provisioning/dashboards/summary/Monthly.json +284 -22
  6. dao_treasury/.grafana/provisioning/dashboards/transactions/Treasury Transactions.json +193 -235
  7. dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow (Including Unsorted).json +122 -149
  8. dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow.json +87 -100
  9. dao_treasury/.grafana/provisioning/dashboards/treasury/Current Treasury Assets.json +981 -0
  10. dao_treasury/.grafana/provisioning/dashboards/treasury/Historical Treasury Balances.json +3060 -0
  11. dao_treasury/.grafana/provisioning/dashboards/treasury/Operating Cashflow.json +64 -78
  12. dao_treasury/ENVIRONMENT_VARIABLES.py +12 -0
  13. dao_treasury/__init__.py +14 -0
  14. dao_treasury/_docker.cp311-win_amd64.pyd +0 -0
  15. dao_treasury/_docker.py +38 -21
  16. dao_treasury/_nicknames.cp311-win_amd64.pyd +0 -0
  17. dao_treasury/_nicknames.py +15 -0
  18. dao_treasury/_wallet.cp311-win_amd64.pyd +0 -0
  19. dao_treasury/constants.cp311-win_amd64.pyd +0 -0
  20. dao_treasury/constants.py +24 -0
  21. dao_treasury/db.py +74 -4
  22. dao_treasury/docker-compose.yaml +1 -1
  23. dao_treasury/main.py +39 -1
  24. dao_treasury/sorting/__init__.cp311-win_amd64.pyd +0 -0
  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/rule.py +8 -10
  30. dao_treasury/sorting/rules/__init__.cp311-win_amd64.pyd +0 -0
  31. dao_treasury/sorting/rules/ignore/__init__.cp311-win_amd64.pyd +0 -0
  32. dao_treasury/sorting/rules/ignore/llamapay.cp311-win_amd64.pyd +0 -0
  33. dao_treasury/streams/__init__.cp311-win_amd64.pyd +0 -0
  34. dao_treasury/streams/llamapay.cp311-win_amd64.pyd +0 -0
  35. dao_treasury/streams/llamapay.py +14 -2
  36. dao_treasury/treasury.py +37 -16
  37. dao_treasury/types.cp311-win_amd64.pyd +0 -0
  38. {dao_treasury-0.0.35.dist-info → dao_treasury-0.0.71.dist-info}/METADATA +18 -3
  39. dao_treasury-0.0.71.dist-info/RECORD +54 -0
  40. dao_treasury-0.0.71.dist-info/top_level.txt +2 -0
  41. dao_treasury__mypyc.cp311-win_amd64.pyd +0 -0
  42. bf2b4fe1f86ad2ea158b__mypyc.cp311-win_amd64.pyd +0 -0
  43. dao_treasury/.grafana/provisioning/dashboards/treasury/Treasury.json +0 -2018
  44. dao_treasury-0.0.35.dist-info/RECORD +0 -51
  45. dao_treasury-0.0.35.dist-info/top_level.txt +0 -2
  46. {dao_treasury-0.0.35.dist-info → dao_treasury-0.0.71.dist-info}/WHEEL +0 -0
@@ -12,174 +12,290 @@
12
12
  }
13
13
  ]
14
14
  },
15
+ "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.",
15
16
  "editable": true,
16
17
  "fiscalYearStartMonth": 0,
17
18
  "graphTooltip": 0,
19
+ "id": 2,
18
20
  "links": [],
19
- "liveNow": false,
20
21
  "panels": [
21
22
  {
22
23
  "datasource": "SQLite",
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.",
23
25
  "fieldConfig": {
24
26
  "defaults": {
27
+ "color": {
28
+ "mode": "continuous-RdYlGr"
29
+ },
25
30
  "custom": {
26
31
  "align": "auto",
27
32
  "cellOptions": {
28
33
  "type": "auto"
29
34
  },
30
- "inspect": false
35
+ "footer": {
36
+ "reducers": ["sum", "max", "mean", "median"]
37
+ },
38
+ "inspect": true
31
39
  },
32
- "decimals": 8,
40
+ "fieldMinMax": true,
41
+ "links": [
42
+ {
43
+ "targetBlank": true,
44
+ "title": "View ${__field.name} transactions for this period",
45
+ "url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4/treasury-transactions?var-Top=${__field.name}&from=${__data.fields.month_start}&to=${__data.fields.month_end}"
46
+ }
47
+ ],
33
48
  "mappings": [],
34
49
  "thresholds": {
35
50
  "mode": "absolute",
36
51
  "steps": [
37
52
  {
38
53
  "color": "green",
39
- "value": null
54
+ "value": 0
40
55
  },
41
56
  {
42
57
  "color": "red",
43
58
  "value": 80
44
59
  }
45
60
  ]
46
- }
61
+ },
62
+ "unit": "currencyUSD"
47
63
  },
48
64
  "overrides": [
49
65
  {
50
66
  "matcher": {
51
67
  "id": "byName",
52
- "options": "Hash"
68
+ "options": "Sorted Net"
69
+ },
70
+ "properties": [
71
+ {
72
+ "id": "custom.cellOptions",
73
+ "value": {
74
+ "type": "color-text"
75
+ }
76
+ },
77
+ {
78
+ "id": "links"
79
+ }
80
+ ]
81
+ },
82
+ {
83
+ "matcher": {
84
+ "id": "byName",
85
+ "options": "Net"
86
+ },
87
+ "properties": [
88
+ {
89
+ "id": "custom.cellOptions",
90
+ "value": {
91
+ "type": "color-text"
92
+ }
93
+ },
94
+ {
95
+ "id": "links"
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "matcher": {
101
+ "id": "byName",
102
+ "options": "Unsorted Income"
103
+ },
104
+ "properties": [
105
+ {
106
+ "id": "custom.cellOptions",
107
+ "value": {
108
+ "type": "color-text"
109
+ }
110
+ },
111
+ {
112
+ "id": "color",
113
+ "value": {
114
+ "mode": "fixed"
115
+ }
116
+ }
117
+ ]
118
+ },
119
+ {
120
+ "matcher": {
121
+ "id": "byName",
122
+ "options": "Unsorted Expenses"
123
+ },
124
+ "properties": [
125
+ {
126
+ "id": "custom.cellOptions",
127
+ "value": {
128
+ "type": "color-text"
129
+ }
130
+ },
131
+ {
132
+ "id": "color",
133
+ "value": {
134
+ "mode": "fixed"
135
+ }
136
+ }
137
+ ]
138
+ },
139
+ {
140
+ "matcher": {
141
+ "id": "byName",
142
+ "options": "Other Income"
53
143
  },
54
144
  "properties": [
55
145
  {
56
- "id": "links",
57
- "value": [
58
- {
59
- "targetBlank": true,
60
- "title": "View on Etherscan",
61
- "url": "https://etherscan.io/tx/${__value.raw}"
62
- }
63
- ]
146
+ "id": "custom.cellOptions",
147
+ "value": {
148
+ "type": "color-text"
149
+ }
150
+ },
151
+ {
152
+ "id": "color",
153
+ "value": {
154
+ "mode": "fixed"
155
+ }
64
156
  }
65
157
  ]
66
158
  },
67
159
  {
68
160
  "matcher": {
69
161
  "id": "byName",
70
- "options": "Block"
162
+ "options": "Other Expenses"
71
163
  },
72
164
  "properties": [
73
165
  {
74
- "id": "links",
75
- "value": [
76
- {
77
- "targetBlank": true,
78
- "title": "View on Etherscan",
79
- "url": "https://etherscan.io/block/${__value.raw}"
80
- }
81
- ]
166
+ "id": "custom.cellOptions",
167
+ "value": {
168
+ "type": "color-text"
169
+ }
170
+ },
171
+ {
172
+ "id": "color",
173
+ "value": {
174
+ "mode": "fixed"
175
+ }
82
176
  }
83
177
  ]
84
178
  },
85
179
  {
86
180
  "matcher": {
87
181
  "id": "byName",
88
- "options": "To"
182
+ "options": "Operating Net"
89
183
  },
90
184
  "properties": [
91
185
  {
92
- "id": "links",
93
- "value": [
94
- {
95
- "targetBlank": true,
96
- "title": "View on Etherscan",
97
- "url": "https://etherscan.io/address/${__value.raw}"
98
- }
99
- ]
186
+ "id": "custom.cellOptions",
187
+ "value": {
188
+ "type": "color-text"
189
+ }
190
+ },
191
+ {
192
+ "id": "color",
193
+ "value": {
194
+ "mode": "continuous-RdYlGr"
195
+ }
196
+ },
197
+ {
198
+ "id": "links"
100
199
  }
101
200
  ]
102
201
  },
103
202
  {
104
203
  "matcher": {
105
204
  "id": "byName",
106
- "options": "From"
205
+ "options": "month_start"
107
206
  },
108
207
  "properties": [
109
208
  {
110
- "id": "links",
111
- "value": [
112
- {
113
- "targetBlank": true,
114
- "title": "View on Etherscan",
115
- "url": "https://etherscan.io/address/${__value.raw}"
116
- }
117
- ]
209
+ "id": "unit"
210
+ },
211
+ {
212
+ "id": "custom.hideFrom.viz",
213
+ "value": true
118
214
  }
119
215
  ]
120
216
  },
121
217
  {
122
218
  "matcher": {
123
219
  "id": "byName",
124
- "options": "From Nickname"
220
+ "options": "month_end"
125
221
  },
126
222
  "properties": [
127
223
  {
128
- "id": "links",
129
- "value": [
130
- {
131
- "targetBlank": true,
132
- "title": "View on Etherscan",
133
- "url": "https://etherscan.io/address/${__data.fields.From}"
134
- }
135
- ]
224
+ "id": "unit"
225
+ },
226
+ {
227
+ "id": "custom.hideFrom.viz",
228
+ "value": true
136
229
  }
137
230
  ]
138
231
  },
139
232
  {
140
233
  "matcher": {
141
234
  "id": "byName",
142
- "options": "To Nickname"
235
+ "options": "Revenue"
143
236
  },
144
237
  "properties": [
145
238
  {
146
- "id": "links",
147
- "value": [
148
- {
149
- "targetBlank": true,
150
- "title": "View on Etherscan",
151
- "url": "https://etherscan.io/address/${__data.fields.To}"
152
- }
153
- ]
239
+ "id": "custom.cellOptions",
240
+ "value": {
241
+ "type": "color-text"
242
+ }
243
+ },
244
+ {
245
+ "id": "color",
246
+ "value": {
247
+ "fixedColor": "#ffffff",
248
+ "mode": "fixed"
249
+ }
154
250
  }
155
251
  ]
156
252
  },
157
253
  {
158
254
  "matcher": {
159
255
  "id": "byName",
160
- "options": "Block"
256
+ "options": "Expenses"
161
257
  },
162
258
  "properties": [
163
259
  {
164
- "id": "decimals"
260
+ "id": "custom.cellOptions",
261
+ "value": {
262
+ "type": "color-text"
263
+ }
264
+ },
265
+ {
266
+ "id": "color",
267
+ "value": {
268
+ "fixedColor": "#ffffff",
269
+ "mode": "fixed"
270
+ }
165
271
  }
166
272
  ]
167
273
  },
168
274
  {
169
275
  "matcher": {
170
276
  "id": "byName",
171
- "options": "Log Index"
277
+ "options": "Cost of Revenue"
172
278
  },
173
279
  "properties": [
174
280
  {
175
- "id": "decimals"
281
+ "id": "color",
282
+ "value": {
283
+ "fixedColor": "#ffffff",
284
+ "mode": "fixed"
285
+ }
286
+ },
287
+ {
288
+ "id": "custom.cellOptions",
289
+ "value": {
290
+ "type": "color-text"
291
+ }
176
292
  }
177
293
  ]
178
294
  }
179
295
  ]
180
296
  },
181
297
  "gridPos": {
182
- "h": 18,
298
+ "h": 20,
183
299
  "w": 24,
184
300
  "x": 0,
185
301
  "y": 0
@@ -187,201 +303,43 @@
187
303
  "id": 1,
188
304
  "options": {
189
305
  "cellHeight": "sm",
190
- "footer": {
191
- "countRows": false,
192
- "fields": "",
193
- "reducer": [
194
- "sum"
195
- ],
196
- "show": false
197
- },
198
306
  "showHeader": true,
199
307
  "sortBy": [
200
308
  {
201
309
  "desc": true,
202
- "displayName": "Timestamp"
310
+ "displayName": "Month"
203
311
  }
204
312
  ]
205
313
  },
206
- "pluginVersion": "10.2.0",
314
+ "pluginVersion": "12.2.1",
207
315
  "targets": [
208
316
  {
209
317
  "datasource": "SQLite",
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",
318
+ "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;",
211
319
  "queryType": "table",
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",
320
+ "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;",
213
321
  "refId": "A",
214
- "timeColumns": [
215
- "time",
216
- "ts"
217
- ]
322
+ "timeColumns": ["time", "ts"]
218
323
  }
219
324
  ],
220
- "title": "Transactions",
325
+ "title": "Monthly Profit & Loss",
221
326
  "type": "table"
222
327
  }
223
328
  ],
329
+ "preload": false,
224
330
  "refresh": "",
225
- "schemaVersion": 38,
331
+ "schemaVersion": 42,
226
332
  "tags": [],
227
333
  "templating": {
228
- "list": [
229
- {
230
- "current": {
231
- "selected": false,
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
- "hide": 0,
238
- "includeAll": true,
239
- "label": "Top Level",
240
- "multi": false,
241
- "name": "Top",
242
- "options": [],
243
- "query": "SELECT DISTINCT gh.top_category FROM treasury_txs a INNER JOIN txgroup_hierarchy gh ON a.txgroup_id = gh.txgroup_id;",
244
- "refresh": 2,
245
- "regex": "",
246
- "skipUrlSync": false,
247
- "sort": 5,
248
- "type": "query"
249
- },
250
- {
251
- "current": {
252
- "selected": false,
253
- "text": "All",
254
- "value": "$__all"
255
- },
256
- "datasource": "SQLite",
257
- "definition": "select distinct chain_name from treasury_txs a left join chains b on a.chain = b.chain_dbid",
258
- "description": "",
259
- "hide": 0,
260
- "includeAll": true,
261
- "multi": false,
262
- "name": "Chain",
263
- "options": [],
264
- "query": "select distinct chain_name from treasury_txs a left join chains b on a.chain = b.chain_dbid",
265
- "refresh": 2,
266
- "regex": "",
267
- "skipUrlSync": false,
268
- "sort": 5,
269
- "type": "query"
270
- },
271
- {
272
- "current": {
273
- "selected": false,
274
- "text": "All",
275
- "value": "$__all"
276
- },
277
- "datasource": "SQLite",
278
- "definition": "select distinct symbol from treasury_txs a left join tokens b on a.token_id = b.token_id",
279
- "hide": 0,
280
- "includeAll": true,
281
- "multi": false,
282
- "name": "Token",
283
- "options": [],
284
- "query": "select distinct symbol from treasury_txs a left join tokens b on a.token_id = b.token_id",
285
- "refresh": 2,
286
- "regex": "",
287
- "skipUrlSync": false,
288
- "sort": 5,
289
- "type": "query"
290
- },
291
- {
292
- "current": {
293
- "selected": false,
294
- "text": "All",
295
- "value": "$__all"
296
- },
297
- "datasource": "SQLite",
298
- "definition": "select distinct address from treasury_txs a left join addresses b on a.\"from\" = b.address_id",
299
- "hide": 0,
300
- "includeAll": true,
301
- "label": "From Address",
302
- "multi": false,
303
- "name": "From",
304
- "options": [],
305
- "query": "select distinct address from treasury_txs a left join addresses b on a.\"from\" = b.address_id",
306
- "refresh": 2,
307
- "regex": "",
308
- "skipUrlSync": false,
309
- "sort": 5,
310
- "type": "query"
311
- },
312
- {
313
- "current": {
314
- "selected": false,
315
- "text": "All",
316
- "value": "$__all"
317
- },
318
- "datasource": "SQLite",
319
- "definition": "select distinct nickname from treasury_txs a inner join addresses b on a.\"from\" = b.address_id",
320
- "hide": 0,
321
- "includeAll": true,
322
- "label": "From Nickname",
323
- "multi": false,
324
- "name": "FromNickname",
325
- "options": [],
326
- "query": "select distinct nickname from treasury_txs a inner join addresses b on a.\"from\" = b.address_id",
327
- "refresh": 2,
328
- "regex": "",
329
- "skipUrlSync": false,
330
- "sort": 5,
331
- "type": "query"
332
- },
333
- {
334
- "current": {
335
- "selected": false,
336
- "text": "All",
337
- "value": "$__all"
338
- },
339
- "datasource": "SQLite",
340
- "definition": "select distinct address from treasury_txs a left join addresses b on a.\"to\" = b.address_id",
341
- "hide": 0,
342
- "includeAll": true,
343
- "label": "To Address",
344
- "multi": false,
345
- "name": "To",
346
- "options": [],
347
- "query": "select distinct address from treasury_txs a left join addresses b on a.\"to\" = b.address_id",
348
- "refresh": 2,
349
- "regex": "",
350
- "skipUrlSync": false,
351
- "sort": 5,
352
- "type": "query"
353
- },
354
- {
355
- "current": {
356
- "selected": false,
357
- "text": "All",
358
- "value": "$__all"
359
- },
360
- "datasource": "SQLite",
361
- "definition": "select distinct nickname from treasury_txs a inner join addresses b on a.\"to\" = b.address_id",
362
- "hide": 0,
363
- "includeAll": true,
364
- "label": "To Nickname",
365
- "multi": false,
366
- "name": "ToNickname",
367
- "options": [],
368
- "query": "select distinct nickname from treasury_txs a inner join addresses b on a.\"to\" = b.address_id",
369
- "refresh": 2,
370
- "regex": "",
371
- "skipUrlSync": false,
372
- "sort": 5,
373
- "type": "query"
374
- }
375
- ]
334
+ "list": []
376
335
  },
377
336
  "time": {
378
- "from": "now-7d",
337
+ "from": "now/y",
379
338
  "to": "now"
380
339
  },
381
340
  "timepicker": {},
382
341
  "timezone": "",
383
- "title": "Treasury Transactions",
384
- "uid": "b21f1092-66a4-4fb0-90ef-ed77d2becaa4",
385
- "version": 1,
386
- "weekStart": ""
342
+ "title": "Monthly P&L",
343
+ "uid": "a63fa9a7-d4f3-4092-9bde-194add8bcbeb",
344
+ "version": 7
387
345
  }