valorem-labs-inc/clear

Option Trader closes offsetting positions

neodaoist opened this issue · 1 comments

A holder of long and short tokens should be able to close the least common denominator of those, and receive back the underlying collateral

Acceptance Criteria

  • If address holds an offsetting amount of Long/Option and Short/Claim tokens, should be able to close position prior to expiry and receive back the underlying collateral
  • Examples, all for a given Option Type:
    • Address holds 10 Longs and 1 Short worth 10 Options — can call close and receive underlying assets by burning all 11 tokens
    • Address holds 9 Longs and 1 Short worth 10 Options — cannot call close; would need to write a new Short worth 1 Option, and now burn 10 Longs against the original 1 Short (? — not ideal, but least delta to support this feature, and anything else may make the difference between closing offsetting positions and exercise/redeem murky)
    • Address holds 11 Longs and 1 Short worth 10 Options — can call close and receive underlying assets by burning 10 Long tokens and 1 Short token, leaving 1 Long token not burned (? — but no way to redeem back if this Long is exercised)

Made one small change, this can only happen before expiry.