I’m working on building limit order feature and I need your opinions.
There are two options to implement it:
2nd Layer Orderbook + Relayers
This model keeps the orderbook on 2nd layer chain such as Solana and have relayers fetch orders from there. Solana is run by a limited set of validators due to the nature of POS.
- You don’t need to pay for gas to place/cancel an order.
- Placing/cancelling an order gets done in a few seconds.
- You still need to pay for gas when settling an order.
- It is possible that validators of Solana revert the history of the blockchain if it’s more profitable, even though its chance is very small.
Fully Decentralized Orderbook
This model fully decentralizes the orderbook on chain.
- Once your order is placed on chain, no one can revert it or manipulate it.
- Your orders and funds are safely protected by the hashing power of Ethereum, one of the biggest blockchains.
- Each time you place an order, you need to wait for 15 seconds and pay for gas, which quite expensive at this moment.
- It even requires another 15 seconds of waiting and paying for gas when you want to cancel an order.
What’s your preference?
- 2nd Layer Orderbook + Relayers
- Fully Decentralized Orderbook