Skip to main content
POST
/
long
curl -X POST "https://api.strike.markets/long" \
  -H "X-API-Key: stk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "margin": "100.0",
    "leverage": 10,
    "symbol": "BTC-USD"
  }'
{
  "success": true,
  "message": "Long position created successfully",
  "txHash": "0x1234567890abcdef1234567890abcdef12345678",
  "gasUsed": 180000,
  "szi": "0.002217", 
  "leverage": 10,
  "side": "LONG",
  "positionId": 12345,
  "liquidation_price": "41234.15",
  "position": {
    "id": 12345,
    "wallet_address": "0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46",
    "symbol": "BTC-USD",
    "szi": "0.002217",
    "margin": "100.0",
    "entry_price": "45123.50",
    "liquidation_price": "41234.15",
    "status": "open",
    "created_at": "2024-01-15T14:30:00Z",
    "leverage": 10,
    "position_value": "1000.0"
  }
}
curl -X POST "https://api.strike.markets/long" \
  -H "X-API-Key: stk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "margin": "100.0",
    "leverage": 10,
    "symbol": "BTC-USD"
  }'
{
  "success": true,
  "message": "Long position created successfully",
  "txHash": "0x1234567890abcdef1234567890abcdef12345678",
  "gasUsed": 180000,
  "szi": "0.002217", 
  "leverage": 10,
  "side": "LONG",
  "positionId": 12345,
  "liquidation_price": "41234.15",
  "position": {
    "id": 12345,
    "wallet_address": "0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46",
    "symbol": "BTC-USD",
    "szi": "0.002217",
    "margin": "100.0",
    "entry_price": "45123.50",
    "liquidation_price": "41234.15",
    "status": "open",
    "created_at": "2024-01-15T14:30:00Z",
    "leverage": 10,
    "position_value": "1000.0"
  }
}

Overview

Create a long position with specified margin and leverage. Profits when price increases. Authentication required: Privy JWT token

Request Body

margin
string
required
Margin amount in USD. Must be a positive number as a string.Minimum: 1 USD equivalent
Example: “100.0”
leverage
integer
required
Leverage multiplier for the position.Range: 1 to 1000
Example: 10
symbol
string
required
Trading pair symbol.Supported values: “BTC-USD”, “ETH-USD”, “SOL-USD”, “BNB-USD”, “XRP-USD”, “HYPE-USD” Example: “BTC-USD”

Response Fields

success
boolean
Indicates if the position was created successfully
message
string
Success message describing the operation
txHash
string
Blockchain transaction hash for the position creation
gasUsed
integer
Amount of gas consumed for the transaction
szi
string
Position size in base asset units (positive for long, negative for short)
leverage
integer
Leverage multiplier applied to the position
side
string
Position direction - “LONG” for long positions
positionId
integer
Unique identifier for the created position
liquidation_price
string
Price at which the position will be liquidated
position
object
Complete position object with detailed information:
  • id: Position ID
  • wallet_address: Owner’s wallet address
  • symbol: Trading pair symbol
  • szi: Position size in base asset units
  • margin: Margin amount used
  • entry_price: Entry price
  • liquidation_price: Liquidation price
  • status: Position status (“open”)
  • created_at: ISO timestamp
  • leverage: Calculated leverage
  • position_value: Total position value

Position Mechanics

Size Calculation

Position Size = Margin × Leverage
Example: 100 USD margin with 10x leverage = 1,000 USD position size

Liquidation Price

The liquidation price is calculated based on:
  • Entry price
  • Leverage used
  • Trading fees
  • Funding rate buffer
Higher leverage results in liquidation prices closer to the entry price.

Profit/Loss

Long positions profit when the mark price is above the entry price:
Unrealized PnL = Position Size × ((Mark Price - Entry Price) / Entry Price)

Business Logic

Balance Validation

  • Your account balance must cover the margin requirement
  • Reserved margin is immediately deducted from available balance
  • Insufficient balance returns a 400 error

Market Conditions

  • Position creation uses the current mark price as entry price
  • Minimum position size: 1 USD equivalent after leverage
  • Maximum leverage varies by market conditions

Fee Structure

Strike Protocol uses a dynamic fee structure:
  • Base fee: 0.1% of position size
  • Additional fees: Applied based on position size and market impact

Error Responses

400 Bad Request
object
Invalid request parameters or insufficient balance
{
  "error": 400,
  "message": "Insufficient balance for margin requirement"
}
401 Unauthorized
object
Missing or invalid authentication token
{
  "error": 401,
  "message": "Authorization header missing"
}
429 Too Many Requests
object
Rate limit exceeded (10 requests per minute for trading endpoints)
{
  "error": "RATE_LIMIT_EXCEEDED",
  "message": "Rate limit exceeded. Please wait 45 seconds.",
  "retry_after": 45
}

Usage Examples

Conservative Long Position

{
  "margin": "50.0",
  "leverage": 2,
  "symbol": "BTC-USD"
}
  • Position size: 100 USD
  • Lower risk, liquidation price further from entry

High Leverage Long Position

{
  "margin": "10.0",
  "leverage": 100,
  "symbol": "ETH-USD"
}
  • Position size: 1,000 USD
  • Higher risk, liquidation price closer to entry

Maximum Leverage Position

{
  "margin": "1.0",
  "leverage": 1000,
  "symbol": "SOL-USD"
}
  • Position size: 1,000 USD
  • Maximum risk, very close liquidation price

Next Steps

After creating a long position:
  1. Monitor Position - Use Get Positions to track your position
  2. Check Dashboard - View comprehensive data with Dashboard
  3. Close Position - Manually close with Close Position
  4. Emergency Exit - Use Emergency Exit if needed
Long positions are suitable when you expect the asset price to increase. Consider market conditions, volatility, and your risk tolerance when choosing leverage levels.

Authorizations

X-API-Key
string
header
required

Strike Protocol API key authentication

Body

application/json
margin
string
required

Margin amount in USD

leverage
integer
required

Leverage multiplier (1-1000)

Required range: 1 <= x <= 1000
symbol
string
required

Market symbol (e.g., BTC-USD)

Response

Position created successfully

success
boolean
positionId
integer
txHash
string
margin
string
leverage
integer
size
string
entryPrice
string
liquidationPrice
string