Brace expansion does not support variables since it is done before variables are expanded. Use seq instead, if you absolutely must:
for i in $(seq 0 ${num})
Or (much more preferable) get the array keys directly:
for i in "${!assets[@]}"
(Also, for i in .., not for $i in ...)
Hauke LagingHauke Laging got the first error. Once you fix that, this will probably be the next error.
And instead of
read -a tmp <<< `ledger -f finances balance "${assets[${i}]}"`
Consider using:
tmp=($(ledger -f finances balance "${assets[${i}]}"))
The () outside the command substitution converts it into an array.