dao-treasury 0.0.62__cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.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 (54) 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 +84 -0
  4. dao_treasury/.grafana/provisioning/dashboards/streams/LlamaPay.json +225 -0
  5. dao_treasury/.grafana/provisioning/dashboards/summary/Monthly.json +108 -0
  6. dao_treasury/.grafana/provisioning/dashboards/transactions/Treasury Transactions.json +360 -0
  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 +62 -0
  15. dao_treasury/_docker.cpython-312-i386-linux-gnu.so +0 -0
  16. dao_treasury/_docker.py +193 -0
  17. dao_treasury/_nicknames.cpython-312-i386-linux-gnu.so +0 -0
  18. dao_treasury/_nicknames.py +32 -0
  19. dao_treasury/_wallet.cpython-312-i386-linux-gnu.so +0 -0
  20. dao_treasury/_wallet.py +250 -0
  21. dao_treasury/constants.cpython-312-i386-linux-gnu.so +0 -0
  22. dao_treasury/constants.py +39 -0
  23. dao_treasury/db.py +1450 -0
  24. dao_treasury/docker-compose.yaml +41 -0
  25. dao_treasury/main.py +253 -0
  26. dao_treasury/py.typed +0 -0
  27. dao_treasury/sorting/__init__.cpython-312-i386-linux-gnu.so +0 -0
  28. dao_treasury/sorting/__init__.py +295 -0
  29. dao_treasury/sorting/_matchers.cpython-312-i386-linux-gnu.so +0 -0
  30. dao_treasury/sorting/_matchers.py +387 -0
  31. dao_treasury/sorting/_rules.cpython-312-i386-linux-gnu.so +0 -0
  32. dao_treasury/sorting/_rules.py +235 -0
  33. dao_treasury/sorting/factory.cpython-312-i386-linux-gnu.so +0 -0
  34. dao_treasury/sorting/factory.py +299 -0
  35. dao_treasury/sorting/rule.cpython-312-i386-linux-gnu.so +0 -0
  36. dao_treasury/sorting/rule.py +344 -0
  37. dao_treasury/sorting/rules/__init__.cpython-312-i386-linux-gnu.so +0 -0
  38. dao_treasury/sorting/rules/__init__.py +1 -0
  39. dao_treasury/sorting/rules/ignore/__init__.cpython-312-i386-linux-gnu.so +0 -0
  40. dao_treasury/sorting/rules/ignore/__init__.py +1 -0
  41. dao_treasury/sorting/rules/ignore/llamapay.cpython-312-i386-linux-gnu.so +0 -0
  42. dao_treasury/sorting/rules/ignore/llamapay.py +20 -0
  43. dao_treasury/streams/__init__.cpython-312-i386-linux-gnu.so +0 -0
  44. dao_treasury/streams/__init__.py +0 -0
  45. dao_treasury/streams/llamapay.cpython-312-i386-linux-gnu.so +0 -0
  46. dao_treasury/streams/llamapay.py +388 -0
  47. dao_treasury/treasury.py +191 -0
  48. dao_treasury/types.cpython-312-i386-linux-gnu.so +0 -0
  49. dao_treasury/types.py +133 -0
  50. dao_treasury-0.0.62.dist-info/METADATA +120 -0
  51. dao_treasury-0.0.62.dist-info/RECORD +54 -0
  52. dao_treasury-0.0.62.dist-info/WHEEL +7 -0
  53. dao_treasury-0.0.62.dist-info/top_level.txt +2 -0
  54. dao_treasury__mypyc.cpython-312-i386-linux-gnu.so +0 -0
@@ -0,0 +1,526 @@
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": "Shows a breakdown of expenses over time.",
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
+ },
47
+ "overrides": []
48
+ },
49
+ "gridPos": {
50
+ "h": 4,
51
+ "w": 6,
52
+ "x": 0,
53
+ "y": 0
54
+ },
55
+ "id": 1,
56
+ "options": {
57
+ "colorMode": "value",
58
+ "graphMode": "area",
59
+ "justifyMode": "auto",
60
+ "orientation": "auto",
61
+ "percentChangeColorMode": "standard",
62
+ "reduceOptions": {
63
+ "calcs": [
64
+ "lastNotNull"
65
+ ],
66
+ "fields": "",
67
+ "values": false
68
+ },
69
+ "showPercentChange": false,
70
+ "textMode": "auto",
71
+ "wideLayout": true
72
+ },
73
+ "pluginVersion": "12.2.0",
74
+ "targets": [
75
+ {
76
+ "datasource": "SQLite",
77
+ "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 ('$Txgroup' like '{%' or g.name = '$Txgroup')",
78
+ "queryType": "table",
79
+ "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 ('$Txgroup' like '{%' or g.name = '$Txgroup')",
80
+ "refId": "A",
81
+ "timeColumns": [
82
+ "time",
83
+ "ts"
84
+ ]
85
+ }
86
+ ],
87
+ "title": "Total Expenses",
88
+ "type": "stat"
89
+ },
90
+ {
91
+ "datasource": "SQLite",
92
+ "fieldConfig": {
93
+ "defaults": {
94
+ "color": {
95
+ "mode": "thresholds"
96
+ },
97
+ "mappings": [],
98
+ "thresholds": {
99
+ "mode": "absolute",
100
+ "steps": [
101
+ {
102
+ "color": "green",
103
+ "value": 0
104
+ },
105
+ {
106
+ "color": "red",
107
+ "value": 80
108
+ }
109
+ ]
110
+ }
111
+ },
112
+ "overrides": []
113
+ },
114
+ "gridPos": {
115
+ "h": 4,
116
+ "w": 6,
117
+ "x": 6,
118
+ "y": 0
119
+ },
120
+ "id": 4,
121
+ "options": {
122
+ "colorMode": "value",
123
+ "graphMode": "area",
124
+ "justifyMode": "auto",
125
+ "orientation": "auto",
126
+ "percentChangeColorMode": "standard",
127
+ "reduceOptions": {
128
+ "calcs": [
129
+ "lastNotNull"
130
+ ],
131
+ "fields": "",
132
+ "values": false
133
+ },
134
+ "showPercentChange": false,
135
+ "textMode": "auto",
136
+ "wideLayout": true
137
+ },
138
+ "pluginVersion": "12.2.0",
139
+ "targets": [
140
+ {
141
+ "datasource": "SQLite",
142
+ "queryText": "SELECT SUM(t.value_usd) / (((1760217520685 - 1744406320685) / 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 >= 1744406320685/1000 AND t.timestamp <= 1760217520685/1000 AND ('$Txgroup' like '{%' or g.name = '$Txgroup')",
143
+ "queryType": "table",
144
+ "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 ('$Txgroup' like '{%' or g.name = '$Txgroup')",
145
+ "refId": "A",
146
+ "timeColumns": [
147
+ "time",
148
+ "ts"
149
+ ]
150
+ }
151
+ ],
152
+ "title": "Monthly Expenses",
153
+ "type": "stat"
154
+ },
155
+ {
156
+ "datasource": "SQLite",
157
+ "fieldConfig": {
158
+ "defaults": {
159
+ "color": {
160
+ "mode": "thresholds"
161
+ },
162
+ "mappings": [],
163
+ "thresholds": {
164
+ "mode": "absolute",
165
+ "steps": [
166
+ {
167
+ "color": "green",
168
+ "value": 0
169
+ },
170
+ {
171
+ "color": "red",
172
+ "value": 80
173
+ }
174
+ ]
175
+ }
176
+ },
177
+ "overrides": []
178
+ },
179
+ "gridPos": {
180
+ "h": 4,
181
+ "w": 6,
182
+ "x": 12,
183
+ "y": 0
184
+ },
185
+ "id": 2,
186
+ "options": {
187
+ "colorMode": "value",
188
+ "graphMode": "area",
189
+ "justifyMode": "auto",
190
+ "orientation": "auto",
191
+ "percentChangeColorMode": "standard",
192
+ "reduceOptions": {
193
+ "calcs": [
194
+ "lastNotNull"
195
+ ],
196
+ "fields": "",
197
+ "values": false
198
+ },
199
+ "showPercentChange": false,
200
+ "textMode": "auto",
201
+ "wideLayout": true
202
+ },
203
+ "pluginVersion": "12.2.0",
204
+ "targets": [
205
+ {
206
+ "datasource": "SQLite",
207
+ "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 ('$Txgroup' like '{%' or g.name = '$Txgroup')",
208
+ "queryType": "table",
209
+ "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 ('$Txgroup' like '{%' or g.name = '$Txgroup')",
210
+ "refId": "A",
211
+ "timeColumns": [
212
+ "time",
213
+ "ts"
214
+ ]
215
+ }
216
+ ],
217
+ "title": "Weekly Expenses",
218
+ "type": "stat"
219
+ },
220
+ {
221
+ "datasource": "SQLite",
222
+ "fieldConfig": {
223
+ "defaults": {
224
+ "color": {
225
+ "mode": "thresholds"
226
+ },
227
+ "mappings": [],
228
+ "thresholds": {
229
+ "mode": "absolute",
230
+ "steps": [
231
+ {
232
+ "color": "green",
233
+ "value": 0
234
+ },
235
+ {
236
+ "color": "red",
237
+ "value": 80
238
+ }
239
+ ]
240
+ }
241
+ },
242
+ "overrides": []
243
+ },
244
+ "gridPos": {
245
+ "h": 4,
246
+ "w": 6,
247
+ "x": 18,
248
+ "y": 0
249
+ },
250
+ "id": 3,
251
+ "options": {
252
+ "colorMode": "value",
253
+ "graphMode": "area",
254
+ "justifyMode": "auto",
255
+ "orientation": "auto",
256
+ "percentChangeColorMode": "standard",
257
+ "reduceOptions": {
258
+ "calcs": [
259
+ "lastNotNull"
260
+ ],
261
+ "fields": "",
262
+ "values": false
263
+ },
264
+ "showPercentChange": false,
265
+ "textMode": "auto",
266
+ "wideLayout": true
267
+ },
268
+ "pluginVersion": "12.2.0",
269
+ "targets": [
270
+ {
271
+ "datasource": "SQLite",
272
+ "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 ('$Txgroup' like '{%' or g.name = '$Txgroup')",
273
+ "queryType": "table",
274
+ "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 ('$Txgroup' like '{%' or g.name = '$Txgroup')",
275
+ "refId": "A",
276
+ "timeColumns": [
277
+ "time",
278
+ "ts"
279
+ ]
280
+ }
281
+ ],
282
+ "title": "Daily Expenses",
283
+ "type": "stat"
284
+ },
285
+ {
286
+ "datasource": "SQLite",
287
+ "description": "",
288
+ "fieldConfig": {
289
+ "defaults": {
290
+ "color": {
291
+ "mode": "palette-classic"
292
+ },
293
+ "custom": {
294
+ "axisBorderShow": false,
295
+ "axisCenteredZero": false,
296
+ "axisColorMode": "text",
297
+ "axisLabel": "",
298
+ "axisPlacement": "auto",
299
+ "barAlignment": 0,
300
+ "barWidthFactor": 0.6,
301
+ "drawStyle": "bars",
302
+ "fillOpacity": 70,
303
+ "gradientMode": "none",
304
+ "hideFrom": {
305
+ "legend": false,
306
+ "tooltip": false,
307
+ "viz": false
308
+ },
309
+ "insertNulls": false,
310
+ "lineInterpolation": "linear",
311
+ "lineWidth": 1,
312
+ "pointSize": 5,
313
+ "scaleDistribution": {
314
+ "type": "linear"
315
+ },
316
+ "showPoints": "auto",
317
+ "showValues": false,
318
+ "spanNulls": false,
319
+ "stacking": {
320
+ "group": "A",
321
+ "mode": "normal"
322
+ },
323
+ "thresholdsStyle": {
324
+ "mode": "off"
325
+ }
326
+ },
327
+ "mappings": [],
328
+ "thresholds": {
329
+ "mode": "absolute",
330
+ "steps": [
331
+ {
332
+ "color": "green",
333
+ "value": 0
334
+ },
335
+ {
336
+ "color": "red",
337
+ "value": 80
338
+ }
339
+ ]
340
+ }
341
+ },
342
+ "overrides": [
343
+ {
344
+ "matcher": {
345
+ "id": "byName",
346
+ "options": "Net (sum)"
347
+ },
348
+ "properties": [
349
+ {
350
+ "id": "custom.drawStyle",
351
+ "value": "line"
352
+ },
353
+ {
354
+ "id": "custom.stacking",
355
+ "value": {
356
+ "group": "A",
357
+ "mode": "none"
358
+ }
359
+ },
360
+ {
361
+ "id": "custom.fillOpacity",
362
+ "value": 19
363
+ }
364
+ ]
365
+ }
366
+ ]
367
+ },
368
+ "gridPos": {
369
+ "h": 12,
370
+ "w": 24,
371
+ "x": 0,
372
+ "y": 4
373
+ },
374
+ "id": 11,
375
+ "options": {
376
+ "legend": {
377
+ "calcs": [],
378
+ "displayMode": "list",
379
+ "placement": "bottom",
380
+ "showLegend": true
381
+ },
382
+ "tooltip": {
383
+ "hideZeros": false,
384
+ "mode": "single",
385
+ "sort": "none"
386
+ }
387
+ },
388
+ "pluginVersion": "12.2.0",
389
+ "targets": [
390
+ {
391
+ "datasource": "SQLite",
392
+ "queryText": "SELECT t.timestamp, SUM(CASE WHEN gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') THEN t.value_usd ELSE 0 END) AS \"Total 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 ('$Txgroup' like '{%' or g.name = '$Txgroup') GROUP BY timestamp ORDER BY timestamp;",
393
+ "queryType": "table",
394
+ "rawQueryText": "SELECT t.timestamp, SUM(CASE WHEN gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') THEN t.value_usd ELSE 0 END) AS \"Total 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 ('$Txgroup' like '{%' or g.name = '$Txgroup') GROUP BY timestamp ORDER BY timestamp;",
395
+ "refId": "A",
396
+ "timeColumns": [
397
+ "timestamp"
398
+ ]
399
+ }
400
+ ],
401
+ "title": "Weekly Cashflow",
402
+ "transformations": [
403
+ {
404
+ "id": "formatTime",
405
+ "options": {
406
+ "outputFormat": "YYYY-WW",
407
+ "timeField": "timestamp",
408
+ "timezone": "browser",
409
+ "useTimezone": true
410
+ }
411
+ },
412
+ {
413
+ "id": "convertFieldType",
414
+ "options": {
415
+ "conversions": [
416
+ {
417
+ "dateFormat": "YYYY-WW",
418
+ "destinationType": "time",
419
+ "targetField": "timestamp"
420
+ }
421
+ ],
422
+ "fields": {}
423
+ }
424
+ },
425
+ {
426
+ "id": "groupBy",
427
+ "options": {
428
+ "fields": {
429
+ "Cost of Revenue": {
430
+ "aggregations": [
431
+ "sum"
432
+ ],
433
+ "operation": "aggregate"
434
+ },
435
+ "Expenses": {
436
+ "aggregations": [
437
+ "sum"
438
+ ],
439
+ "operation": "aggregate"
440
+ },
441
+ "Net": {
442
+ "aggregations": [
443
+ "sum"
444
+ ],
445
+ "operation": "aggregate"
446
+ },
447
+ "Other Expenses": {
448
+ "aggregations": [
449
+ "sum"
450
+ ],
451
+ "operation": "aggregate"
452
+ },
453
+ "Other Income": {
454
+ "aggregations": [
455
+ "sum"
456
+ ],
457
+ "operation": "aggregate"
458
+ },
459
+ "Revenue": {
460
+ "aggregations": [
461
+ "sum"
462
+ ],
463
+ "operation": "aggregate"
464
+ },
465
+ "Timestamp": {
466
+ "aggregations": [],
467
+ "operation": "groupby"
468
+ },
469
+ "Total Expenses": {
470
+ "aggregations": [
471
+ "sum"
472
+ ],
473
+ "operation": "aggregate"
474
+ },
475
+ "Total Revenue": {
476
+ "aggregations": [
477
+ "sum"
478
+ ],
479
+ "operation": "aggregate"
480
+ },
481
+ "timestamp": {
482
+ "aggregations": [],
483
+ "operation": "groupby"
484
+ }
485
+ }
486
+ }
487
+ }
488
+ ],
489
+ "type": "timeseries"
490
+ }
491
+ ],
492
+ "preload": false,
493
+ "refresh": "",
494
+ "schemaVersion": 42,
495
+ "tags": [],
496
+ "templating": {
497
+ "list": [
498
+ {
499
+ "allowCustomValue": true,
500
+ "current": {
501
+ "text": "All",
502
+ "value": "$__all"
503
+ },
504
+ "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';",
505
+ "description": "",
506
+ "includeAll": true,
507
+ "name": "Txgroup",
508
+ "options": [],
509
+ "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';",
510
+ "refresh": 2,
511
+ "regex": "",
512
+ "sort": 5,
513
+ "type": "query"
514
+ }
515
+ ]
516
+ },
517
+ "time": {
518
+ "from": "now-6M",
519
+ "to": "now"
520
+ },
521
+ "timepicker": {},
522
+ "timezone": "",
523
+ "title": "Expenses Over Time",
524
+ "uid": "62bccd38-918c-4395-9180-8f7f911e9ddf",
525
+ "version": 2
526
+ }