Created: 2012-03-23 01:28
Updated: 2018-12-23 23:47


Futures Exchange Example

An example futures exchange, implemented with EventMachine, ZeroMQ and Redis. It uses robot Market Participants to place bid (buy) and ask (sell) orders on a set of underlying securities. Without the robots, it should behave like a realtime market exchange.


brew install zeromq brew install redis, or something of that nature.

Getting Started

bundle foreman tail logs/development.log to see what's going on.

How do Futures work?

A Futures Contract is a standardized contract between to parties to deliver a quantity of some underlying commodity (or anything, really) at some fixed date in the future, in exchange for money today. Buyers in a futures exchange expect for the future market price of the underlying to be higher, and sellers expect it to be lower. As the seller is not required to be in possession of the underlying device at the time of the exchange, futures markets do not rely on inventory (as stock exchanges do), but instead operate on Open Interest of buyers and sellers.

You can read more about futures on Wikipedia


  • Robot AI is weak - it's just for example purposes
  • Quantity is not currently supported, all trades sizes are assumed to be 1
  • The exchange does not currently implement buying power limits or check to see if the participant placing the order has sufficient margin.


(c) 2012, Scott Burton, all rights reserved

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more