Skip to main content

RiskParametersLibrary

Git Source

Title: A Panoptic Risk Parameters. Tracks the data outputted from the RiskEngine, like the safeMode, commission fees, (etc).

Author: Axicon Labs Limited

Functions

storeRiskParameters

Create a new RiskParameters object.

function storeRiskParameters(
uint256 _safeMode,
uint256 _notionalFee,
uint256 _premiumFee,
uint256 _protocolSplit,
uint256 _builderSplit,
uint256 _tickDeltaDispatch,
uint256 _maxSpread,
uint256 _bpDecreaseBuffer,
uint256 _maxLegs,
uint256 _feeRecipient
) internal pure returns (RiskParameters result);

Parameters

NameTypeDescription
_safeModeuint256The safe mode state (uint6)
_notionalFeeuint256The commission fee (uint14)
_premiumFeeuint256The commission fee (uint14)
_protocolSplituint256The part of the fee that goes to the protocol w/ buildercodes (uint14)
_builderSplituint256The part of the fee that goes to the builder w/ buildercodes (uint14)
_tickDeltaDispatchuint256The MAX_TWAP_DELTA_DISPATCH (uint16)
_maxSpreaduint256The MAX_SPREAD, in bps (uint24)
_bpDecreaseBufferuint256The BP_DECREASE_BUFFER, in millitick (uint26)
_maxLegsuint256The maximum allowed number of legs across all open positions for a user
_feeRecipientuint256The recipient of the commission fee split (uint128)

Returns

NameTypeDescription
resultRiskParametersThe new RiskParameters object

safeMode

Get the safeMode state of self.

function safeMode(RiskParameters self) internal pure returns (uint8 result);

Parameters

NameTypeDescription
selfRiskParametersThe RiskParameters to retrieve the safeMode state from

Returns

NameTypeDescription
resultuint8The safeMode of self

notionalFee

Get the notionalFee of self.

function notionalFee(RiskParameters self) internal pure returns (uint16 result);

Parameters

NameTypeDescription
selfRiskParametersThe RiskParameters to retrieve the notionalFee from

Returns

NameTypeDescription
resultuint16The notionalFee of self

premiumFee

Get the premiumFee of self.

function premiumFee(RiskParameters self) internal pure returns (uint16 result);

Parameters

NameTypeDescription
selfRiskParametersThe RiskParameters to retrieve the premiumFee from

Returns

NameTypeDescription
resultuint16The premiumFee of self

protocolSplit

Get the protocolSplit of self.

function protocolSplit(RiskParameters self) internal pure returns (uint16 result);

Parameters

NameTypeDescription
selfRiskParametersThe RiskParameters to retrieve the protocolSplit from

Returns

NameTypeDescription
resultuint16The protocolSplit of self

builderSplit

Get the builderSplit of self.

function builderSplit(RiskParameters self) internal pure returns (uint16 result);

Parameters

NameTypeDescription
selfRiskParametersThe RiskParameters to retrieve the builderSplit from

Returns

NameTypeDescription
resultuint16The builderSplit of self

tickDeltaDispatch

Get the tickDeltaDispatch of self.

function tickDeltaDispatch(RiskParameters self) internal pure returns (uint16 result);

Parameters

NameTypeDescription
selfRiskParametersThe RiskParameters to retrieve the tickDeltaDispatch from

Returns

NameTypeDescription
resultuint16The tickDeltaDispatch of self

maxSpread

Get the maxSpread of self.

function maxSpread(RiskParameters self) internal pure returns (uint24 result);

Parameters

NameTypeDescription
selfRiskParametersThe RiskParameters to retrieve the maxSpread from

Returns

NameTypeDescription
resultuint24The maxSpread of self

bpDecreaseBuffer

Get the bpDecreaseBuffer of self.

function bpDecreaseBuffer(RiskParameters self) internal pure returns (uint32 result);

Parameters

NameTypeDescription
selfRiskParametersThe RiskParameters to retrieve the bpDecreaseBuffer from

Returns

NameTypeDescription
resultuint32The bpDecreaseBuffer of self

maxLegs

Get the maxLegs of self.

function maxLegs(RiskParameters self) internal pure returns (uint8 result);

Parameters

NameTypeDescription
selfRiskParametersThe RiskParameters to retrieve the maxLegs from

Returns

NameTypeDescription
resultuint8The maxLegs of self

feeRecipient

Get the feeRecipient of self.

function feeRecipient(RiskParameters self) internal pure returns (uint128 result);

Parameters

NameTypeDescription
selfRiskParametersThe RiskParameters to retrieve the feeRecipient from

Returns

NameTypeDescription
resultuint128The feeRecipient of self