Essays on Markets with Frictions