New Bid Functions
For traders looking to create a bid on the order books
When a buyer is looking to place a bid to the orderbook for another peer to sell to them, they would call this method newBid. Similar to the newAsk method, the newBid method defines a new call option with the token amount, strike, price and expiry. In this case the newBid will pull in the price from the traders wallet to hold in escrow until a seller comes along.
If the owner is looking to change any of the information about the call before another party has sold it, they may do so with the same changeNewOption function. In this situation the changeNewOption routes the bidder to the second half of the function where it allows them to change any parameters. This time if the price changes then the difference will be pulled into the contract or refunded to them.
If the long would like to cancel their call entirely, they may do so by calling the cancelNewBid method. This method will close out the call option and return back the premium that has been sitting in escrow.
Copy link