Finalize
Finalizing a bid
If a user has bid on a piggy, the next step in securing ownership of that piggy is to "finalize" the bid. The bidding process is set to only complete if the current spot price of the underlying is within a set tolerance, defined at the beginning of the auction. A protection limit enforces that the piggy can only be purchased if the spot price is above or below the limit depending on the direction of the piggy. The protection limit, as detailed in the Auction section:
The last two parameters of an auction, whether it is a native sale or purchase, are optional protection parameters which will create a "bid" auction. Limit Price defines a price at which the underlying must currently be at in order for the auction to execute. This is a bidding process. A purchaser becomes a bidder on the auction. When a bid is placed, an oracle call is made. If the returned spot price from the oracle satisfies the protection limit, the auction will execute, and then succeed. If the price returned from the oracle violates the protection limit price, the bid will fail. The bidder is refunded her bid, and the auction continues.
After the bid is placed, the piggy will appear in the user's Dashboard, where the piggy is now ready to Finalize. Either counterparty can Finalize the bid by pressing the "Finalize" button that is now present in the action area of the piggy:
This will create an on-chain transaction that will request the current price of the underlying from an oracle. The oracle will make an off-chain query to retrieve the price, and then make an on-chain transaction to send the observed price back to the SmartPiggies smart contract. Once this process is complete, presuming the returned price did not violate the protection limit, the piggy will be in a "cooldown" period. After the "cooldown" is complete the piggy can be cleared.
Copy link