Positions & Pricing
Positions in Perennial are represented as units of a payoff function. This means exposure is tethered to the payoff function, not in terms of USD.
For example, say one wanted to open a 1 ETH long position (payoff = 1 * ETH). One could open a position by calling
openTake(1). This will open a taker position for 1 * market_payoff, so 1 * ETH. This position would keep 1 ETH of exposure until closed or liquidated. openTake(2) would provide 2 ETH of exposure, and so on.
Conversely, if a user is trying to open a position in terms of some $USD amount, they would have to estimate the USD value in units of the underlying payoff and open a position accordingly.
For example, if ETH is about $1000, and a user wants to open a $2500 long-eth position, they could call openTake(2.5), which will open a position that tracks 2.5*ETH, which will be approximately (but not exactly, because of delayed settlement) equal to $2500.
Funding & transaction fees (discussed later) are debited from a position's collateral account.
Each market pulls in one or more prices to be used in the payoff funtion. Simple markets will just use 1 price feed (ex. 1* ETH). But more complex markets could use payoffs with multiple price feeds (ex. -1* ETH / BTC).
The market operator chooses a price feed that the market will track. Any price feed can be chosen as long as it has an oracle can that be used as an input to the Perennial smart contract.
To start, Perennial will have hooks to pull in Chainlink data, but in the future other oracles will be added. If Perennial doesn’t have a hook for some oracle or price data, anyone can build it.
Pricing in Perennial is particularly important because all position changes (opens & closes) occur at the oracle price with no price impact. If the oracle returns the price of an asset, traders can trade as much of that asset at that price as liquidity will allow.
Note that when a position is opened or closed, Perennial bakes in a short delay before the position is priced to prevent obvious arbitrage between the current oracle price and the actual market price (frontrunning). For more on this, see the Settlement section.