This sidechain seems like a natural place to get a DEX up with an offchain order book and onchain swap, but it needs a special tx type to prevent an free option issue.
How it can work now and why it is problematic
- traders constantly add/edit/delete trade offers for a pair off-chain and thus form an order book, this part does not concern
bitAssets at all.
- Once trade is made, a usual transaction is formed with one UTXO going to, say,
ECX/USDT seller and another to a buyer, they both form this tx, exchange signatures off-band and broadcast a final tx.
- Problem: a "cheating" side may receive the other side signature and stall a trade until counterparty UTXO becomes spent in a different way, until that moment a "cheating" side may wait for a more favorable market conditions than those agreed upon (free american option problem).
Why it can not be cleanly addressed by existing tx types
the closest one is DutchAuctionCreate / DutchAuctionBid / DutchAuctionCollect sequence which cumbersome and requires a trader to essentially pay a fee to create a limit order, which is a lot to ask compared to competitive trading venues.
How it can be addressed
by adding a new TransactionData type equivalent to an ordinary tx, but with an absolute expiry height. After that sidechain block height, the tx is invalid for mempool acceptance and block inclusion. This way a free option issue can exist for a few minutes max which is generally acceptable.
This sidechain seems like a natural place to get a DEX up with an offchain order book and onchain swap, but it needs a special tx type to prevent an free option issue.
How it can work now and why it is problematic
bitAssetsat all.ECX/USDTseller and another to a buyer, they both form this tx, exchange signatures off-band and broadcast a final tx.Why it can not be cleanly addressed by existing tx types
the closest one is
DutchAuctionCreate/DutchAuctionBid/DutchAuctionCollectsequence which cumbersome and requires a trader to essentially pay a fee to create a limit order, which is a lot to ask compared to competitive trading venues.How it can be addressed
by adding a new
TransactionDatatype equivalent to an ordinary tx, but with an absolute expiry height. After that sidechain block height, the tx is invalid for mempool acceptance and block inclusion. This way a free option issue can exist for a few minutes max which is generally acceptable.