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 Privy JWT token. You can only close positions that belong to your wallet.
Authentication
Include your Privy JWT token in the Authorization header:Request Body
The unique identifier of the position to close.How to get: Use Get Positions to find your position IDs
Example: 12345
Example: 12345
Response Fields
Indicates if the position was closed successfully
Success message describing the operation
Blockchain transaction hash for the position closure
ID of the closed position
Price at which the position was closed
PnL from price movement only (excludes funding)
Total funding payments received/paid during position lifetime
Total PnL including funding (pricePnl + accumulatedFunding)
Net PnL after fees (grossPnl - fee)
Total fees charged for closing the position
Gas consumed for the transaction
Updated position object with closure details
Points breakdown earned from this trade:
trading_points
: Base points from trading volumereferral_bonus
: Additional points from referral multiplierstotal_points
: Total points awarded
Position Closure Mechanics
PnL Calculation
Long Positions
- Entry: 45,000 USD, Exit: 46,000 USD, Size: 1,000 USD
- PnL = 1,000 USD × ((46,000 - 45,000 USD) / 45,000 USD) = 22.22 USD
Short Positions
- Entry: 45,000 USD, Exit: 44,000 USD, Size: 1,000 USD
- PnL = 1,000 USD × ((45,000 - 44,000 USD) / 45,000 USD) = 22.22 USD
Fee Structure
Strike Protocol uses a dynamic fee structure for closing positions:Base Fee
- Standard rate: 0.1% of position size
- Applied to all position closures
Dynamic Fees
Additional fees based on:- Position size: Larger positions pay higher fees
- Profit percentage: Higher profits incur additional fees
- Market impact: Fees adjust based on market conditions
Fee Calculation Example
Settlement Types
Immediate Settlement
- Condition: Net payout ≤ available treasury balance
- Timeline: Immediate credit to account
- Best case: Instant access to funds
Queue Settlement
- Condition: Net payout > available treasury balance
- Timeline: Added to payout queue
- Process: First-in-first-out queue processing
Funding Payments
Positions open for 8+ hours may have funding payments applied:- Long positions: Pay funding to short holders (if funding rate is positive)
- Short positions: Pay funding to long holders (if funding rate is negative)
- Accumulated funding: Included in PnL calculation
Business Logic
Position Validation
- Position must exist and belong to authenticated wallet
- Position must be in “open” status
- Cannot close already closed or liquidated positions
Market Price Usage
- Closure executed at current mark price
- Price obtained from HyperLiquid price feed
- No slippage protection (market order execution)
Balance Updates
After successful closure:- Original margin: Always returned
- PnL: Added to (profit) or subtracted from (loss) balance
- Fees: Deducted from final amount
- Net result: Added to withdrawable balance (if positive)
Error Responses
Invalid position ID or position cannot be closed
Missing or invalid authentication token
Attempting to close position that doesn’t belong to your wallet
Rate limit exceeded (10 requests per minute for trading endpoints)
Usage Examples
Closing a Profitable Position
Closing a Loss Position
Large Position Closure
When to Close Positions
Take Profit Scenarios
- Target reached: Close when profit target is achieved
- Technical resistance: Close at key resistance levels
- Risk management: Lock in profits before potential reversal
Stop Loss Scenarios
- Loss limit: Close when maximum acceptable loss is reached
- Technical breakdown: Close when key support levels break
- Market conditions: Close during high volatility or news events
Portfolio Management
- Rebalancing: Close positions to rebalance portfolio
- Risk reduction: Close highly leveraged positions
- Opportunity cost: Close underperforming positions for new opportunities
Alternative Closure Methods
Automatic Liquidation
- Triggered when position reaches liquidation price
- No control over timing or price
- Higher fees than manual closure
Emergency Exit
- Use Emergency Exit for immediate margin refund
- No PnL realization
- Should only be used in emergencies
Next Steps
After closing a position:- Check Balance - View updated balance in Account
- Review Performance - Analyze trade in Dashboard
- Monitor Queue - If queued, check status with Queue Positions
- 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
Strike Protocol API key authentication
Body
application/json
Position ID to close