Dynamic Markets with Many Agents: Applications in Social Learning and Competition