Foundations of pseudomarkets : walrasian equilibria for discrete resources