Optimistic Dex

Use UMA to build a zero-slippage gas-less optimistic DEX, where assets are swapped within a smart contract based on orders published by users, but bundled and executed on-chain by relayers.

Like with Across Protocol, the other side of the trade can be provided out of the relayer’s pocket and the relayer can get paid back (plus fees) after a challenge window.This is basically adapting the Across relayer pattern for swaps.Unlike other DEXes, it doesn’t matter if you have liquidity in the swap contract because the price is provided optimistically by the relayer or specified in the order. You can get the price from any good source, even an aggregated price from multiple centralized or decentralized exchanges, or let the user specify what they’ll accept.

The user could also specify limits, stops, expiration times for execution, if → then conditional flows, and any other requirements, all in the order that gets published off-chain somewhere and then executed by the relayer.