Scrip systems provide a non-monetary trade economy for exchange of resources. We model a scrip system as a stochastic game and study system design issues on selection rules to match potential trade partners over time. We show the optimality of one particular rule in terms of maximizing social welfare for a given scrip system that guarantees players' incentives to participate. We also investigate the optimal number of scrips to issue under this rule. In particular, if the time discount factor is close enough to 1, or trade benefits one partner much more than it costs the other, the maximum social welfare is always achieved no matter how many scrips are in the system. When the benefit of trade and time discount are not sufficiently large, on the other hand, injecting more scrips in the system hurts most participants; as a result, there is an upper bound on the number of scrips allowed in the system, above which some players may default. We show that this upper bound increases with the discount factor as well as the ratio between the benefit and cost of service. Finally, we demonstrate similar properties for a different service provider selection rule that has been analyzed in previous literature.