Opening a position

trading

A position is a leveraged exposure to the price of an asset, backed by collateral you deposit. Opening one involves three choices: which market, which direction, and how much leverage. Everything else — the entry price, the liquidation price, the fees — is derived from those.

Markets

Diviko Perps lists perpetual markets for the major assets supported by the DLP. At launch:

MarketLong collateralShort collateral
ETH-PERPETHUSDC
BTC-PERPWBTCUSDC
SOL-PERPUSDCUSDC

For long positions the collateral is the underlying asset itself; for short positions the collateral is a stablecoin. This matches how the pool is exposed — a long ETH position is effectively borrowing ETH from the pool, so the pool's ETH inventory shrinks while the trade is open; a short ETH position is borrowing USDC.

Direction

A long position gains when the oracle price rises and loses when it falls. A short position is the inverse. Long and short positions in the same market are independent — you can hold both at once, and they will be tracked and liquidated separately.

Entry price and size

The entry price is the oracle's mid price at the moment the position is created. There is no slippage and no spread: a $1m order opens at exactly the same price as a $100 order. The DLP absorbs the imbalance and is compensated through fees rather than through spread.

The position size is the notional exposure in USD. It equals your collateral multiplied by your leverage. A trader who deposits 1 ETH at $3,000 and opens at 10x has a $30,000 position; the protocol books $30,000 of long ETH exposure against the pool and earmarks 1 ETH of collateral.

The transaction flow

When you open a position, the protocol does the following atomically:

  1. Transfers your collateral into the position's escrow.
  2. Reads the current oracle price and stores it as the entry price.
  3. Reserves the corresponding amount of the underlying asset (for longs) or stablecoin (for shorts) from the DLP. The pool's available reserves drop by the position size.
  4. Deducts the opening fee from the collateral.
  5. Issues a position record to the trader.

The position record is held in a Canton contract visible only to the trader and the protocol. From that point on the position accrues borrow fees by the second (see Fees) and its unrealised PnL updates with every oracle tick.

Closing

Closing reverses the flow. The protocol reads the current oracle price, computes PnL as (close − entry) × size for longs (and the inverse for shorts), settles PnL against the pool, returns the collateral to the trader, and releases the reserved liquidity back into the pool. The closing fee is deducted from the returned collateral.

Partial closes are supported. Closing 30% of a position releases 30% of the reserved liquidity and pays out 30% of the PnL; the rest stays open at the original entry price.

No partial fills. Because there is no order book, an order either opens at the oracle mid price or fails. There is no concept of an order resting on the book waiting for a match.