Announcing FigaroDB

Kristopher Craw
Figaro
Published in
3 min readSep 15, 2019
Photo by Joshua Sortino on Unsplash

When we started Figaro, we set out to build technology that would power fairer financial markets, free from colocation, high frequency trading, and dark pools. We wanted to build a system where anyone could compete on a level playing field based on skill and market knowledge, rather than insurmountable technical and financial barriers designed to ensure that the same privileged few always win.

Early on we realized the key to this was building distributed exchanges, with each member node independently owned and operated, and with full data transparency and cryptographic proof of best execution order matching. Only then could we create markets insulated against the financial influence of a few major players.

To accomplish our goals, we’ve embraced blockchain as a core technology. This game-changing technology enables secure distributed and decentralized networks in a way that has never before been possible. Unfortunately, no off-the-shelf blockchain technology allows for operating limit order books and matching engines at scale while maintaining full cryptographic proof of order book state and best execution order matching. That means we’ve had to build our own. FigaroDB is the result of almost 2 years of heavy R&D, and we are excited to share our results.

Background

The naive solution would have been to create limit order books and matching engines using smart contracts and the Ethereum Virtual Machine (EVM). Unfortunately, the performance characteristics of the EVM and the relatively intense data requirements of keeping a sorted order book prove to be unworkable, even with a dedicated network to avoid excessive “gas” costs. This reflects the experience of the DEX community at large, which abandoned smart contract exchanges in favor of relay networks. However, relay networks use centralized order books and matching engines, with only settlement being decentralized. This means they are highly vulnerable to colocation, front running, and dark pools. To create fairer financial markets, we require a solution that is fully decentralized.

FigaroDB

With FigaroDB, we’ve been developing a cryptographic database designed specifically for order books and matching engines. As a design goal, we require real world scalability, the ability to generate merkle roots of order book state to support distributed computing, and the ability to provide compact merkle proofs of best execution order matching in order to provide full decentralization without loss of security. After iterating several approaches and versions, we’ve been able to alpha test a prototype that meets those design goals, and we share our benchmark results below.

Benchmarks

PC with 1TB NVMe SSD PCIx4, Quad Core i7, 32 GB RAM

Test 1: Seed 500 Ask orders, benchmark matching Bid orders throughput

Result: 16500 tx/s

Test 2: Seed 50k Ask orders and 50k unmatched Bid orders, benchmark matching Bid orders throughput

Result: 12500 tx/s

Test 3: Seed 50k Ask orders and 50k unmatched Bid orders, benchmark time to create complete Ladder from disk

Result: 100ms

These are exciting results, because this means FigaroDB can operate as part of a decentralized exchange supporting over a billion transactions per day, independent of order volume, even before sharding. This is key to ensuring that Figaro can operate at the scale of global financial markets and serve as an alternative to traditional centralized financial exchanges.

What’s Next?

With FigaroDB, we finally have a means of operating fully decentralized exchanges at scale. Keep an eye on Figaro as we continue to develop a custom blockchain to create the world’s fairest financial markets. We intend to release Figaro Core, including FigaroDB, as source-available software under both noncommercial and commercial licenses. For more information or opportunities to partner with Figaro, you can reach us at info@figaro.tech.

--

--

Kristopher Craw
Figaro
Editor for

Product. Software Engineering. AI. Cryptography. Finance. Law.