Arbitrage, Gains from Trade and Social Diversity: A Unified Perspective on Resource Allocation