To purchase a home in foreclosure, you will have to pay the entire bid amount in cash at trustee's sale/foreclosure sale.
Bid amount is not just the defaulted amount upon the trust deed. its the entire outstanding secured or mortgage amount that defaulted owed to foreclosing party.
There could be other liabilities which you may have to pay in addition to auction bid. For example, if you bought the property at the junior lien holder, purchase could be subject to all existing senior lien holder.
Secondly, there could be unpaid outstanding property tax lien against the property, if the property taxes have not been paid in the past few years.