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 put 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 put 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.
Again, the bidder may also at anytime before the put is sold cancel the new bid and have their price refunded to them out of escrow, using the method cancelNewBid
Copy link