Skip to main content
POST

Overview

Manually close an existing position at the current market price. This endpoint allows you to realize profits or cut losses by closing your position immediately.
This endpoint requires authentication with a valid API key. You can only close positions that belong to your wallet.

Authentication

Include your API key in the X-API-Key header:

Request Body

integer
required
The unique identifier of the position to close.How to get: Use Get Positions to find your position IDs
Example: 12345

Response Fields

boolean
Indicates if the position was closed successfully
string
Success message describing the operation
string
Blockchain transaction hash for the position closure
integer
ID of the closed position
string
Price at which the position was closed
string
PnL from price movement only (excludes funding)
string
Total funding payments received/paid during position lifetime
string
Total PnL including funding (pricePnl + accumulatedFunding)
string
Net PnL after fees (grossPnl - fee)
string
Total fees charged for closing the position
integer
Gas consumed for the transaction
object
Updated position object with closure details

Error Responses

object
Invalid position ID or position cannot be closed
object
Missing or invalid authentication token
object
Attempting to close position that doesn’t belong to your wallet
object
Rate limit exceeded (10 requests per minute for trading endpoints)

Next Steps

After closing a position:
  1. Check Balance - View updated balance in Account
  2. Review Performance - Analyze trade in Dashboard
  3. Monitor Queue - If queued, check status with Queue Positions
  4. Plan Next Trade - Use Market Data for analysis
Consider market conditions and your overall strategy before closing positions. Sometimes holding through temporary volatility can be more profitable than frequent trading.
Position closure is irreversible. Make sure you want to close the position before submitting the request.

Authorizations

X-API-Key
string
header
required

Strike Protocol API key authentication

Body

application/json
positionId
integer
required

Position ID to close

Response

Position closed successfully

success
boolean
txHash
string
pnl
string
fees
string
netPayout
string