We study a fundamental issue in the theory of modeling of financial markets. We consider a model where any investment opportunity is described by its cash flows. We allow for a finite number of transactions in a finite time horizon. Each transaction is held at a random moment. This places our model closer to the real world situation than discrete-time or continuous-time models. Moreover, our model creates a general framework to consider markets with different types of imperfection: proportional transaction costs, frictions on the numeraire, etc. We develop an analog of the fundamental theorem of asset pricing. We show that lack of arbitrage is essentially equivalent to existence of a Lipschitz continuous discount process such that the expected value of discounted cash flows of any investment is non-positive. We address the question of contingent claim pricing and hedging.