dao-treasury 0.0.39__cp311-cp311-macosx_11_0_arm64.whl → 0.0.69__cp311-cp311-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dao_treasury/.grafana/provisioning/dashboards/breakdowns/Expenses.json +551 -0
- dao_treasury/.grafana/provisioning/dashboards/breakdowns/Revenue.json +551 -0
- dao_treasury/.grafana/provisioning/dashboards/dashboards.yaml +7 -57
- dao_treasury/.grafana/provisioning/dashboards/streams/LlamaPay.json +11 -16
- dao_treasury/.grafana/provisioning/dashboards/summary/Monthly.json +15 -15
- dao_treasury/.grafana/provisioning/dashboards/transactions/Treasury Transactions.json +38 -61
- dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow (Including Unsorted).json +122 -149
- dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow.json +87 -100
- dao_treasury/.grafana/provisioning/dashboards/treasury/Current Treasury Assets.json +1009 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Historical Treasury Balances.json +2989 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Operating Cashflow.json +64 -78
- dao_treasury/ENVIRONMENT_VARIABLES.py +12 -0
- dao_treasury/__init__.py +14 -0
- dao_treasury/_docker.cpython-311-darwin.so +0 -0
- dao_treasury/_docker.py +38 -21
- dao_treasury/_nicknames.cpython-311-darwin.so +0 -0
- dao_treasury/_nicknames.py +15 -0
- dao_treasury/_wallet.cpython-311-darwin.so +0 -0
- dao_treasury/constants.cpython-311-darwin.so +0 -0
- dao_treasury/constants.py +24 -0
- dao_treasury/db.py +72 -3
- dao_treasury/docker-compose.yaml +1 -1
- dao_treasury/main.py +6 -0
- dao_treasury/sorting/__init__.cpython-311-darwin.so +0 -0
- dao_treasury/sorting/_matchers.cpython-311-darwin.so +0 -0
- dao_treasury/sorting/_rules.cpython-311-darwin.so +0 -0
- dao_treasury/sorting/factory.cpython-311-darwin.so +0 -0
- dao_treasury/sorting/rule.cpython-311-darwin.so +0 -0
- dao_treasury/sorting/rule.py +8 -10
- dao_treasury/sorting/rules/__init__.cpython-311-darwin.so +0 -0
- dao_treasury/sorting/rules/ignore/__init__.cpython-311-darwin.so +0 -0
- dao_treasury/sorting/rules/ignore/__init__.py +0 -1
- dao_treasury/sorting/rules/ignore/llamapay.cpython-311-darwin.so +0 -0
- dao_treasury/streams/__init__.cpython-311-darwin.so +0 -0
- dao_treasury/streams/llamapay.cpython-311-darwin.so +0 -0
- dao_treasury/treasury.py +33 -14
- dao_treasury/types.cpython-311-darwin.so +0 -0
- {dao_treasury-0.0.39.dist-info → dao_treasury-0.0.69.dist-info}/METADATA +4 -3
- dao_treasury-0.0.69.dist-info/RECORD +54 -0
- dao_treasury-0.0.69.dist-info/top_level.txt +2 -0
- dao_treasury__mypyc.cpython-311-darwin.so +0 -0
- 8a0ad9a1a4146730a0f6__mypyc.cpython-311-darwin.so +0 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Treasury.json +0 -2018
- dao_treasury/sorting/rules/ignore/shitcoins.cpython-311-darwin.so +0 -0
- dao_treasury/sorting/rules/ignore/shitcoins.py +0 -24
- dao_treasury-0.0.39.dist-info/RECORD +0 -53
- dao_treasury-0.0.39.dist-info/top_level.txt +0 -2
- {dao_treasury-0.0.39.dist-info → dao_treasury-0.0.69.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,551 @@
|
|
|
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
|
+
"description": "Provides a detailed breakdown of DAO expenses over time, including totals and averages by period and transaction group. Intended for monitoring spending trends, identifying cost drivers, and supporting financial reporting. Use the 'Tx Group' filter to view specific categories (e.g., Expenses, Cost of Revenue, Other Expense) or all groups. Data Links in panels allow quick navigation to filtered transaction details.",
|
|
19
|
+
"editable": true,
|
|
20
|
+
"fiscalYearStartMonth": 0,
|
|
21
|
+
"graphTooltip": 1,
|
|
22
|
+
"id": 5,
|
|
23
|
+
"links": [],
|
|
24
|
+
"panels": [
|
|
25
|
+
{
|
|
26
|
+
"datasource": "SQLite",
|
|
27
|
+
"fieldConfig": {
|
|
28
|
+
"defaults": {
|
|
29
|
+
"color": {
|
|
30
|
+
"mode": "thresholds"
|
|
31
|
+
},
|
|
32
|
+
"mappings": [],
|
|
33
|
+
"thresholds": {
|
|
34
|
+
"mode": "absolute",
|
|
35
|
+
"steps": [
|
|
36
|
+
{
|
|
37
|
+
"color": "green",
|
|
38
|
+
"value": 0
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"color": "red",
|
|
42
|
+
"value": 80
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"unit": "currencyUSD"
|
|
47
|
+
},
|
|
48
|
+
"overrides": [
|
|
49
|
+
{
|
|
50
|
+
"matcher": {
|
|
51
|
+
"id": "byName",
|
|
52
|
+
"options": "total_revenue"
|
|
53
|
+
},
|
|
54
|
+
"properties": [
|
|
55
|
+
{
|
|
56
|
+
"id": "links",
|
|
57
|
+
"value": [
|
|
58
|
+
{
|
|
59
|
+
"title": "View Expense Transactions For This Period",
|
|
60
|
+
"url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=Expenses&from=$__from&to=$__to",
|
|
61
|
+
"targetBlank": true
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"gridPos": {
|
|
70
|
+
"h": 4,
|
|
71
|
+
"w": 6,
|
|
72
|
+
"x": 0,
|
|
73
|
+
"y": 0
|
|
74
|
+
},
|
|
75
|
+
"id": 1,
|
|
76
|
+
"options": {
|
|
77
|
+
"colorMode": "value",
|
|
78
|
+
"graphMode": "area",
|
|
79
|
+
"justifyMode": "auto",
|
|
80
|
+
"orientation": "auto",
|
|
81
|
+
"percentChangeColorMode": "standard",
|
|
82
|
+
"reduceOptions": {
|
|
83
|
+
"calcs": ["lastNotNull"],
|
|
84
|
+
"fields": "",
|
|
85
|
+
"values": false
|
|
86
|
+
},
|
|
87
|
+
"showPercentChange": false,
|
|
88
|
+
"textMode": "auto",
|
|
89
|
+
"wideLayout": true
|
|
90
|
+
},
|
|
91
|
+
"pluginVersion": "12.2.0",
|
|
92
|
+
"targets": [
|
|
93
|
+
{
|
|
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 g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.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 g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring})",
|
|
98
|
+
"refId": "A",
|
|
99
|
+
"timeColumns": ["time", "ts"]
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"title": "Expenses",
|
|
103
|
+
"type": "stat",
|
|
104
|
+
"description": "Displays the total expenses for the selected period, aggregated across all expense transaction groups. Useful for understanding overall spending.\n\nData Link: Clicking the value opens a filtered transactions dashboard for this period and group."
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"datasource": "SQLite",
|
|
108
|
+
"fieldConfig": {
|
|
109
|
+
"defaults": {
|
|
110
|
+
"color": {
|
|
111
|
+
"mode": "thresholds"
|
|
112
|
+
},
|
|
113
|
+
"mappings": [],
|
|
114
|
+
"thresholds": {
|
|
115
|
+
"mode": "absolute",
|
|
116
|
+
"steps": [
|
|
117
|
+
{
|
|
118
|
+
"color": "green",
|
|
119
|
+
"value": 0
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"color": "red",
|
|
123
|
+
"value": 80
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"unit": "currencyUSD"
|
|
128
|
+
},
|
|
129
|
+
"overrides": [
|
|
130
|
+
{
|
|
131
|
+
"matcher": {
|
|
132
|
+
"id": "byName",
|
|
133
|
+
"options": "total_revenue"
|
|
134
|
+
},
|
|
135
|
+
"properties": [
|
|
136
|
+
{
|
|
137
|
+
"id": "links",
|
|
138
|
+
"value": [
|
|
139
|
+
{
|
|
140
|
+
"title": "View Expense Transactions For This Period",
|
|
141
|
+
"url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=Expenses&from=$__from&to=$__to",
|
|
142
|
+
"targetBlank": true
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
"gridPos": {
|
|
151
|
+
"h": 4,
|
|
152
|
+
"w": 6,
|
|
153
|
+
"x": 6,
|
|
154
|
+
"y": 0
|
|
155
|
+
},
|
|
156
|
+
"id": 4,
|
|
157
|
+
"options": {
|
|
158
|
+
"colorMode": "value",
|
|
159
|
+
"graphMode": "area",
|
|
160
|
+
"justifyMode": "auto",
|
|
161
|
+
"orientation": "auto",
|
|
162
|
+
"percentChangeColorMode": "standard",
|
|
163
|
+
"reduceOptions": {
|
|
164
|
+
"calcs": ["lastNotNull"],
|
|
165
|
+
"fields": "",
|
|
166
|
+
"values": false
|
|
167
|
+
},
|
|
168
|
+
"showPercentChange": false,
|
|
169
|
+
"textMode": "auto",
|
|
170
|
+
"wideLayout": true
|
|
171
|
+
},
|
|
172
|
+
"pluginVersion": "12.2.0",
|
|
173
|
+
"targets": [
|
|
174
|
+
{
|
|
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 g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.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 g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring})",
|
|
179
|
+
"refId": "A",
|
|
180
|
+
"timeColumns": ["time", "ts"]
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"title": "Monthly Expenses",
|
|
184
|
+
"type": "stat",
|
|
185
|
+
"description": "Shows the average expenses per month for the selected period. Useful for tracking monthly spending trends.\n\nData Link: Clicking the value opens a filtered transactions dashboard for this period and group."
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"datasource": "SQLite",
|
|
189
|
+
"fieldConfig": {
|
|
190
|
+
"defaults": {
|
|
191
|
+
"color": {
|
|
192
|
+
"mode": "thresholds"
|
|
193
|
+
},
|
|
194
|
+
"mappings": [],
|
|
195
|
+
"thresholds": {
|
|
196
|
+
"mode": "absolute",
|
|
197
|
+
"steps": [
|
|
198
|
+
{
|
|
199
|
+
"color": "green",
|
|
200
|
+
"value": 0
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"color": "red",
|
|
204
|
+
"value": 80
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
"unit": "currencyUSD"
|
|
209
|
+
},
|
|
210
|
+
"overrides": [
|
|
211
|
+
{
|
|
212
|
+
"matcher": {
|
|
213
|
+
"id": "byName",
|
|
214
|
+
"options": "total_revenue"
|
|
215
|
+
},
|
|
216
|
+
"properties": [
|
|
217
|
+
{
|
|
218
|
+
"id": "links",
|
|
219
|
+
"value": [
|
|
220
|
+
{
|
|
221
|
+
"title": "View Expense Transactions For This Period",
|
|
222
|
+
"url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=Expenses&from=$__from&to=$__to",
|
|
223
|
+
"targetBlank": true
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
"gridPos": {
|
|
232
|
+
"h": 4,
|
|
233
|
+
"w": 6,
|
|
234
|
+
"x": 12,
|
|
235
|
+
"y": 0
|
|
236
|
+
},
|
|
237
|
+
"id": 2,
|
|
238
|
+
"options": {
|
|
239
|
+
"colorMode": "value",
|
|
240
|
+
"graphMode": "area",
|
|
241
|
+
"justifyMode": "auto",
|
|
242
|
+
"orientation": "auto",
|
|
243
|
+
"percentChangeColorMode": "standard",
|
|
244
|
+
"reduceOptions": {
|
|
245
|
+
"calcs": ["lastNotNull"],
|
|
246
|
+
"fields": "",
|
|
247
|
+
"values": false
|
|
248
|
+
},
|
|
249
|
+
"showPercentChange": false,
|
|
250
|
+
"textMode": "auto",
|
|
251
|
+
"wideLayout": true
|
|
252
|
+
},
|
|
253
|
+
"pluginVersion": "12.2.0",
|
|
254
|
+
"targets": [
|
|
255
|
+
{
|
|
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 g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.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 g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring})",
|
|
260
|
+
"refId": "A",
|
|
261
|
+
"timeColumns": ["time", "ts"]
|
|
262
|
+
}
|
|
263
|
+
],
|
|
264
|
+
"title": "Weekly Expenses",
|
|
265
|
+
"type": "stat",
|
|
266
|
+
"description": "Shows the average expenses per week for the selected period. Useful for monitoring short-term spending changes.\n\nData Link: Clicking the value opens a filtered transactions dashboard for this period and group."
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"datasource": "SQLite",
|
|
270
|
+
"fieldConfig": {
|
|
271
|
+
"defaults": {
|
|
272
|
+
"color": {
|
|
273
|
+
"mode": "thresholds"
|
|
274
|
+
},
|
|
275
|
+
"mappings": [],
|
|
276
|
+
"thresholds": {
|
|
277
|
+
"mode": "absolute",
|
|
278
|
+
"steps": [
|
|
279
|
+
{
|
|
280
|
+
"color": "green",
|
|
281
|
+
"value": 0
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"color": "red",
|
|
285
|
+
"value": 80
|
|
286
|
+
}
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
"unit": "currencyUSD"
|
|
290
|
+
},
|
|
291
|
+
"overrides": [
|
|
292
|
+
{
|
|
293
|
+
"matcher": {
|
|
294
|
+
"id": "byName",
|
|
295
|
+
"options": "total_revenue"
|
|
296
|
+
},
|
|
297
|
+
"properties": [
|
|
298
|
+
{
|
|
299
|
+
"id": "links",
|
|
300
|
+
"value": [
|
|
301
|
+
{
|
|
302
|
+
"title": "View Expense Transactions For This Period",
|
|
303
|
+
"url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=Expenses&from=$__from&to=$__to",
|
|
304
|
+
"targetBlank": true
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
]
|
|
309
|
+
}
|
|
310
|
+
]
|
|
311
|
+
},
|
|
312
|
+
"gridPos": {
|
|
313
|
+
"h": 4,
|
|
314
|
+
"w": 6,
|
|
315
|
+
"x": 18,
|
|
316
|
+
"y": 0
|
|
317
|
+
},
|
|
318
|
+
"id": 3,
|
|
319
|
+
"options": {
|
|
320
|
+
"colorMode": "value",
|
|
321
|
+
"graphMode": "area",
|
|
322
|
+
"justifyMode": "auto",
|
|
323
|
+
"orientation": "auto",
|
|
324
|
+
"percentChangeColorMode": "standard",
|
|
325
|
+
"reduceOptions": {
|
|
326
|
+
"calcs": ["lastNotNull"],
|
|
327
|
+
"fields": "",
|
|
328
|
+
"values": false
|
|
329
|
+
},
|
|
330
|
+
"showPercentChange": false,
|
|
331
|
+
"textMode": "auto",
|
|
332
|
+
"wideLayout": true
|
|
333
|
+
},
|
|
334
|
+
"pluginVersion": "12.2.0",
|
|
335
|
+
"targets": [
|
|
336
|
+
{
|
|
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 g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.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 g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring})",
|
|
341
|
+
"refId": "A",
|
|
342
|
+
"timeColumns": ["time", "ts"]
|
|
343
|
+
}
|
|
344
|
+
],
|
|
345
|
+
"title": "Daily Expenses",
|
|
346
|
+
"type": "stat",
|
|
347
|
+
"description": "Shows the average expenses per day for the selected period. Useful for fine-grained monitoring of spending.\n\nData Link: Clicking the value opens a filtered transactions dashboard for this period and group."
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"datasource": "SQLite",
|
|
351
|
+
"description": "Time series chart of expenses by transaction group, aggregated weekly for the selected period. Useful for visualizing spending trends and identifying cost drivers.\n\nData Link: Clicking a group name opens a filtered transactions dashboard for that group and period.",
|
|
352
|
+
"fieldConfig": {
|
|
353
|
+
"defaults": {
|
|
354
|
+
"color": {
|
|
355
|
+
"mode": "palette-classic"
|
|
356
|
+
},
|
|
357
|
+
"custom": {
|
|
358
|
+
"axisBorderShow": false,
|
|
359
|
+
"axisCenteredZero": false,
|
|
360
|
+
"axisColorMode": "text",
|
|
361
|
+
"axisLabel": "",
|
|
362
|
+
"axisPlacement": "auto",
|
|
363
|
+
"barAlignment": 0,
|
|
364
|
+
"barWidthFactor": 0.6,
|
|
365
|
+
"drawStyle": "bars",
|
|
366
|
+
"fillOpacity": 70,
|
|
367
|
+
"gradientMode": "none",
|
|
368
|
+
"hideFrom": {
|
|
369
|
+
"legend": false,
|
|
370
|
+
"tooltip": false,
|
|
371
|
+
"viz": false
|
|
372
|
+
},
|
|
373
|
+
"insertNulls": false,
|
|
374
|
+
"lineInterpolation": "linear",
|
|
375
|
+
"lineWidth": 1,
|
|
376
|
+
"pointSize": 5,
|
|
377
|
+
"scaleDistribution": {
|
|
378
|
+
"type": "linear"
|
|
379
|
+
},
|
|
380
|
+
"showPoints": "auto",
|
|
381
|
+
"showValues": false,
|
|
382
|
+
"spanNulls": false,
|
|
383
|
+
"stacking": {
|
|
384
|
+
"group": "A",
|
|
385
|
+
"mode": "normal"
|
|
386
|
+
},
|
|
387
|
+
"thresholdsStyle": {
|
|
388
|
+
"mode": "off"
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
"mappings": [],
|
|
392
|
+
"thresholds": {
|
|
393
|
+
"mode": "absolute",
|
|
394
|
+
"steps": [
|
|
395
|
+
{
|
|
396
|
+
"color": "green",
|
|
397
|
+
"value": 0
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"color": "red",
|
|
401
|
+
"value": 80
|
|
402
|
+
}
|
|
403
|
+
]
|
|
404
|
+
},
|
|
405
|
+
"unit": "currencyUSD"
|
|
406
|
+
},
|
|
407
|
+
"overrides": [
|
|
408
|
+
{
|
|
409
|
+
"matcher": {
|
|
410
|
+
"id": "byName",
|
|
411
|
+
"options": "Expenses (sum)"
|
|
412
|
+
},
|
|
413
|
+
"properties": [
|
|
414
|
+
{
|
|
415
|
+
"id": "links",
|
|
416
|
+
"value": [
|
|
417
|
+
{
|
|
418
|
+
"title": "View ${__series.name} Transactions",
|
|
419
|
+
"url": "/d/b21f1092-66a4-4fb0-90ef-ed77d2becaa4?var-Top=${__series.name}&from=$__from&to=$__to",
|
|
420
|
+
"targetBlank": true
|
|
421
|
+
}
|
|
422
|
+
]
|
|
423
|
+
}
|
|
424
|
+
]
|
|
425
|
+
}
|
|
426
|
+
]
|
|
427
|
+
},
|
|
428
|
+
"gridPos": {
|
|
429
|
+
"h": 12,
|
|
430
|
+
"w": 24,
|
|
431
|
+
"x": 0,
|
|
432
|
+
"y": 4
|
|
433
|
+
},
|
|
434
|
+
"id": 11,
|
|
435
|
+
"type": "timeseries",
|
|
436
|
+
"options": {
|
|
437
|
+
"legend": {
|
|
438
|
+
"calcs": ["sum"],
|
|
439
|
+
"displayMode": "list",
|
|
440
|
+
"placement": "bottom",
|
|
441
|
+
"showLegend": true
|
|
442
|
+
},
|
|
443
|
+
"tooltip": {
|
|
444
|
+
"hideZeros": false,
|
|
445
|
+
"mode": "multi",
|
|
446
|
+
"sort": "none"
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
"pluginVersion": "12.2.0",
|
|
450
|
+
"targets": [
|
|
451
|
+
{
|
|
452
|
+
"datasource": "SQLite",
|
|
453
|
+
"queryText": "SELECT t.timestamp, g.name AS \"TxGroup\", SUM(CASE WHEN gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') THEN t.value_usd ELSE 0 END) AS \"Expenses\" 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 ('Cost of Revenue', 'Expenses', 'Other Expense') THEN t.value_usd ELSE 0 END) AS \"Expenses\" 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;",
|
|
456
|
+
"refId": "A",
|
|
457
|
+
"timeColumns": ["timestamp"]
|
|
458
|
+
}
|
|
459
|
+
],
|
|
460
|
+
"title": "Weekly Cashflow",
|
|
461
|
+
"transformations": [
|
|
462
|
+
{
|
|
463
|
+
"id": "formatTime",
|
|
464
|
+
"options": {
|
|
465
|
+
"outputFormat": "YYYY-WW",
|
|
466
|
+
"timeField": "timestamp",
|
|
467
|
+
"timezone": "browser",
|
|
468
|
+
"useTimezone": true
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"id": "convertFieldType",
|
|
473
|
+
"options": {
|
|
474
|
+
"conversions": [
|
|
475
|
+
{
|
|
476
|
+
"dateFormat": "YYYY-WW",
|
|
477
|
+
"destinationType": "time",
|
|
478
|
+
"targetField": "timestamp"
|
|
479
|
+
}
|
|
480
|
+
],
|
|
481
|
+
"fields": {}
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"id": "groupBy",
|
|
486
|
+
"options": {
|
|
487
|
+
"fields": {
|
|
488
|
+
"TxGroup": {
|
|
489
|
+
"aggregations": [],
|
|
490
|
+
"operation": "groupby"
|
|
491
|
+
},
|
|
492
|
+
"Expenses": {
|
|
493
|
+
"aggregations": ["sum"],
|
|
494
|
+
"operation": "aggregate"
|
|
495
|
+
},
|
|
496
|
+
"timestamp": {
|
|
497
|
+
"aggregations": [],
|
|
498
|
+
"operation": "groupby"
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"id": "partitionByValues",
|
|
505
|
+
"options": {
|
|
506
|
+
"fields": ["TxGroup"],
|
|
507
|
+
"keepFields": false,
|
|
508
|
+
"naming": {
|
|
509
|
+
"asLabels": false
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
]
|
|
514
|
+
}
|
|
515
|
+
],
|
|
516
|
+
"preload": false,
|
|
517
|
+
"refresh": "",
|
|
518
|
+
"schemaVersion": 42,
|
|
519
|
+
"tags": ["breakdown", "expenses"],
|
|
520
|
+
"templating": {
|
|
521
|
+
"list": [
|
|
522
|
+
{
|
|
523
|
+
"allowCustomValue": true,
|
|
524
|
+
"current": {
|
|
525
|
+
"text": "All",
|
|
526
|
+
"value": "$__all"
|
|
527
|
+
},
|
|
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 = 'Expenses' OR gh.top_category = 'Cost of Revenue' OR gh.top_category = 'Other Expense') 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 expenses for specific categories, or 'All' to include every group.",
|
|
530
|
+
"includeAll": true,
|
|
531
|
+
"label": "Tx Group",
|
|
532
|
+
"name": "Txgroup",
|
|
533
|
+
"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 = 'Expenses' OR gh.top_category = 'Cost of Revenue' OR gh.top_category = 'Other Expense') AND a.timestamp >= $__from/1000 AND a.timestamp <= $__to/1000;",
|
|
535
|
+
"refresh": 2,
|
|
536
|
+
"regex": "",
|
|
537
|
+
"sort": 5,
|
|
538
|
+
"type": "query"
|
|
539
|
+
}
|
|
540
|
+
]
|
|
541
|
+
},
|
|
542
|
+
"time": {
|
|
543
|
+
"from": "now-6M",
|
|
544
|
+
"to": "now"
|
|
545
|
+
},
|
|
546
|
+
"timepicker": {},
|
|
547
|
+
"timezone": "",
|
|
548
|
+
"title": "Expenses Over Time",
|
|
549
|
+
"uid": "62bccd38-918c-4395-9180-8f7f911e9ddf",
|
|
550
|
+
"version": 14
|
|
551
|
+
}
|