getPortfolio
util provides the total spendable balance, it doesn’t consider the execution fee, as it is chain-specific and depends on the transaction gas cost.
To get an estimate of the maximum amount of tokens you can spend on a given transaction, use getMaxSpendableAmount
. In this case, we get the maximum spendable USDC amount on Base Sepolia: