I am running a c-lightning node and want to know how many btc I am owning on this wallet and how many I can spend. lightning-cli listchannels does not help. What do I need to do?

2 Answers 2


Use the RPC-Interface listfunds lightning-cli listfunds which lists all payment channels and UTXO.

If you wish to have a more nicely display you can use this small tool: https://github.com/renepickhardt/lightning-helpers

git clone https://github.com/renepickhardt/lightning-helpers.git

cd lightning-helpers
sudo make install

it aggregates everything so that you can see your total funds. Also you can add a parameter to change the unit of display.

If you don't trust a third party tool and don't want to read the source code you can use this little shell script:

utxo values:

lightning-cli listfunds | grep "value" | sed 's/ "value": //g' | sed 's/,//g' | awk '{s+=$1} END {print s}'

total channel balance on your side:

lightning-cli listfunds | grep "channel_sat" | sed 's/ "channel_sat": //g' | sed 's/,//g' | awk '{s+=$1} END {print s}'


If you have jq installed, you can ask it to sum up all the values for you. For example, to get the total amount stored in your node’s UTXOs:

lightning-cli listfunds | jq '[.outputs[].value] | add'

If you want your output in BTC rather than satoshis, you can divide it right away:

lightning-cli listfunds | jq '[.outputs[].value] | add / 100000000'
  • 1
    lightning-cli listfunds | jq '[.channels[].channel_sat] | add / 100000000' for the btc in channels on your side
    – user112185
    Commented Jul 13, 2021 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.