Take what into account? They basically look at current valuations and offer loans up to some fraction of that amount.
And that’s generally the way the ultra-rich operate, they don’t actually sell anything, they just borrow against their assets. They punt the can down the road until they die, at which point those unrealized gains get stepped up in basis for those who inherit it. If you have enough stock assets, you can service the debt with the capital gains you’re forced to realize (i.e. dividends).
So the bank sees someone with $100B in assets asking for a $10M loan or whatever, and they’re completely happy to offer that, because even if the stock gets cut in half, he can still pay the debt.