Bid Orders
Last updated
The construction process for BID orders is more complex than that for ASK orders. The earliest discussion of BID orders can be traced back to Github, but the initial proposed solution was not feasible.
To create a decentralized transaction based on PSBT, similar to ASK orders, it is necessary to introduce liquidity providers. Liquidity providers are needed to supply a kind of "guarantee" for the liquidity in order for the process to work.
Furthermore, completing a BID order involves two PSBT transactions: the first one is referred to as PSBT(X), and the second one is called PSBT(Y).
The specific process is as follows.
Maker requests the desired BRC20 tick and quantity from the platform.
Platform Constructs PSBT(X)
Input consists of ordinals corresponding to the BRC20 tick and quantity, while the output is the market price (marketPrice) of the tick collected by the platform. The transaction is then signed with a single signature (SignHash_Single | ACP) and returned to the Maker.
Maker Continues Building PSBT(X)
Upon receiving the PSBT(X) from the platform, the Maker wishes to purchase the tick at a price (buyPrice) lower than the market price (marketPrice). The Maker fills in the corresponding inputs and outputs and then signs the transaction using (SignHash_ALL | ACP). The Maker submits the signed PSBT(X) to the platform and waits for a Taker.
Taker Views the Bid Order
The Taker, interested in completing the transaction, provides the corresponding BRC20 tick and quantity. They construct PSBT(Y) with the input being the ordinals corresponding to the BRC20 tick and quantity, and the output being the Taker's selling price (buyPrice) for that tick. The Taker then signs the transaction with a single signature (SignHash_Single | ACP) and returns it to the platform.
Platform Continues Building PSBT(Y)
As a coordinator, the platform fills in the inputs and outputs for PSBT(Y). An additional output (mid) is reserved in the outputs, with its value being the price difference between marketPrice and buyPrice. This output (mid) is used to supplement the inputs of PSBT(X).
Broadcasting
After completing both PSBT(Y) and PSBT(X), the transactions are broadcasted in sequence, first PSBT(Y) and then PSBT(X), to complete the BID transaction.