E.1 Continuous Double Auction (CDA)

Continuous Double Auctions are one out of thousands of possible auction forms i.e., procedures to "negociate" a price between sellers and buyers. The main characteristics of CDAs is that it runs in continuous mode i.e., there are no "trading phases" like other auctions may have.

For example, there are auctions like those organized by Southeby's where the seller fixes a minimal prices. Then potential buyers have a limited amount of time to submit their bids, there may be several rounds of bids, each bidder trying to outbid its opponents. Finally the auction is closed, awarding the good to the bidder that offered to pay the most.

In continuous auctions we have a fully symmetric configuration with multiple bidders and multiple sellers. Price offers to buy and buy offers to sell may be submitted at any time, and may be retracted at any time. A public order book lists the currently best (highest) bids and best (lowest) sell offers. As soon as one bidder offers a price that is equal or better to the lowest sell offer, the CDA matches these offers. They are removed from the system and from the order book. Today's electronic stock exchanges usually work with CDAs.

From an Operating System point of view, CDAs can be considered as an anonymous synchronization primitive where the system only reveils the price and quantity of items that a party wants to buy or sell and where the parties block until a match can be made. A single synchronization primitive is provided:

long long cda_offer(int handle, int *quantity, int *price, struct timeval *timeout)
where: In case of a match, both parties receive the same long long value, which acts like a contract number. It enables the parties to establish contact in order to exchange good against money. This phase of a buy transaction, however, is out of scope of this project. The task is to implement a CDA server under Linux and to write simple demo trading agents that make use of the CDA. An example demo would be a set of 20 concurrent buyers and 10 sellers, all using a simple ramp algorithm (once every second we increase our bid if we did not obtain a match, or lower our offer if we are a seller). The average match price should reflect the reservation prices of buyers and sellers and the buyer/seller ratio.

Implementation considerations


Last updated: April 15, 1999 http://www.docs.uu.se/~tschudin