Drift Protocol v2

โŒ˜K
๐Ÿ‘พWelcome to Drift Protocol
๐ŸงฎDrift DEX
๐Ÿ‘‹Getting Started
๐Ÿ“ˆPerpetual Futures
๐Ÿ“ŠSpot Margin Trading
๐ŸฆBorrow & Lend
๐Ÿ›๏ธStaking
๐Ÿ”ฌTechnical Explanations
๐Ÿ“Accounting and Settlement
โž—Borrow Interest Rate
๐Ÿ“œDelisting Process
โ›ฒDrift AMM
๐ŸƒJust-In-Time (JIT) Auctions
๐Ÿ“šKeepers & Decentralised Orderbook
โ˜ ๏ธLiquidators
๐Ÿ’งLiquidity Providers (LPs)
๐Ÿ“‹Protocol Guard Rails
๐Ÿ“Risks
๐Ÿ–ฅ๏ธDeveloper Resources
๐Ÿ“”Overview
โŒจ๏ธSDK Documentation
โŒจ๏ธTutorial: Bots
โš ๏ธTroubleshooting
๐Ÿ› ๏ธKeeper Bots
๐Ÿ› ๏ธTrading Bots
โŒจ๏ธHistorical Data (v1)
โŒจ๏ธAPI
๐Ÿ›ก๏ธSecurity
๐Ÿ›ก๏ธAudits
๐Ÿ›ก๏ธBug Bounty
โš–๏ธLegal and Regulations
๐Ÿ“Terms of Use
๐Ÿ“Disclaimer
๐Ÿ“Privacy Policy
๐Ÿ“Competition Terms and Conditions
๐Ÿ“šGlossary
Docs powered byย archbeeย 
3min

P&L Pool

Any account can call the settlePNL instruction, which will trigger negative P&L accounts to be settled, adding to each per-market P&L pool. Negative P&L being settled increases the amount available to be settled, whilst positive P&L being settled decreases the amount available for settlement.๏ปฟ

Document image

Note: calling settlePNL does not affect open positions. The function only settles the funds available in the PNL Pool for withdrawal.

It's important to recognise the difference between settling P&L and realising P&L (read more here: P&L).

Calling settlePNL

Any account can call settlePNL instruction. Once called, all unrealised negative P&L will be settled and added to the market's P&L Pool to be made available for withdrawal.

Users with open positions that have negative unrealised P&L will have their unrealised P&L settled and sent to the P&L Pool; however their position will be unaffected.

๏ปฟAs users are settled against, the Cost Basis for their position will be adjusted so that their position remains unchanged even though a portion of their unrealised negative P&L has been realised and sent to the P&L Pool. ๏ปฟ

The P&L settled as a result of the settlePNL instruction will be reflected in theUnrealised P&L tab, specifically within theRealised P&L column. The adjusted cost basis for the position is reflected in the Cost Basis column.

Document image
Updated 05 Dec 2022
Did this page help you?
Yes
No
UP NEXT
Fee Pool
Docs powered byย archbeeย 
TABLE OF CONTENTS
Calling settlePNL