# Stake Pool

cardano-cli query utxo \\

\--address $(cat payment.addr) \\

\--mainnet > fullUtxo.out

​

tail -n +3 fullUtxo.out | sort -k3 -nr > balance.out

​

cat balance.out

​

tx\_in=""

total\_balance=0

while read -r utxo; do

in\_addr=$(awk '{ print $1 }' <<< "${utxo}")

idx=$(awk '{ print $2 }' <<< "${utxo}")

utxo\_balance=$(awk '{ print $3 }' <<< "${utxo}")

total\_balance=$((${total\_balance}+${utxo\_balance}))

echo TxHash: ${in\_addr}#${idx}

echo ADA: ${utxo\_balance}

tx\_in="${tx\_in} --tx-in ${in\_addr}#${idx}"

done < balance.out

txcnt=$(cat balance.out | wc -l)

echo Total ADA balance: ${total\_balance}

echo Number of UTXOs: ${txcnt}
