Skip to main content
PUT
/
v1
/
mm
/
cashout-requests
/
{id}
/
quote
curl -X PUT https://api.totalis.trade/v1/mm/cashout-requests/c3d4e5f6-7890-abcd-ef12-34567890abcd/quote \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "buyback_price": 41.5,
    "mm_pays_user": true,
    "expires_in_ms": 15000
  }'
{
  "data": {
    "quote": {
      "id": "q1w2e3r4-5678-90ab-cdef-1234567890ab",
      "cashout_request_id": "c3d4e5f6-7890-abcd-ef12-34567890abcd",
      "market_maker_id": "mm-uuid-1234",
      "buyback_price": 41.5,
      "mm_pays_user": true,
      "valid_until": "2026-06-01T18:45:45.000Z",
      "status": "active"
    },
    "book_seq": 3,
    "replaced": false
  }
}
Submit or replace a buyback quote for a cashout request on a position you make the market for. You receive cashout requests on the same MM stream you already subscribe to, as a distinct cashout_request event (carrying cashout_request_id + position_id) — scoped to you, never broadcast. Quote the directional amount on top of the user’s stake (which is always refunded); the server computes the unit boundary economics and surfaces the net to the user on their stream. A cashout request is offered to a single market maker — the position’s existing maker. You can only quote requests targeted at you; otherwise the request returns 403. Resubmitting replaces your live quote atomically. For pricing rules and the refuse gates, see Market making → Pricing early cashouts.

Authentication

API key required. Pass your market maker API key in the X-API-Key header.
X-API-Key: <key>

Path parameters

id
string
required
The cashout request ID (UUID).

Request body

buyback_price
number
required
Your directional buyback amount in USDC (≥ 0), gross of the profit fee. This is the net on top of the refunded stake — what the MM pays the user (when mm_pays_user is true) or the user pays the MM.
mm_pays_user
boolean
required
true when you pay the user (position is in the user’s favor); false when the user pays you.
expires_in_ms
integer
How long this quote is valid, in milliseconds. Range: 5000 to 60000. Default: 15000.

Response

Returns 201 Created for a new quote or 200 OK when replacing an existing quote.
data
object

Errors

StatusCodeDescription
400VALIDATION_ERRORInvalid body (negative price, out of range expires_in_ms, or failed buyback economics). See details.
401UNAUTHORIZEDMissing or invalid API key.
403FORBIDDENYou are not the counterparty MM for this position (details.reason: not_target_mm).
404NOT_FOUNDCashout request not found.
409CONFLICTRequest is no longer active, expired, or the position is too close to expiry. See details.reason.
curl -X PUT https://api.totalis.trade/v1/mm/cashout-requests/c3d4e5f6-7890-abcd-ef12-34567890abcd/quote \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "buyback_price": 41.5,
    "mm_pays_user": true,
    "expires_in_ms": 15000
  }'
{
  "data": {
    "quote": {
      "id": "q1w2e3r4-5678-90ab-cdef-1234567890ab",
      "cashout_request_id": "c3d4e5f6-7890-abcd-ef12-34567890abcd",
      "market_maker_id": "mm-uuid-1234",
      "buyback_price": 41.5,
      "mm_pays_user": true,
      "valid_until": "2026-06-01T18:45:45.000Z",
      "status": "active"
    },
    "book_seq": 3,
    "replaced": false
  }
}