How to create stable algorithm for price discovery in Frequent Batch Auction?

Wonabru
2 min readOct 10, 2017

--

In order to introduce to very practical solution as the programming code of the problem in the title, we should declare, what we would like to achieve.

My vision of open-source blockchain derivatives’ platform protocol:

  1. Fair play. No exceptions. Simple programmable rules.
  2. In blockchain, open-sources.
  3. Automatic. Self-sustain. Self-stabilize.
  4. Linearly scalable, reproducible.
  5. Price discovery/compromise/negotiation solved by self-consistent method. Get stable solution or nothing.

The platform should be designed to provide fair rules for all traders. Initiators or authors of the platform are without special privileges. In order to provide such a criteria in practice, one should encode limit prices and volumes of each client’s orders and only after that settle in the blockchain.

Price discovery should be solved by self-consistent method, which gives, either a stable solution or nothing.

Source code should be open, so everybody can reproduce by himself and check the consistency. The transactions should be made in blockchain and secured by blockchain itself. One should provide smart contracts and most important part of off-chain source code to public in order to reproduce by anyone.

For simplicity, a platform users are divided into two groups:

  1. Makers provide BID/ASK price. They are paid for providing liquidity.
  2. Takers are entities whose trades are executed. They pay for using actively service for their personal purposes. Just one should mention that each taker is also maker in this sense.

Here is presented code in Python for Frequent Batch Auction’s price discovery:

https://github.com/BBODTradingPlatform/FrequentBatchAuction

With this code one can simulate the results for given Monte Carlo rounds.

In the case of 1000 rounds the simulation gives such statistics:

Stable Price: 97.9 % (means that there is no stable solution in only 2% random generated auctions).

Stable Volume: 33 % (means that 33% of orders’ volume are fulfilled).

In forthcoming articles will be provided solution on how to solve puzzle of encoding transaction data with Zero-Knowledge Proof in such a way that no details of transactions are given to public but each client can verify the final auction price.

--

--