dao-treasury 0.0.21__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.
- 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 -7
- dao_treasury/.grafana/provisioning/dashboards/streams/LlamaPay.json +220 -0
- dao_treasury/.grafana/provisioning/dashboards/summary/Monthly.json +286 -29
- dao_treasury/.grafana/provisioning/dashboards/transactions/Treasury Transactions.json +217 -84
- dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow (Including Unsorted).json +808 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow.json +602 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Current Treasury Assets.json +981 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Historical Treasury Balances.json +3060 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Operating Cashflow.json +478 -0
- dao_treasury/.grafana/provisioning/datasources/datasources.yaml +17 -0
- dao_treasury/ENVIRONMENT_VARIABLES.py +20 -0
- dao_treasury/__init__.py +20 -0
- dao_treasury/_docker.cp311-win_amd64.pyd +0 -0
- dao_treasury/_docker.py +67 -38
- dao_treasury/_nicknames.cp311-win_amd64.pyd +0 -0
- dao_treasury/_nicknames.py +24 -2
- dao_treasury/_wallet.cp311-win_amd64.pyd +0 -0
- dao_treasury/_wallet.py +157 -16
- dao_treasury/constants.cp311-win_amd64.pyd +0 -0
- dao_treasury/constants.py +39 -0
- dao_treasury/db.py +384 -45
- dao_treasury/docker-compose.yaml +6 -5
- dao_treasury/main.py +118 -17
- dao_treasury/sorting/__init__.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/__init__.py +171 -42
- dao_treasury/sorting/_matchers.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/_rules.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/_rules.py +1 -3
- dao_treasury/sorting/factory.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/factory.py +2 -6
- dao_treasury/sorting/rule.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/rule.py +13 -10
- dao_treasury/sorting/rules/__init__.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/rules/__init__.py +1 -0
- dao_treasury/sorting/rules/ignore/__init__.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/rules/ignore/__init__.py +1 -0
- dao_treasury/sorting/rules/ignore/llamapay.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/rules/ignore/llamapay.py +20 -0
- dao_treasury/streams/__init__.cp311-win_amd64.pyd +0 -0
- dao_treasury/streams/__init__.py +0 -0
- dao_treasury/streams/llamapay.cp311-win_amd64.pyd +0 -0
- dao_treasury/streams/llamapay.py +388 -0
- dao_treasury/treasury.py +79 -30
- dao_treasury/types.cp311-win_amd64.pyd +0 -0
- dao_treasury-0.0.71.dist-info/METADATA +134 -0
- dao_treasury-0.0.71.dist-info/RECORD +54 -0
- dao_treasury-0.0.71.dist-info/top_level.txt +2 -0
- dao_treasury__mypyc.cp311-win_amd64.pyd +0 -0
- 52b51d40e96d4333695d__mypyc.cp311-win_amd64.pyd +0 -0
- dao_treasury/.grafana/provisioning/datasources/sqlite.yaml +0 -10
- dao_treasury-0.0.21.dist-info/METADATA +0 -63
- dao_treasury-0.0.21.dist-info/RECORD +0 -31
- dao_treasury-0.0.21.dist-info/top_level.txt +0 -2
- {dao_treasury-0.0.21.dist-info → dao_treasury-0.0.71.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,220 @@
|
|
|
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": "Displays all LlamaPay payment streams managed by the DAO, including stream ID, factory, start/end block, token, sender, recipient, reason, budget request, amount per second, status, and transaction group.\n\nData Links: Click on addresses or blocks to view them on Etherscan. Click on a budget request to view the related Github issue.",
|
|
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": ["sum"],
|
|
181
|
+
"show": false
|
|
182
|
+
},
|
|
183
|
+
"showHeader": true
|
|
184
|
+
},
|
|
185
|
+
"pluginVersion": "12.1.1",
|
|
186
|
+
"targets": [
|
|
187
|
+
{
|
|
188
|
+
"datasource": {
|
|
189
|
+
"type": "frser-sqlite-datasource",
|
|
190
|
+
"uid": "P2D2EEF3E092AF52B"
|
|
191
|
+
},
|
|
192
|
+
"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",
|
|
193
|
+
"queryType": "table",
|
|
194
|
+
"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",
|
|
195
|
+
"refId": "A",
|
|
196
|
+
"timeColumns": ["time", "ts"]
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"title": "LlamaPay Streams",
|
|
200
|
+
"type": "table"
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"preload": false,
|
|
204
|
+
"refresh": "",
|
|
205
|
+
"schemaVersion": 41,
|
|
206
|
+
"tags": ["streams", "llamapay", "payments"],
|
|
207
|
+
"templating": {
|
|
208
|
+
"list": []
|
|
209
|
+
},
|
|
210
|
+
"time": {
|
|
211
|
+
"from": "now-6h",
|
|
212
|
+
"to": "now"
|
|
213
|
+
},
|
|
214
|
+
"timepicker": {},
|
|
215
|
+
"timezone": "",
|
|
216
|
+
"title": "LlamaPay",
|
|
217
|
+
"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.",
|
|
218
|
+
"uid": "aa4d62a2-9e52-4acc-8f38-a96c77810aca",
|
|
219
|
+
"version": 3
|
|
220
|
+
}
|
|
@@ -12,46 +12,314 @@
|
|
|
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,
|
|
18
19
|
"id": 2,
|
|
19
20
|
"links": [],
|
|
20
|
-
"liveNow": false,
|
|
21
21
|
"panels": [
|
|
22
22
|
{
|
|
23
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.\n\nClick on any underlined cell value to see all transactions for that transaction group and time period.\n\nYou can download this table as a CSV. Click on the three dots in the upper right corner, navigate \"Inspect\" -> \"Data\", select your desired options and click \"Download CSV\".",
|
|
24
25
|
"fieldConfig": {
|
|
25
26
|
"defaults": {
|
|
26
27
|
"color": {
|
|
27
|
-
"mode": "
|
|
28
|
+
"mode": "continuous-RdYlGr"
|
|
28
29
|
},
|
|
29
30
|
"custom": {
|
|
30
31
|
"align": "auto",
|
|
31
32
|
"cellOptions": {
|
|
32
33
|
"type": "auto"
|
|
33
34
|
},
|
|
34
|
-
"
|
|
35
|
+
"footer": {
|
|
36
|
+
"reducers": ["sum", "max", "mean", "median"]
|
|
37
|
+
},
|
|
38
|
+
"inspect": true
|
|
35
39
|
},
|
|
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
|
+
],
|
|
36
48
|
"mappings": [],
|
|
37
49
|
"thresholds": {
|
|
38
50
|
"mode": "absolute",
|
|
39
51
|
"steps": [
|
|
40
52
|
{
|
|
41
53
|
"color": "green",
|
|
42
|
-
"value":
|
|
54
|
+
"value": 0
|
|
43
55
|
},
|
|
44
56
|
{
|
|
45
57
|
"color": "red",
|
|
46
58
|
"value": 80
|
|
47
59
|
}
|
|
48
60
|
]
|
|
49
|
-
}
|
|
61
|
+
},
|
|
62
|
+
"unit": "currencyUSD"
|
|
50
63
|
},
|
|
51
|
-
"overrides": [
|
|
64
|
+
"overrides": [
|
|
65
|
+
{
|
|
66
|
+
"matcher": {
|
|
67
|
+
"id": "byName",
|
|
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"
|
|
143
|
+
},
|
|
144
|
+
"properties": [
|
|
145
|
+
{
|
|
146
|
+
"id": "custom.cellOptions",
|
|
147
|
+
"value": {
|
|
148
|
+
"type": "color-text"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"id": "color",
|
|
153
|
+
"value": {
|
|
154
|
+
"mode": "fixed"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"matcher": {
|
|
161
|
+
"id": "byName",
|
|
162
|
+
"options": "Other Expenses"
|
|
163
|
+
},
|
|
164
|
+
"properties": [
|
|
165
|
+
{
|
|
166
|
+
"id": "custom.cellOptions",
|
|
167
|
+
"value": {
|
|
168
|
+
"type": "color-text"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": "color",
|
|
173
|
+
"value": {
|
|
174
|
+
"mode": "fixed"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"matcher": {
|
|
181
|
+
"id": "byName",
|
|
182
|
+
"options": "Operating Net"
|
|
183
|
+
},
|
|
184
|
+
"properties": [
|
|
185
|
+
{
|
|
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"
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"matcher": {
|
|
204
|
+
"id": "byName",
|
|
205
|
+
"options": "month_start"
|
|
206
|
+
},
|
|
207
|
+
"properties": [
|
|
208
|
+
{
|
|
209
|
+
"id": "unit"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"id": "custom.hideFrom.viz",
|
|
213
|
+
"value": true
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"matcher": {
|
|
219
|
+
"id": "byName",
|
|
220
|
+
"options": "month_end"
|
|
221
|
+
},
|
|
222
|
+
"properties": [
|
|
223
|
+
{
|
|
224
|
+
"id": "unit"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"id": "custom.hideFrom.viz",
|
|
228
|
+
"value": true
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"matcher": {
|
|
234
|
+
"id": "byName",
|
|
235
|
+
"options": "Revenue"
|
|
236
|
+
},
|
|
237
|
+
"properties": [
|
|
238
|
+
{
|
|
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
|
+
}
|
|
250
|
+
}
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"matcher": {
|
|
255
|
+
"id": "byName",
|
|
256
|
+
"options": "Expenses"
|
|
257
|
+
},
|
|
258
|
+
"properties": [
|
|
259
|
+
{
|
|
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
|
+
}
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"matcher": {
|
|
276
|
+
"id": "byName",
|
|
277
|
+
"options": "Cost of Revenue"
|
|
278
|
+
},
|
|
279
|
+
"properties": [
|
|
280
|
+
{
|
|
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
|
+
}
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"matcher": {
|
|
297
|
+
"id": "byName",
|
|
298
|
+
"options": "Month"
|
|
299
|
+
},
|
|
300
|
+
"properties": [
|
|
301
|
+
{
|
|
302
|
+
"id": "color",
|
|
303
|
+
"value": {
|
|
304
|
+
"fixedColor": "#ffffff",
|
|
305
|
+
"mode": "fixed"
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"id": "custom.cellOptions",
|
|
310
|
+
"value": {
|
|
311
|
+
"type": "color-text"
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"id": "links"
|
|
316
|
+
}
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
]
|
|
52
320
|
},
|
|
53
321
|
"gridPos": {
|
|
54
|
-
"h":
|
|
322
|
+
"h": 20,
|
|
55
323
|
"w": 24,
|
|
56
324
|
"x": 0,
|
|
57
325
|
"y": 0
|
|
@@ -59,54 +327,43 @@
|
|
|
59
327
|
"id": 1,
|
|
60
328
|
"options": {
|
|
61
329
|
"cellHeight": "sm",
|
|
62
|
-
"footer": {
|
|
63
|
-
"countRows": false,
|
|
64
|
-
"fields": "",
|
|
65
|
-
"reducer": [
|
|
66
|
-
"sum"
|
|
67
|
-
],
|
|
68
|
-
"show": false
|
|
69
|
-
},
|
|
70
330
|
"showHeader": true,
|
|
71
331
|
"sortBy": [
|
|
72
332
|
{
|
|
73
333
|
"desc": true,
|
|
74
|
-
"displayName": "
|
|
334
|
+
"displayName": "Month"
|
|
75
335
|
}
|
|
76
336
|
]
|
|
77
337
|
},
|
|
78
|
-
"pluginVersion": "
|
|
338
|
+
"pluginVersion": "12.2.1",
|
|
79
339
|
"targets": [
|
|
80
340
|
{
|
|
81
341
|
"datasource": "SQLite",
|
|
82
|
-
"queryText": "
|
|
342
|
+
"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;",
|
|
83
343
|
"queryType": "table",
|
|
84
|
-
"rawQueryText": "
|
|
344
|
+
"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;",
|
|
85
345
|
"refId": "A",
|
|
86
|
-
"timeColumns": [
|
|
87
|
-
"time",
|
|
88
|
-
"ts"
|
|
89
|
-
]
|
|
346
|
+
"timeColumns": ["time", "ts"]
|
|
90
347
|
}
|
|
91
348
|
],
|
|
92
|
-
"title": "
|
|
349
|
+
"title": "Monthly Profit & Loss",
|
|
93
350
|
"type": "table"
|
|
94
351
|
}
|
|
95
352
|
],
|
|
353
|
+
"preload": false,
|
|
96
354
|
"refresh": "",
|
|
97
|
-
"schemaVersion":
|
|
355
|
+
"schemaVersion": 42,
|
|
98
356
|
"tags": [],
|
|
99
357
|
"templating": {
|
|
100
358
|
"list": []
|
|
101
359
|
},
|
|
102
360
|
"time": {
|
|
103
|
-
"from": "now
|
|
361
|
+
"from": "now/y",
|
|
104
362
|
"to": "now"
|
|
105
363
|
},
|
|
106
364
|
"timepicker": {},
|
|
107
365
|
"timezone": "",
|
|
108
366
|
"title": "Monthly P&L",
|
|
109
367
|
"uid": "a63fa9a7-d4f3-4092-9bde-194add8bcbeb",
|
|
110
|
-
"version":
|
|
111
|
-
|
|
112
|
-
}
|
|
368
|
+
"version": 6
|
|
369
|
+
}
|