Sujiko utilises a PNL settlement mechanism that consists of isolated PNL pools for each market.
When a trader opens or increases a position, the average entry price is calculated and stored on-chain. When a trader closes or reduces a position, the average exit price is calculated and used to determine the profit or loss of the closed position.
Realising PNL occurs when a trader closes an open position. By doing so, the unrealised PNL becomes claimable and allows the trader to withdraw or deposit the associated funds.
A trader's net PNL is the sum of all realised PNL. For instance, if a trader closes two positions, one with a positive PNL and one with a negative PNL, their net PNL is the sum of these two PNLs.
To withdraw or trade a PNL, a trader must first claim it.
Each market has its own PNL pool, which includes accumulated funds from realised losses by traders. The PNL pool balance is also topped up through a proportion of trading fees. This mechanism prevents traders from withdrawing more from the platform than exists.
Thus, a trader can only claim a positive PNL if the market’s PNL pool balance has enough to cover it. Moreover, a trader can only claim a positive PNL up to a daily settlement limit, which is based on the average daily claims made by all traders including a sufficient buffer. If a trader wishes to claim more than the daily settlement limit, they will have to wait until the following day.
Sujiko's architecture is designed to prevent negative impact events from affecting the protocol. Consequently, there is a difference between closing a position (which realises unrealised PNL = realised PNL) and claiming realised PNL.
- Trader has a position open:
- Market: MADLADS-PERP
- Direction: LONG
- Avg. entry price: $1,345.56
- Position size: 2 contracts
- Market PNL pool balance claim: $1,000
- Market PNL settlement limit per day: $5,000
- Mark price moves up to $1,650.25:
- Unrealised PNL: (Mark price - Avg. entry price) * (order size in contracts) = $1,650.25 - $1,345.56 * 2 = +$609.38
- Trader closes the entire position with a market sell trade (realising uPNL):
- Avg. entry price: $1,345.56
- Avg. exit price: $1,645.99
- Realised PNL: (Avg. exit price - Avg. entry price) * (order size in contracts) = $1,645.99 - $1,345.56 * 2 = +$600.86
- Trader claims his position’s realised PNL:
- Claim amount is below limit, trader is allowed to claim
- Market PNL pool balance after claim: $1,000 - $600.86 = $399.14
- Isolated PNL pool per market: Each market has an isolated PNL pool. Traders can only claim PNL for their position from the PNL pool associated with the market. If the balance in the pool is insufficient to cover the claim, the trader must wait until the PNL pool balance increases.
- Daily settlement limits: A trader can only claim up to the daily claimable limit, which is based on the average daily claims made by all traders incl. a sufficient buffer.
- Time delayed settlement - If a trader wishes to claim more than the daily settlement limit, they will have to wait until the following day.