🔁On-chain exchange
A brief overview
The on-chain matching engine is a custom built Solana program (smart contract) which is designed from the ground up to facilitate the matching of bets on opposing outcomes of sporting events. It can also be used as the base layer of prediction markets.
Our engine is based on sports betting odds, rather than token prices. The main addition to our matching engine compared to the Serum/Openbook engine is that we have non-linear valid tick intervals to mimic the behaviour of traditional betting exchanges. The limiting of valid order prices forces traders to meet at the set intervals and have bets match, rather then trying to find the exact perfect price down to 4 decimal places. This leads to more matched bets and a better user experience. The list of valid odds ticks can be seen here: https://pastebin.com/bhN8ssux
An innovation beyond traditional exchanges is the streamlining of 2-way markets into a single line, rather than 2 lines. This means there is no back and lay side to the market, just over/under or home/away. This simplifies the experience for new users and makes the markets more efficient. 3-way markets, such as full time result in soccer, still have back and lay sides to the market, along with any multi-way competition outright markets.
Our engine requires no cranking and has significantly lower rent exemption requirements compared to other on-chain orderbook engines. Only users who place MAKER orders need to pay rent exemption (which is returned once the market is settled), while users who place TAKER orders only need to pay the very small Solana blockchain tx fee. Once an event has concluded, all rent exemption is returned to the user wallet, along with any returns for winning bets or cancelled orders.
There are two types of orders: maker orders and taker orders. Maker orders are placed at odds where there is no existing counterparty. These orders remain in the orderbook until a counterparty matches the order, or the event begins and the order is automatically cancelled. Taker orders are orders placed at odds where a counterparty already exists. These orders will instantly match with the counterparty. Orders can be a combination of marker and taker orders, if, for example, the stake requested is greater than the available liquidity at the requested odds. Part of the order will be a taker order and instantly match, while the rest will remain in the orderbook as a maker order.
Orders can have 2 states: matched and unmatched. A matched order is the result of a taker order at or below the available liquidity. Once an order is matched, it and the counterparty order are locked within the on-chain program until the event is over and the market is settled. Unmatched orders rest in the orderbook until the event begins and they are automatically cancelled, or until the user cancels the order manually. This requires an on-chain transaction. All orders must have a stake of more than 1 USDC and a potential profit of more than 1 USDC.
Last updated