lightning-bkpr-channelsapy -- Command to list stats on channel earnings
SYNOPSIS
bkpr-channelsapy [start_time] [end_time]
DESCRIPTION
The bkpr-channelsapy RPC command lists stats on routing income, leasing income, and various calculated APYs for channel routed funds.
- start_time (u64, optional): UNIX timestamp (in seconds) to filter events after the provided timestamp. The default is zero.
- end_time (u64, optional): UNIX timestamp (in seconds) to filter events up to and at the provided timestamp. The default is max-int.
RETURN VALUE
On success, an object containing channels_apy is returned. It is an array of objects, where each object contains:
- account (string): 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 (msat): Sats routed (outbound).
- routed_in_msat (msat): Sats routed (inbound).
- lease_fee_paid_msat (msat): Sats paid for leasing inbound (liquidity ads).
- lease_fee_earned_msat (msat): Sats earned for leasing outbound (liquidity ads).
- pushed_out_msat (msat): Sats pushed to peer at open.
- pushed_in_msat (msat): Sats pushed in from peer at open.
- our_start_balance_msat (msat): 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 (msat): Total starting balance at funding.
- fees_out_msat (msat): Fees earned on routed outbound.
- utilization_out (string): Sats routed outbound / total start balance.
- utilization_in (string): Sats routed inbound / total start balance.
- apy_out (string): 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_in (string): 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_total (string): Total fees earned on routed payments / total start balance for the length of time this channel has been open amortized to a year (APY).
- fees_in_msat (msat, optional): Fees earned on routed inbound.
- utilization_out_initial (string, optional): Sats routed outbound / our start balance.
- utilization_in_initial (string, optional): Sats routed inbound / our start balance.
- apy_out_initial (string, optional): 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_initial (string, optional): 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_initial (string, optional): 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 (string, optional): 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
Example 1:
Request:
lightning-cli bkpr-channelsapy
{
"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%"
}
]
}