Proceeds distribution

When the settlement auction results in a successful sale, the proceeds can be distributed or claimed by protocol users. When the option expires in the money, the option ERC-721 serves as a claim token to the user's proceeds until it is burned.

To settle the option, call settleOption(uint256 optionId). This method:

  • distributes the strike price to the option writer only if they're not the high bidder
  • marks the option as settled
  • distributes the spread of high bid - strike to the option holder if they're the caller (otherwise they need to later call the claimOptionProceeds method)
  • emits an event to the settlement can be indexed

If the option is settled and the option holder needs to withdraw their proceeds, they should call claimOptionProceeds(uint256 optionId). This method:

  • distributes their proceeds
  • marks the proceeds as claimed
  • emits a message indicating that they've been claimed
  • burns the option ERC-721 to ensure that its not mistakenly purchased by another user