I keep hearing about the supposed cheapassery of Silicon Valley, but I simply do not see it.
Speaking for myself, I've been able to achieve ~20% raises every single year since I left college by leveraging the explosion in tech salaries. I do not believe I am grossly exceptional by any means. I am out-earning most finance-industry coders (though obviously not bankers).
I just don't see it. When it comes to writing code, the startup scene here in NYC (and in SF, and in SV) are competitive with finance. Short of being a quant your comp packages don't get better than this - at least not if your job description is software engineering.
In fact, I've witnessed the opposite of what you describe. In the engineers I've met there is no shortage of GS/JP Morgan refugees - people sick and tired of the ridiculous hours and being treated like cattle, and jumped ship into our side of tech. I've yet to meet anyone who's bailed from Google/Facebook/et al into GS, but I've met plenty going the other way.
I've met many engineers imported from outside of the US, especially by the likes of Facebook, Google, Amazon, et al. I've never met one that was cheap - every single one earned comfortably into the mid-$100Ks and were worth every penny. In fact, the majority of H-1B holders I've met don't come from third-world countries - they came from developed nations, and they didn't come cheap.
But don't let me get in the way of a convenient narrative, where the only purpose of immigration is the exploitation and oppression of hard-working Americans by evil corporations.