Understanding markets through frictions