A theory of banking structure