dao-treasury 0.0.37__tar.gz → 0.0.62__tar.gz
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.
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/PKG-INFO +10 -2
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/README.md +1 -0
- dao_treasury-0.0.62/dao_treasury/.grafana/provisioning/dashboards/breakdowns/Expenses.json +526 -0
- dao_treasury-0.0.62/dao_treasury/.grafana/provisioning/dashboards/breakdowns/Revenue.json +526 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/.grafana/provisioning/dashboards/dashboards.yaml +25 -1
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/.grafana/provisioning/dashboards/streams/LlamaPay.json +8 -8
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/.grafana/provisioning/dashboards/summary/Monthly.json +10 -9
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/.grafana/provisioning/dashboards/transactions/Treasury Transactions.json +8 -35
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow (Including Unsorted).json +74 -33
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow.json +53 -23
- dao_treasury-0.0.62/dao_treasury/.grafana/provisioning/dashboards/treasury/Current Treasury Assets.json +593 -0
- dao_treasury-0.0.62/dao_treasury/.grafana/provisioning/dashboards/treasury/Historical Treasury Balances.json +2999 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/.grafana/provisioning/dashboards/treasury/Operating Cashflow.json +38 -17
- dao_treasury-0.0.62/dao_treasury/ENVIRONMENT_VARIABLES.py +20 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/__init__.py +14 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/_docker.py +37 -21
- dao_treasury-0.0.62/dao_treasury/_nicknames.py +32 -0
- dao_treasury-0.0.62/dao_treasury/constants.py +39 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/db.py +70 -4
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/docker-compose.yaml +1 -1
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/main.py +6 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/sorting/rule.py +8 -10
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/streams/llamapay.py +14 -2
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/treasury.py +33 -14
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury.egg-info/PKG-INFO +11 -3
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury.egg-info/SOURCES.txt +7 -2
- dao_treasury-0.0.62/dao_treasury.egg-info/requires.txt +1 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/pyproject.toml +11 -4
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/setup.py +2 -2
- dao_treasury-0.0.62/tests/test_treasury.py +63 -0
- dao_treasury-0.0.62/tests/test_wallet.py +298 -0
- dao_treasury-0.0.37/dao_treasury/.grafana/provisioning/dashboards/treasury/Treasury.json +0 -2018
- dao_treasury-0.0.37/dao_treasury/ENVIRONMENT_VARIABLES.py +0 -8
- dao_treasury-0.0.37/dao_treasury/_nicknames.py +0 -17
- dao_treasury-0.0.37/dao_treasury/constants.py +0 -15
- dao_treasury-0.0.37/dao_treasury.egg-info/requires.txt +0 -1
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/MANIFEST.in +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/.grafana/provisioning/datasources/datasources.yaml +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/_wallet.py +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/py.typed +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/sorting/__init__.py +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/sorting/_matchers.py +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/sorting/_rules.py +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/sorting/factory.py +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/sorting/rules/__init__.py +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/sorting/rules/ignore/__init__.py +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/sorting/rules/ignore/llamapay.py +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/streams/__init__.py +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury/types.py +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury.egg-info/dependency_links.txt +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury.egg-info/not-zip-safe +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/dao_treasury.egg-info/top_level.txt +0 -0
- {dao_treasury-0.0.37 → dao_treasury-0.0.62}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: dao_treasury
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.62
|
|
4
4
|
Summary: Produce comprehensive financial reports for your on-chain org
|
|
5
5
|
Classifier: Development Status :: 3 - Alpha
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -14,6 +14,13 @@ Classifier: Operating System :: OS Independent
|
|
|
14
14
|
Classifier: Topic :: Software Development :: Libraries
|
|
15
15
|
Requires-Python: >=3.10,<3.13
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
|
+
Requires-Dist: eth-portfolio-temp==0.2.14
|
|
18
|
+
Dynamic: classifier
|
|
19
|
+
Dynamic: description
|
|
20
|
+
Dynamic: description-content-type
|
|
21
|
+
Dynamic: requires-dist
|
|
22
|
+
Dynamic: requires-python
|
|
23
|
+
Dynamic: summary
|
|
17
24
|
|
|
18
25
|
DAO Treasury is a comprehensive financial reporting and treasury management solution designed specifically for decentralized organizations. Built as an extension to [eth-portfolio](https://github.com/BobTheBuidler/eth-portfolio)'s [Portfolio Exporter](https://bobthebuidler.github.io/eth-portfolio/exporter.html), DAO Treasury automates the collection and visualization of financial data, enabling organizations to monitor and report on treasury activities with clarity and transparency.
|
|
19
26
|
|
|
@@ -59,6 +66,7 @@ poetry run dao-treasury run --wallet 0x123 --network mainnet --interval 12h
|
|
|
59
66
|
**CLI Options:**
|
|
60
67
|
- `--network`: The id of the brownie network the exporter will connect to (default: mainnet)
|
|
61
68
|
- `--interval`: The time interval between each data snapshot (default: 12h)
|
|
69
|
+
- `--concurrency`: The max number of historical blocks to export concurrently. (default: 30)
|
|
62
70
|
- `--daemon`: Run the export process in the background (default: False) (NOTE: currently unsupported)
|
|
63
71
|
- `--grafana-port`: Set the port for the Grafana dashboard where you can view data (default: 3004)
|
|
64
72
|
- `--renderer-port`: Set the port for the report rendering service (default: 8091)
|
|
@@ -42,6 +42,7 @@ poetry run dao-treasury run --wallet 0x123 --network mainnet --interval 12h
|
|
|
42
42
|
**CLI Options:**
|
|
43
43
|
- `--network`: The id of the brownie network the exporter will connect to (default: mainnet)
|
|
44
44
|
- `--interval`: The time interval between each data snapshot (default: 12h)
|
|
45
|
+
- `--concurrency`: The max number of historical blocks to export concurrently. (default: 30)
|
|
45
46
|
- `--daemon`: Run the export process in the background (default: False) (NOTE: currently unsupported)
|
|
46
47
|
- `--grafana-port`: Set the port for the Grafana dashboard where you can view data (default: 3004)
|
|
47
48
|
- `--renderer-port`: Set the port for the report rendering service (default: 8091)
|
|
@@ -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
|
+
}
|