Skip to main content
Drift supports both perpetual and spot positions. This guide covers how to access position data, calculate PnL, and manage open positions.

Getting Position Data

Perpetual Positions

Spot Positions

Calculating Position PnL

Unrealized PnL

Funding Payments

Entry and Break-Even Prices

Position Monitoring

Real-Time Position Updates

Position Size Limits

Closing Positions

Close Entire Position

Partial Close

Close All Positions

Risk Management

Check Liquidation Risk

Monitor Leverage

Stop-Loss and Take-Profit

Position Dashboard Example

Best Practices

Set reduceOnly: true when closing positions to prevent accidentally flipping the position direction.
Funding payments can significantly impact PnL for long-held positions. Check funding rates before entering positions.
Always use trigger orders for stop-losses to protect against liquidation and limit losses.

Next Steps

Account Subscriptions

Real-time position updates

Oracle Integration

Work with price feeds

Position API

Position calculation functions

Margin Calculations

Understand margin requirements