Skip to main content

Closing Positions

You can close an open position at any time before the event resolves. Closing converts your token holdings back into balance at the current market price. Alternatively, positions are settled automatically when the event outcome is determined.

Manual Close​

Endpoint​

POST /api/v1/market/positions/{market_id}/close
Authorization: Bearer <token>

Replace {market_id} with the UUID of the market whose position you want to close.

How It Works​

When you close a position, the system creates a market order on your behalf:

  • Long position (holding YES tokens): A sell market order is created to sell all your YES shares at the best available bid price.
  • Short position (holding NO tokens): A buy market order is created to buy back NO shares, effectively closing out your exposure.

The created order goes through the same matching engine as any other market order. It executes at the best available prices in the orderbook and is subject to the same fees.

Example​

curl -X POST https://api.intotes.com/api/v1/market/positions/100/close \
-H "Authorization: Bearer eyJhbG..."

Important Considerations​

  • Slippage: Since the close creates a market order, the execution price depends on available liquidity. In thin orderbooks, you may experience slippage (worse price than expected).
  • Partial execution: If there is insufficient liquidity to fill the entire position, the resulting order may only partially fill. The remaining position stays open.
  • Fees apply: The same trading fees are charged on the close order as on any other trade.

Settlement at Resolution​

When an event reaches its resolution (the outcome is determined), all open positions in that event's markets are automatically settled:

  • Winning tokens (e.g., YES tokens when the outcome is YES) pay out 10000 cents (100%) per share.
  • Losing tokens pay out 0 cents per share.

Settlement happens automatically -- no action is required from the trader. The realized PnL is calculated and the balance is credited or debited accordingly.

Settlement vs. Manual Close​

AspectManual CloseSettlement
TimingAny time before resolutionAt event resolution
PriceCurrent market price10000 (winner) or 0 (loser)
FeesTrading fees applyNo trading fees
CertaintyDepends on market liquidityGuaranteed execution
StrategyLock in profit or cut losses earlyHold to resolution for maximum payout (if correct)

Manual close is useful when:

  • You want to take profit before the event resolves (the price has moved in your favor).
  • You want to cut losses (the market has moved against you and you expect it to get worse).
  • You want to free up capital for other trades.

Holding to settlement is preferable when:

  • You are confident in the outcome and want the full 10000 payout per share.
  • The current market price does not reflect your conviction.

Viewing Closed Positions​

After a position is closed (manually or via settlement), it appears in the completed positions history:

GET /api/v1/market/positions/completed
Authorization: Bearer <token>

The response returns ClosedPositionWithDetails objects containing:

FieldDescription
market_idThe market the position was in.
token_type"YES" or "NO".
amountNumber of shares that were held.
avg_priceAverage acquisition price.
pnlRealized profit or loss in cents.
won_sideThe winning outcome ("YES" or "NO"). Present only for settled positions.
event_nameName of the parent event.
pool_namePool name.
market_nameMarket name.
closed_atTimestamp of closure.

See Also​