dao-treasury 0.0.42__cp311-cp311-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.
- bf2b4fe1f86ad2ea158b__mypyc.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/.grafana/provisioning/dashboards/dashboards.yaml +60 -0
- dao_treasury/.grafana/provisioning/dashboards/streams/LlamaPay.json +225 -0
- dao_treasury/.grafana/provisioning/dashboards/summary/Monthly.json +107 -0
- dao_treasury/.grafana/provisioning/dashboards/transactions/Treasury Transactions.json +387 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow (Including Unsorted).json +835 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow.json +615 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Operating Cashflow.json +492 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Treasury.json +2018 -0
- dao_treasury/.grafana/provisioning/datasources/datasources.yaml +17 -0
- dao_treasury/ENVIRONMENT_VARIABLES.py +20 -0
- dao_treasury/__init__.py +62 -0
- dao_treasury/_docker.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/_docker.py +190 -0
- dao_treasury/_nicknames.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/_nicknames.py +32 -0
- dao_treasury/_wallet.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/_wallet.py +250 -0
- dao_treasury/constants.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/constants.py +34 -0
- dao_treasury/db.py +1408 -0
- dao_treasury/docker-compose.yaml +41 -0
- dao_treasury/main.py +247 -0
- dao_treasury/py.typed +0 -0
- dao_treasury/sorting/__init__.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/__init__.py +295 -0
- dao_treasury/sorting/_matchers.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/_matchers.py +387 -0
- dao_treasury/sorting/_rules.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/_rules.py +235 -0
- dao_treasury/sorting/factory.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/factory.py +299 -0
- dao_treasury/sorting/rule.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/rule.py +346 -0
- dao_treasury/sorting/rules/__init__.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/rules/__init__.py +1 -0
- dao_treasury/sorting/rules/ignore/__init__.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/rules/ignore/__init__.py +1 -0
- dao_treasury/sorting/rules/ignore/llamapay.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/rules/ignore/llamapay.py +20 -0
- dao_treasury/streams/__init__.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/streams/__init__.py +0 -0
- dao_treasury/streams/llamapay.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/streams/llamapay.py +388 -0
- dao_treasury/treasury.py +191 -0
- dao_treasury/types.cpython-311-i386-linux-gnu.so +0 -0
- dao_treasury/types.py +133 -0
- dao_treasury-0.0.42.dist-info/METADATA +119 -0
- dao_treasury-0.0.42.dist-info/RECORD +51 -0
- dao_treasury-0.0.42.dist-info/WHEEL +7 -0
- dao_treasury-0.0.42.dist-info/top_level.txt +2 -0
Binary file
|
@@ -0,0 +1,60 @@
|
|
1
|
+
apiVersion: 1
|
2
|
+
|
3
|
+
providers:
|
4
|
+
# Home
|
5
|
+
- name: 'Summary'
|
6
|
+
folder: 'Summary'
|
7
|
+
type: file
|
8
|
+
disableDeletion: true
|
9
|
+
editable: false
|
10
|
+
options:
|
11
|
+
path: /etc/grafana/provisioning/dashboards/summary
|
12
|
+
|
13
|
+
# Dashboards
|
14
|
+
- name: 'Treasury'
|
15
|
+
folder: 'Treasury'
|
16
|
+
type: file
|
17
|
+
disableDeletion: true
|
18
|
+
editable: false
|
19
|
+
options:
|
20
|
+
path: /etc/grafana/provisioning/dashboards/treasury
|
21
|
+
|
22
|
+
- name: 'Operating Cashflow Summary'
|
23
|
+
folder: 'Treasury'
|
24
|
+
type: file
|
25
|
+
disableDeletion: true
|
26
|
+
editable: false
|
27
|
+
options:
|
28
|
+
path: /etc/grafana/provisioning/dashboards/treasury
|
29
|
+
|
30
|
+
- name: 'Total Cashflow Summary'
|
31
|
+
folder: 'Treasury'
|
32
|
+
type: file
|
33
|
+
disableDeletion: true
|
34
|
+
editable: false
|
35
|
+
options:
|
36
|
+
path: /etc/grafana/provisioning/dashboards/treasury
|
37
|
+
|
38
|
+
- name: 'Total Cashflow Summary (Including Unsorted)'
|
39
|
+
folder: 'Treasury'
|
40
|
+
type: file
|
41
|
+
disableDeletion: true
|
42
|
+
editable: false
|
43
|
+
options:
|
44
|
+
path: /etc/grafana/provisioning/dashboards/treasury
|
45
|
+
|
46
|
+
- name: 'Treasury Transactions'
|
47
|
+
folder: 'Transactions'
|
48
|
+
type: file
|
49
|
+
disableDeletion: true
|
50
|
+
editable: false
|
51
|
+
options:
|
52
|
+
path: /etc/grafana/provisioning/dashboards/transactions
|
53
|
+
|
54
|
+
- name: 'LlamaPay Streams'
|
55
|
+
folder: 'Streams'
|
56
|
+
type: file
|
57
|
+
disableDeletion: true
|
58
|
+
editable: false
|
59
|
+
options:
|
60
|
+
path: /etc/grafana/provisioning/dashboards/streams
|
@@ -0,0 +1,225 @@
|
|
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": 7,
|
22
|
+
"links": [],
|
23
|
+
"liveNow": false,
|
24
|
+
"panels": [
|
25
|
+
{
|
26
|
+
"datasource": {
|
27
|
+
"type": "frser-sqlite-datasource",
|
28
|
+
"uid": "P2D2EEF3E092AF52B"
|
29
|
+
},
|
30
|
+
"description": "",
|
31
|
+
"fieldConfig": {
|
32
|
+
"defaults": {
|
33
|
+
"color": {
|
34
|
+
"mode": "thresholds"
|
35
|
+
},
|
36
|
+
"custom": {
|
37
|
+
"align": "auto",
|
38
|
+
"cellOptions": {
|
39
|
+
"type": "auto"
|
40
|
+
},
|
41
|
+
"inspect": false
|
42
|
+
},
|
43
|
+
"mappings": [],
|
44
|
+
"thresholds": {
|
45
|
+
"mode": "absolute",
|
46
|
+
"steps": [
|
47
|
+
{
|
48
|
+
"color": "green",
|
49
|
+
"value": null
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"color": "red",
|
53
|
+
"value": 80
|
54
|
+
}
|
55
|
+
]
|
56
|
+
}
|
57
|
+
},
|
58
|
+
"overrides": [
|
59
|
+
{
|
60
|
+
"matcher": {
|
61
|
+
"id": "byName",
|
62
|
+
"options": "Factory"
|
63
|
+
},
|
64
|
+
"properties": [
|
65
|
+
{
|
66
|
+
"id": "links",
|
67
|
+
"value": [
|
68
|
+
{
|
69
|
+
"targetBlank": true,
|
70
|
+
"title": "View on Etherscan",
|
71
|
+
"url": "https://etherscan.io/address/${__value.raw}"
|
72
|
+
}
|
73
|
+
]
|
74
|
+
}
|
75
|
+
]
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"matcher": {
|
79
|
+
"id": "byName",
|
80
|
+
"options": "From"
|
81
|
+
},
|
82
|
+
"properties": [
|
83
|
+
{
|
84
|
+
"id": "links",
|
85
|
+
"value": [
|
86
|
+
{
|
87
|
+
"targetBlank": true,
|
88
|
+
"title": "View on Etherscan",
|
89
|
+
"url": "https://etherscan.io/address/${__value.raw}"
|
90
|
+
}
|
91
|
+
]
|
92
|
+
}
|
93
|
+
]
|
94
|
+
},
|
95
|
+
{
|
96
|
+
"matcher": {
|
97
|
+
"id": "byName",
|
98
|
+
"options": "To"
|
99
|
+
},
|
100
|
+
"properties": [
|
101
|
+
{
|
102
|
+
"id": "links",
|
103
|
+
"value": [
|
104
|
+
{
|
105
|
+
"targetBlank": true,
|
106
|
+
"title": "View on Etherscan",
|
107
|
+
"url": "https://etherscan.io/address/${__value.raw}"
|
108
|
+
}
|
109
|
+
]
|
110
|
+
}
|
111
|
+
]
|
112
|
+
},
|
113
|
+
{
|
114
|
+
"matcher": {
|
115
|
+
"id": "byName",
|
116
|
+
"options": "Start Block"
|
117
|
+
},
|
118
|
+
"properties": [
|
119
|
+
{
|
120
|
+
"id": "links",
|
121
|
+
"value": [
|
122
|
+
{
|
123
|
+
"targetBlank": true,
|
124
|
+
"title": "View on Etherscan",
|
125
|
+
"url": "https://etherscan.io/block/${__value.raw}"
|
126
|
+
}
|
127
|
+
]
|
128
|
+
}
|
129
|
+
]
|
130
|
+
},
|
131
|
+
{
|
132
|
+
"matcher": {
|
133
|
+
"id": "byName",
|
134
|
+
"options": "End Block"
|
135
|
+
},
|
136
|
+
"properties": [
|
137
|
+
{
|
138
|
+
"id": "links",
|
139
|
+
"value": [
|
140
|
+
{
|
141
|
+
"targetBlank": true,
|
142
|
+
"title": "View on Etherscan",
|
143
|
+
"url": "https://etherscan.io/block/${__value.raw}"
|
144
|
+
}
|
145
|
+
]
|
146
|
+
}
|
147
|
+
]
|
148
|
+
},
|
149
|
+
{
|
150
|
+
"matcher": {
|
151
|
+
"id": "byName",
|
152
|
+
"options": "Budget Request"
|
153
|
+
},
|
154
|
+
"properties": [
|
155
|
+
{
|
156
|
+
"id": "links",
|
157
|
+
"value": [
|
158
|
+
{
|
159
|
+
"targetBlank": true,
|
160
|
+
"title": "View Budget Request on Github",
|
161
|
+
"url": "https://github.com/yearn/budget/issues/${__value.raw}"
|
162
|
+
}
|
163
|
+
]
|
164
|
+
}
|
165
|
+
]
|
166
|
+
}
|
167
|
+
]
|
168
|
+
},
|
169
|
+
"gridPos": {
|
170
|
+
"h": 19,
|
171
|
+
"w": 24,
|
172
|
+
"x": 0,
|
173
|
+
"y": 0
|
174
|
+
},
|
175
|
+
"id": 1,
|
176
|
+
"options": {
|
177
|
+
"cellHeight": "sm",
|
178
|
+
"footer": {
|
179
|
+
"countRows": false,
|
180
|
+
"fields": "",
|
181
|
+
"reducer": [
|
182
|
+
"sum"
|
183
|
+
],
|
184
|
+
"show": false
|
185
|
+
},
|
186
|
+
"showHeader": true
|
187
|
+
},
|
188
|
+
"pluginVersion": "10.2.0",
|
189
|
+
"targets": [
|
190
|
+
{
|
191
|
+
"datasource": {
|
192
|
+
"type": "frser-sqlite-datasource",
|
193
|
+
"uid": "P2D2EEF3E092AF52B"
|
194
|
+
},
|
195
|
+
"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",
|
196
|
+
"queryType": "table",
|
197
|
+
"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",
|
198
|
+
"refId": "A",
|
199
|
+
"timeColumns": [
|
200
|
+
"time",
|
201
|
+
"ts"
|
202
|
+
]
|
203
|
+
}
|
204
|
+
],
|
205
|
+
"title": "LlamaPay Streams",
|
206
|
+
"type": "table"
|
207
|
+
}
|
208
|
+
],
|
209
|
+
"refresh": "",
|
210
|
+
"schemaVersion": 38,
|
211
|
+
"tags": [],
|
212
|
+
"templating": {
|
213
|
+
"list": []
|
214
|
+
},
|
215
|
+
"time": {
|
216
|
+
"from": "now-6h",
|
217
|
+
"to": "now"
|
218
|
+
},
|
219
|
+
"timepicker": {},
|
220
|
+
"timezone": "",
|
221
|
+
"title": "LlamaPay",
|
222
|
+
"uid": "aa4d62a2-9e52-4acc-8f38-a96c77810aca",
|
223
|
+
"version": 2,
|
224
|
+
"weekStart": ""
|
225
|
+
}
|
@@ -0,0 +1,107 @@
|
|
1
|
+
{
|
2
|
+
"annotations": {
|
3
|
+
"list": [
|
4
|
+
{
|
5
|
+
"builtIn": 1,
|
6
|
+
"datasource": "-- Grafana --",
|
7
|
+
"enable": true,
|
8
|
+
"hide": true,
|
9
|
+
"iconColor": "rgba(0, 211, 255, 1)",
|
10
|
+
"name": "Annotations & Alerts",
|
11
|
+
"type": "dashboard"
|
12
|
+
}
|
13
|
+
]
|
14
|
+
},
|
15
|
+
"editable": true,
|
16
|
+
"fiscalYearStartMonth": 0,
|
17
|
+
"graphTooltip": 0,
|
18
|
+
"id": 2,
|
19
|
+
"links": [],
|
20
|
+
"liveNow": false,
|
21
|
+
"panels": [
|
22
|
+
{
|
23
|
+
"datasource": "SQLite",
|
24
|
+
"fieldConfig": {
|
25
|
+
"defaults": {
|
26
|
+
"color": {
|
27
|
+
"mode": "thresholds"
|
28
|
+
},
|
29
|
+
"custom": {
|
30
|
+
"align": "auto",
|
31
|
+
"cellOptions": {
|
32
|
+
"type": "auto"
|
33
|
+
},
|
34
|
+
"inspect": false
|
35
|
+
},
|
36
|
+
"mappings": [],
|
37
|
+
"thresholds": {
|
38
|
+
"mode": "absolute",
|
39
|
+
"steps": [
|
40
|
+
{
|
41
|
+
"color": "green",
|
42
|
+
"value": null
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"color": "red",
|
46
|
+
"value": 80
|
47
|
+
}
|
48
|
+
]
|
49
|
+
}
|
50
|
+
},
|
51
|
+
"overrides": []
|
52
|
+
},
|
53
|
+
"gridPos": {
|
54
|
+
"h": 9,
|
55
|
+
"w": 24,
|
56
|
+
"x": 0,
|
57
|
+
"y": 0
|
58
|
+
},
|
59
|
+
"id": 1,
|
60
|
+
"options": {
|
61
|
+
"cellHeight": "sm",
|
62
|
+
"footer": {
|
63
|
+
"countRows": false,
|
64
|
+
"fields": "",
|
65
|
+
"reducer": [
|
66
|
+
"sum"
|
67
|
+
],
|
68
|
+
"show": false
|
69
|
+
},
|
70
|
+
"showHeader": true,
|
71
|
+
"sortBy": [
|
72
|
+
{
|
73
|
+
"desc": true,
|
74
|
+
"displayName": "Month"
|
75
|
+
}
|
76
|
+
]
|
77
|
+
},
|
78
|
+
"pluginVersion": "10.2.0",
|
79
|
+
"targets": [
|
80
|
+
{
|
81
|
+
"datasource": "SQLite",
|
82
|
+
"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 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 Expense\",\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 Expense\",\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\"\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
|
+
"queryType": "table",
|
84
|
+
"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 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 Expense\",\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 Expense\",\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\"\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
|
+
}
|
86
|
+
],
|
87
|
+
"title": "Monthly Profit & Loss",
|
88
|
+
"type": "table"
|
89
|
+
}
|
90
|
+
],
|
91
|
+
"refresh": "",
|
92
|
+
"schemaVersion": 38,
|
93
|
+
"tags": [],
|
94
|
+
"templating": {
|
95
|
+
"list": []
|
96
|
+
},
|
97
|
+
"time": {
|
98
|
+
"from": "now-6h",
|
99
|
+
"to": "now"
|
100
|
+
},
|
101
|
+
"timepicker": {},
|
102
|
+
"timezone": "",
|
103
|
+
"title": "Monthly P&L",
|
104
|
+
"uid": "a63fa9a7-d4f3-4092-9bde-194add8bcbeb",
|
105
|
+
"version": 1,
|
106
|
+
"weekStart": ""
|
107
|
+
}
|