By Michael Robinson
BBC World Service
The US has had an unprecedented building and house price boom
The city of Stockton in California is at the centre of the mortgage crisis now sweeping America.
Because, with house prices tumbling, more people in Stockton face the repossession of their homes than anywhere else in the US.
But Stockton is also a place where you can really get a feel for the staggering amounts of money banks loaned during the boom - with few or no questions asked.
In his 25 years as an estate agent in Stockton, Kevin Moran had never seen anything like it as seemingly limitless bank loans sent house prices rocketing.
US real estate agents have seen the market shift quickly
"It was crazy", he says. "People felt that if they didn't make a high enough offer on a house, it would be gone.
"Instead of saying 'What do you want to do on a Saturday? Let's go to the park', they'd say 'Let's go buy a house'".
At the height of the buying frenzy, in 2006, Will Trawick was selling new homes for a Stockton developer.
Faced with crowds of a hundred buyers, bank loans in hand, all chasing the 20 houses he might have on offer, he organised bingo-style lotteries.
"We had ping-pong balls with numbers, just like you'd see on a TV show", Mr Trawick recalls.
"Everybody would have a number. We'd put the ping-pong balls in, spin it and, you know 'Number 22! Yoo-hoo!' They'd jump up and yell, come on up and pick which home they wanted, and leave a deposit cheque".
It was not only home-buyers who banks were keen to lend to.
With house prices soaring, pretty well anyone who owned a home in Stockton suddenly found they had plenty of equity in their property - equity the banks were eager to convert into cash.
Mr Carrigan says that easy loans saw consumers spend their houses
Steve Carrigan is in charge of economic development for Stockton. He says bank loans made it a party every day.
"People went to the bank and got a loan on the increase in the price of their home. They went out and spent all that money," he explains.
"Price of the home went up again, they went back to the bank and got another loan. They went out again and spent that money on cars and jewellery and furniture - whatever they wanted."
With the help of the banks, Mr Carrigan says, people in Stockton "spent their house".
But that is not how it was meant to be.
After previous financial disasters caused by excessive bank lending, regulators developed rules to limit how many loans a bank could have on its balance sheet.
The rules are complex, but as a rough rule of thumb, they say that for every $1 (50 pence) of shareholder capital a bank has on its balance sheet, it can also have about $10 of loans.
But, as is clear from the torrent of home loans in Stockton and across America, banks were lending far more than that 10 to 1 ratio.
How had they managed to do it?
Professor Roubini says banks skirted around industry rules
The first technique banks used to circumvent regulators' rules is known as "securitisation" - a way of a bank getting loans it had already made off its balance sheet.
They did this by selling their loans off to pension funds, insurance companies, even to other banks around the world.
Professor Nouriel Roubini, the head of a leading New York firm of economic analysts, says securitisation was key to helping banks avoid the regulators' 10:1 rule.
"You make a bunch of mortgages and then you package them and you sell it to someone else," he explains.
"Therefore it goes off the books and therefore you can make even more loans."
As a result, the amount of lending banks could do was "much more massive", he says.
The banks' loans should have been hard to sell because they were low quality - since they were issued with no questions asked, there was little assurance they could be repaid.
But the banks had an answer to that.
To make their risky loans appear attractive to buyers, banks used complex financial engineering to repackage them so they looked super-safe and paid returns well above what equivalent super-safe investments offered.
Even Wall Street veterans were surprised by the debt instruments
Even savvy Wall Street veteran and billionaire Wilbur Ross could not figure out what was happening.
"What they were fundamentally doing was taking a $100 pile of low quality securities and creating something they could sell to investors for $103," he says.
"So there was an alchemy - making more price than there was value."
Banks even found ways to get loans off their balance sheets without selling them at all.
They devised bizarre new financial entities - called Special Investment Vehicles or SIVs - in which loans could be held technically and legally off balance sheet, out of sight, and beyond the scope of regulators' rules.
So, once again, SIVs made room on balance sheets for banks to go on lending.
As long as house prices went on rising, few people raised questions about the potential risks in the structures the banks had created.
Everyone was making too much money to be worried.
But then in 2007, when American house prices began to plummet, the true dangers began to be revealed.
Banks had got round regulators' rules by selling off their risky loans, but because so many of the securitised loans were bought by other banks, the losses were still inside the banking system.
Loans held in SIVs were technically off banks' balance sheets, but when the value of the loans inside SIVs started to collapse, the banks which set them up found that they were still responsible for them.
So losses from investments which might have appeared outside the scope of the regulators' 10:1 rule, suddenly started turning up on bank balance sheets.
No-one knows how big the losses from investments based on American mortgages will eventually prove to be - estimates now range from $200bn upwards.
The problem now facing many of the biggest lenders is that when losses appear on banks' balance sheets, the regulator's 10:1 rule comes back into play because losses reduce a banks' shareholder capital.
Professor Roubini says that even at the low end of the estimates the potential impact on the rest of the economy is massive.
"If you have a $200bn loss, that reduced your capital by $200bn, you have to reduce your lending by 10 times as much," he explains.
"So you could have a reduction of total credit to the economy of two trillion dollars".
The professor predicts that a reduction of credit on that scale will trigger a recession in America which could become global as the contagion spreads through the banking system worldwide.
Which is why, faced with these gaping and growing holes in their shareholders' capital, some of the biggest US banks are selling off shares to China, Singapore, or wealthy Gulf oil states, in an attempt to repair the damage.
Some American politicians are already complaining about such sales but, for all our sakes, we had better hope the banks' last ditch strategy succeeds in avoiding at least some of the probable pain to come in 2008.
You can hear Michael Robinson's special series Debt Threat - the Monster Stalking the Global Economy on BBC World Service on Monday 31 December and Monday 7 January at 0905 GMT.