forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlightning-bkpr-channelsapy.json
306 lines (306 loc) · 10.2 KB
/
lightning-bkpr-channelsapy.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"rpc": "bkpr-channelsapy",
"title": "Command to list stats on channel earnings",
"description": [
"The **bkpr-channelsapy** RPC command lists stats on routing income, leasing income, and various calculated APYs for channel routed funds."
],
"request": {
"required": [],
"additionalProperties": false,
"properties": {
"start_time": {
"type": "u64",
"description": [
"UNIX timestamp (in seconds) to filter events after the provided timestamp."
],
"default": "zero"
},
"end_time": {
"type": "u64",
"description": [
"UNIX timestamp (in seconds) to filter events up to and at the provided timestamp."
],
"default": "max-int"
}
}
},
"response": {
"required": [
"channels_apy"
],
"additionalProperties": false,
"properties": {
"channels_apy": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"account",
"routed_out_msat",
"routed_in_msat",
"lease_fee_paid_msat",
"lease_fee_earned_msat",
"pushed_out_msat",
"pushed_in_msat",
"our_start_balance_msat",
"channel_start_balance_msat",
"fees_out_msat",
"utilization_out",
"utilization_in",
"apy_out",
"apy_in",
"apy_total"
],
"properties": {
"account": {
"type": "string",
"description": [
"The account name. If the account is a channel, the channel_id. The 'net' entry is the rollup of all channel accounts."
]
},
"routed_out_msat": {
"type": "msat",
"description": [
"Sats routed (outbound)."
]
},
"routed_in_msat": {
"type": "msat",
"description": [
"Sats routed (inbound)."
]
},
"lease_fee_paid_msat": {
"type": "msat",
"description": [
"Sats paid for leasing inbound (liquidity ads)."
]
},
"lease_fee_earned_msat": {
"type": "msat",
"description": [
"Sats earned for leasing outbound (liquidity ads)."
]
},
"pushed_out_msat": {
"type": "msat",
"description": [
"Sats pushed to peer at open."
]
},
"pushed_in_msat": {
"type": "msat",
"description": [
"Sats pushed in from peer at open."
]
},
"our_start_balance_msat": {
"type": "msat",
"description": [
"Starting balance in channel at funding. Note that if our start balance is zero, any _initial field will be omitted (can't divide by zero)."
]
},
"channel_start_balance_msat": {
"type": "msat",
"description": [
"Total starting balance at funding."
]
},
"fees_out_msat": {
"type": "msat",
"description": [
"Fees earned on routed outbound."
]
},
"fees_in_msat": {
"type": "msat",
"description": [
"Fees earned on routed inbound."
]
},
"utilization_out": {
"type": "string",
"description": [
"Sats routed outbound / total start balance."
]
},
"utilization_out_initial": {
"type": "string",
"description": [
"Sats routed outbound / our start balance."
]
},
"utilization_in": {
"type": "string",
"description": [
"Sats routed inbound / total start balance."
]
},
"utilization_in_initial": {
"type": "string",
"description": [
"Sats routed inbound / our start balance."
]
},
"apy_out": {
"type": "string",
"description": [
"Fees earned on outbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)."
]
},
"apy_out_initial": {
"type": "string",
"description": [
"Fees earned on outbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)."
]
},
"apy_in": {
"type": "string",
"description": [
"Fees earned on inbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)."
]
},
"apy_in_initial": {
"type": "string",
"description": [
"Fees earned on inbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)."
]
},
"apy_total": {
"type": "string",
"description": [
"Total fees earned on routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)."
]
},
"apy_total_initial": {
"type": "string",
"description": [
"Total fees earned on routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)."
]
},
"apy_lease": {
"type": "string",
"description": [
"Lease fees earned over total amount leased for the lease term, amortized to a year (APY). Only appears if channel was leased out by us."
]
}
}
}
}
}
},
"author": [
"Lisa Neigut <<[email protected]>> is mainly responsible."
],
"see_also": [
"lightning-bkpr-listincome(7)",
"lightning-bkpr-listfunds(7)",
"lightning-bkpr-listaccountevents(7)",
"lightning-bkpr-dumpincomecsv(7)",
"lightning-listpeers(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:bkpr-channelsapy#1",
"method": "bkpr-channelsapy",
"params": {}
},
"response": {
"channels_apy": [
{
"account": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7",
"routed_out_msat": 1000000,
"routed_in_msat": 510081208,
"lease_fee_paid_msat": 0,
"lease_fee_earned_msat": 0,
"pushed_out_msat": 0,
"pushed_in_msat": 0,
"our_start_balance_msat": 0,
"channel_start_balance_msat": 1000000000,
"fees_out_msat": 0,
"fees_in_msat": 106,
"utilization_out": "0.1000%",
"utilization_in": "51.0081%",
"utilization_in_initial": "51.0081%",
"apy_out": "0.0000%",
"apy_in": "0.0252%",
"apy_in_initial": "0.0252%",
"apy_total": "0.0252%"
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"routed_out_msat": 510181102,
"routed_in_msat": 0,
"lease_fee_paid_msat": 0,
"lease_fee_earned_msat": 0,
"pushed_out_msat": 0,
"pushed_in_msat": 0,
"our_start_balance_msat": 1000000000,
"channel_start_balance_msat": 1000000000,
"fees_out_msat": 106,
"fees_in_msat": 0,
"utilization_out": "51.0181%",
"utilization_out_initial": "51.0181%",
"utilization_in": "0.0000%",
"apy_out": "0.0505%",
"apy_out_initial": "0.0505%",
"apy_in": "0.0000%",
"apy_total": "0.0505%",
"apy_total_initial": "0.0505%"
},
{
"account": "f8fc83a432cbfb2fffe222cc06727fdd977b5dd10ebd6707158e799e6f522d9f",
"routed_out_msat": 500000000,
"routed_in_msat": 0,
"lease_fee_paid_msat": 0,
"lease_fee_earned_msat": 0,
"pushed_out_msat": 0,
"pushed_in_msat": 0,
"our_start_balance_msat": 1000000000,
"channel_start_balance_msat": 1000000000,
"fees_out_msat": 0,
"fees_in_msat": 0,
"utilization_out": "50.0000%",
"utilization_out_initial": "50.0000%",
"utilization_in": "0.0000%",
"apy_out": "0.0000%",
"apy_out_initial": "0.0000%",
"apy_in": "0.0000%",
"apy_total": "0.0000%",
"apy_total_initial": "0.0000%"
},
{
"account": "net",
"routed_out_msat": 1011181102,
"routed_in_msat": 510081208,
"lease_fee_paid_msat": 0,
"lease_fee_earned_msat": 0,
"pushed_out_msat": 0,
"pushed_in_msat": 0,
"our_start_balance_msat": 2000000000,
"channel_start_balance_msat": 3000000000,
"fees_out_msat": 106,
"fees_in_msat": 106,
"utilization_out": "33.7060%",
"utilization_out_initial": "50.5591%",
"utilization_in": "17.0027%",
"utilization_in_initial": "51.0081%",
"apy_out": "0.0084%",
"apy_out_initial": "0.0126%",
"apy_in": "0.0084%",
"apy_in_initial": "0.0252%",
"apy_total": "0.0168%",
"apy_total_initial": "0.0168%"
}
]
}
}
]
}