Sail V1: An onchain, predicate-based order book.
Sail Exchange
0xFdBb
October 2nd, 2023

Hi ^_^ , we’re excited to announce Sail, a new type of DEX built on FUEL, the world’s fastest modular execution layer.

What is Sail?

Sail is an Ethereum-aligned predicate-based trading protocol, allowing for seamless trading of any asset whose ownership can be represented onchain including spot and perpetual contracts. At the core of its design are third-party matching, security, and low-state bloat. Which leads to a low latency, resource-efficient, trustless solution for trading.

Sail works by taking advantage of improvements made by the Fuel — mainly predicates. Predicates enable a new way to represent and interact with orders onchain, without worrying about immense state bloat and high transaction fees. Sail takes it further to say that makers can have the lowest possible fees if not zero fees, while managing their orders.

The state of DEX’s

To date, there have been no scalable onchain order book solutions for DeFi on Ethereum. This is mainly because any possible solution would have too high state bloat, not enough speed, require offchain components, or be unable to keep costs low. AMMs are a novel solution for creating decentralized exchanges but come with many downsides. Uniswap v3 alone costs traders ~$600M to impermanent loss. Onchain order books solve this.

The new architecture that is uniquely enabled by Fuel is a fully onchain order book using predicates. With predicates, there is no expensive writing to state problem because creating an order is just a simple transfer, as long as there is some data availability layer that allows the public to observe the orders that exist somewhere, they can fully be verified onchain by checking the balance of the predicate.

A Predicate order book gets all the capital efficiency advantages of a CEX and doesn’t have to sacrifice decentralization. Source: https://github.com/BlockchainCap/fuel-order-book

Why Fuel?

Ahead of our whitepaper and more technical overview of the exchange protocol, let’s take a quick look at some of the advancements Sail, with Fuel, will bring to the DeFi space. The list of improvements made by Fuel is extensive, so we will highlight only the ones most important for the exchange.

Parallel Transaction Execution

“In a sense: the FuelVM *is* the EVM, greatly improved.”

It learns from the EVM, Solana, WASM, Bitcoin, and Cosmos.

Ethereum processes transactions sequentially, and despite attempts to improve upon this, like EIP-648, none have been implemented due to implementation and design details that lead to state accesses being a large bottleneck.

Fuel uses the UTXO model, which gives many other nice properties, but for this purpose enables strict access lists. These lists allow you to partition transactions into sets and execute transactions across each set in parallel. This enables parallel order processing, where your CPU can use more cores and threads, allowing for increased compute and transaction throughput.

Example of multi-core and multi-thread execution within the FuelVM

Predicates

Predicates are programs that return a Boolean value and which represent ownership of some resource upon execution to true. Predicates are pure, meaning they don’t access contract storage, allowing for them to be stateless. If someone does spend on behalf of the predicate, the only database entry required is for the UTXO instead of a state tree.

Another way of thinking of predicates is as a programmatic lock box for your UTXOs. You can outline any condition under which your UTXOs can be spent and if that condition is met by a transaction then the transaction has access to your UTXOs. This type of conditional transaction execution is perfect for representing traditional limit orders onchain.

Stateless Account Abstraction

Fuel implements stateless account abstraction with predicates, which are programs that return a Boolean value and represent ownership of some UTXO. An important part of Fuel’s account abstraction is that predicates have no access to state.

Predicates can introspect the UTXOs of a given transaction and enforce if the state transition is valid. This means one can create a stateless layer of validity logic on Fuel, meaning you can have custom verification schemes in an application. In a stateful account abstraction paradigm, state changes mean that validation logic can evaluate to true at one time and false at another, causing inconsistent behavior. To learn more about Fuel’s account abstraction this article is a great primer, Account Abstraction For Everyone Else.

Multiple Native Assets

Unlike Ethereum, where the only native asset is ETH, the FuelVM allows any contract to easily mint a UTXO-based native asset using a set of easy asset opcodes, all of which can gain the benefits of native-level calls and optimizations.

This means that ALL assets on Fuel can be native and come with first-class citizen properties which means they receive support at the protocol level.

This eliminates various vulnerabilities that exist with token smart contracts. Approve() / transferFrom() will not be a necessity anymore with Fuel native assets meaning a more streamlined UX, lower fees, and built-in safeguards.

Trust-Minimized Bridging

The FuelVM is designed to be directly fraud provable which opens the door for trust-minimized light clients and trust-minimized bridging.

With trust-minimized light clients and shared settlement & data availability layers, it is possible to build trust-minimized bridges between modular execution layers, something currently impossible to achieve between L1s.

Benefits of Trust-Minimized Bridges in a tweet from Fuel CEO Nick Dodson

Trust minimized light clients mean much greater security and verifiability while maintaining high computation. Traditional bridges in crypto have been the most frequent attack vectors for crypto attacks, accounting for 69% of total funds lost to attacks in 2022.

Light clients enhance the chain’s security guarantees without invoking centralization or scalability concerns. This moves the needle towards allowing user sovereignty, and low computation requirements, but with high security guaranteed.

How Sail works

Sail has three major differentiators, third-party matching, low state, and a design that enables extensibility.

It incentivizes matchers through a fee system, further fostering a vibrant ecosystem of engaged participants.

Through a client on your local machine, you possess the ability to tailor order creation, defining the conditions under which someone can fulfill your order. Meanwhile, the brilliance of order matching lies in its accessibility, open to anyone invoking a matching function from their machine, with all existing orders transparently visible. This peer-to-peer approach allows for direct fulfillment and the perfect synergy of matching two orders, all without the need for any central entity.

Our Journey Forward

In a world driven by decentralization, Sail embodies the epitome of true peer-to-peer trading. Much like the acclaimed 0x, Sail serves as a versatile and standardized foundation, paving the way for diverse exchange possibilities. By presenting a low-state, highly efficient alternative to existing protocols, Sail is a step forward for DeFi.

While its most apparent use case lies in the creation of an onchain Central Limit Order Book (CLOB), which is what we are currently building, Sail also allows for RFQs and OTC trades, making it versatile as an infrastructure layer for creating exchanges. Its simplicity allows for composition, opening doors to endless functionalities, including exciting prospects like dark pools or providing JIT liquidity.

Thanks for reading.

Subscribe to Sail Exchange
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.
Arweave Transaction
5XMKg9eJQR6S28z…DU1juv2QD6aBE08
Author Address
0xFdBb83261D8bd54…0677a60b930Bbb3
Content Digest
DrsMperWE0t9qZF…T1TCa3dlNabGEzU
More from Sail Exchange
View All

Skeleton

Skeleton

Skeleton

0 Collectors