Core contract managing all positions, collateral, and funding rates
realisedPnl
is stored internally as an int256
to allow for negative values, but is returned as a uint256
with a boolean flag to indicate profit/loss.
buyUSDG
and sellUSDG
functions in sequence.
setTokenConfig
function:
size / collateral
. For example:
liquidatePosition()
on eligible positions and receive a portion of the remaining collateral as a reward.nonReentrant
modifier to prevent reentrancy attacks.Opening a Position
Managing the Position
Closing the Position