# OIP-242: User Ticket Cancelation

- Space: [Overtime Governance](https://snapshot.box/s:thalesgov.eth.md)
- Author: 0x11219d61e95fC5930762b16868dDB2C9c6fc83fA
- State: Closed
- Voting type: Single choice
- Start: 2025-06-09 15:04 UTC
- End: 2025-06-12 15:04 UTC
- Votes: 6
- Quorum: 1 voting power
- Discussion: https://discord.gg/p7jhxXc5
- Open in Snapshot: https://snapshot.box/#/s:thalesgov.eth/proposal/0xa9c1d8c8494b05265fcf81c0ca0839388e37d3587b639f7c5c698031e93c86d6

## Results

- Yes: 6 voting power, 100.0%
- No: 0 voting power, 0.0%

## Proposal

| id    | Title                      | Status      | Author  | Description                                                                                     | Discussions to                          | Created    |
|-------|----------------------------|-------------|---------|-------------------------------------------------------------------------------------------------|---------------------------------------|------------|
| OIP-242 | User Ticket Cancelation | Vote Pending | @danijel | Adds feature to allow users to cancel tickets if all legs are still available to bet on, with partial refund calculation and cancellation fee. | https://discord.com/invite/overtime-io | 2025-06-03 |

## Simple Summary

This proposal introduces a new feature enabling users to cancel their tickets under specific conditions. Cancellation is only allowed if all ticket legs remain open for betting (i.e., a fresh quote can be fetched). The system calculates a refund amount capped by the original buy-in and charges a cancellation fee.

## Abstract

The ticket cancellation functionality allows bettors to recover part of their stake if they decide to cancel before any leg settles or becomes unavailable. The refund amount is dynamically calculated based on updated odds, ensuring that it can't be abused. A cancellation fee equal to twice the SafeBox fee (4%) is applied to cover operational costs.

## Motivation

Users currently have no way to retract a bet once placed, potentially by mistake, which reduces flexibility and may discourage engagement. Allowing ticket cancellation with 
this mechanism enhances user experience and aligns incentives by protecting the platform’s risk exposure.

## Specification

- Users may cancel a ticket only if:
  - The ticket is not a system, SGP, or live bet.
  - The ticket is not a free bet ticket
  - All legs are still open for betting (validated via a fresh odds quote).
- Refund calculation:
  - Let `originalExpectedPayout = buyIn / originalTotalQuote`
  - Let `newExpectedPayout = buyIn / newTotalQuote` (fresh quote)
  - If `newExpectedPayout >= originalExpectedPayout`,  
    `refund = (buyIn * originalExpectedPayout) / newExpectedPayout - cancellationFee`
  - Else,  
    `refund = buyIn - cancellationFee`
  - The refund is capped by the original buy-in.
- Cancellation fee = 4% (2x SafeBox fee of 2%).
- pDAO can at its discretion add a time limit for cancellations (e.g., within 1 hour of purchase).

## Rationale

The refund logic ensures users do not profit unfairly from cancellations while allowing reasonable recovery when odds change unfavorably. The cancellation fee covers administrative overhead and discourages frivolous cancellations.

## Test Cases

- **Case 1: Odds improve after purchase**
  - Buy-in: 10 USDC
  - Original odds implied: 0.666 (approx 1.5x payout)
  - New odds implied: 0.5 (approx 2x payout)
  - `newExpectedPayout >= originalExpectedPayout` → refund scaled proportionally  
    `refund = (10 * originalExpectedPayout) / newExpectedPayout - 4% fee` ≈ 7.2 USDC
  
- **Case 2: Odds worsen after purchase**
  - Buy-in: 10 USDC
  - Original odds implied: 0.5
  - New odds implied: 0.666
  - `newExpectedPayout < originalExpectedPayout` → refund = buyIn - 4% fee = 9.6 USDC (approx)

- Refunds never exceed the original buy-in amount.

## Implementation

https://github.com/thales-markets/contracts-v2/pull/144

- Contract method `cancelTicketByOwner` added.
- Validates user ownership and ticket eligibility.
- Fetches current odds and calculates refund using above formula.
- Applies cancellation fee.
- Transfers refund from liquidity pool to user.
- Emits `TicketResolved` event with cancellation info.
- Includes TODO for governance-controlled cancellation time window.

## Copyright

Copyright and related rights waived via CC0.

## Are you in favor of this proposal?

---

To vote or create proposals from an AI assistant, connect the Snapshot MCP at https://mcp.snapshot.box

