
a result, the theoretical fairness guarantees provided by such exchanges are not retained in reality.
To address this problem, they propose the LIBRA system that achieves a relaxed notion of fairness
by making clever use of randomness in routing orders to the matching engine. Our work focuses
on a complementary and an arguably more basic aspect of exchanges; once the system assigns
unique timestamps, even if they are ‘inaccurate’ or ‘unfair’ due to infrastructural inaccuracies or
other reasons, with respect to those timestamps the matching engine should respect the desired
properties; our work focuses on specifying and checking the correctness of the matching engine.
There have been some important works on formalizing financial systems, double auctions, and
theorems in economics. We briefly mention a few of them. In an influential work [11], Passmore
and Ignatovich highlight the need for formal verification of financial algorithms and suggest various
open problems in the field. In response to these challenges, they designed Imandra [10], a special-
ized formal verification system and programming language designed to reason about properties of
algorithms that may be proved, refuted, or described.
Cervesato, Khan, Reis, and Žunić [2] present a declarative and modular specification for an
automated trading system for continuous double auctions in a concurrent linear framework (CLF)
and implemented it in a CLF type checker that also supports executing of CLF specifications.
Among other things, they were able to establish that their system is never in a locked or crossed
state, which is equivalent to the positive bid-ask spread property mentioned above.
Wurman, Walsh, and Wellman [20] deal with the theory and implementation of flexible double
auctions for electronic exchanges. In particular, the authors analyze the incentive compatibility of
such auctions. Kaliszyk and Parsert [6] introduce a formal micro-economic framework and formally
prove the first welfare theorem leading to a more refined understanding of the theorem than was
available in the economics literature.
Comparison with call auctions. Our work is closely related to the work of Raja, Singh,
and Sarswat [8], which formalizes call auctions. As mentioned earlier, call auctions form a class
of double auctions, which are ‘non-continuous’ or ‘one-shot’ in nature. In call auctions, orders are
collected from buyers and sellers for a fixed duration of time, at the end of which the orders are
matched simultaneously to generate transactions. In [8] call auctions are formalized and certain
uniqueness theorems are obtained. Unlike call auctions, prior to our work, for continuous double
auctions the specifications were not concisely stated in the literature, hindering formal development
as also noted in [8].
It is interesting to compare call auctions with one time instant of continuous double auctions
when a new order arrives in presence of resident orders. In call auctions two different objectives are
usually considered: 1. Maximum matching: produce transactions that maximize the trade volume
(the sum of transaction quantities); 2. Maximum uniform-price matching: produce transactions that
maximize the trade volume subject to the constraint that all the transaction prices are the same.
It turns out, there are instances where meeting these objectives leads to different matchings and
trade volumes. In either case, after the transactions are produced, the orders or parts of the order
that remain unmatched are not-matchable, i.e., they have positive bid-ask spread. Compare
this with one time instant of continuous double auction. As we show in this work, positive
bid-ask spread already makes the process unique and can be seen as a special case of a call auction
where the output matching meets both the objectives (1 and 2) simultaneously.3In the context
3For this, we need a slightly relaxed definition of uniformity: we say a matching has a uniform price if there exists
a common price that can be set for all transactions in the matching such that no limit price of the participating
orders is breached.
5