RiskParametersLibrary
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
| Name | Type | Description |
|---|---|---|
_safeMode | uint256 | The safe mode state (uint6) |
_notionalFee | uint256 | The commission fee (uint14) |
_premiumFee | uint256 | The commission fee (uint14) |
_protocolSplit | uint256 | The part of the fee that goes to the protocol w/ buildercodes (uint14) |
_builderSplit | uint256 | The part of the fee that goes to the builder w/ buildercodes (uint14) |
_tickDeltaDispatch | uint256 | The MAX_TWAP_DELTA_DISPATCH (uint16) |
_maxSpread | uint256 | The MAX_SPREAD, in bps (uint24) |
_bpDecreaseBuffer | uint256 | The BP_DECREASE_BUFFER, in millitick (uint26) |
_maxLegs | uint256 | The maximum allowed number of legs across all open positions for a user |
_feeRecipient | uint256 | The recipient of the commission fee split (uint128) |
Returns
| Name | Type | Description |
|---|---|---|
result | RiskParameters | The new RiskParameters object |
safeModeβ
Get the safeMode state of self.
function safeMode(RiskParameters self) internal pure returns (uint8 result);
Parameters
| Name | Type | Description |
|---|---|---|
self | RiskParameters | The RiskParameters to retrieve the safeMode state from |
Returns
| Name | Type | Description |
|---|---|---|
result | uint8 | The safeMode of self |
notionalFeeβ
Get the notionalFee of self.
function notionalFee(RiskParameters self) internal pure returns (uint16 result);
Parameters
| Name | Type | Description |
|---|---|---|
self | RiskParameters | The RiskParameters to retrieve the notionalFee from |
Returns
| Name | Type | Description |
|---|---|---|
result | uint16 | The notionalFee of self |
premiumFeeβ
Get the premiumFee of self.
function premiumFee(RiskParameters self) internal pure returns (uint16 result);
Parameters
| Name | Type | Description |
|---|---|---|
self | RiskParameters | The RiskParameters to retrieve the premiumFee from |
Returns
| Name | Type | Description |
|---|---|---|
result | uint16 | The premiumFee of self |
protocolSplitβ
Get the protocolSplit of self.
function protocolSplit(RiskParameters self) internal pure returns (uint16 result);
Parameters
| Name | Type | Description |
|---|---|---|
self | RiskParameters | The RiskParameters to retrieve the protocolSplit from |
Returns
| Name | Type | Description |
|---|---|---|
result | uint16 | The protocolSplit of self |
builderSplitβ
Get the builderSplit of self.
function builderSplit(RiskParameters self) internal pure returns (uint16 result);
Parameters
| Name | Type | Description |
|---|---|---|
self | RiskParameters | The RiskParameters to retrieve the builderSplit from |
Returns
| Name | Type | Description |
|---|---|---|
result | uint16 | The builderSplit of self |
tickDeltaDispatchβ
Get the tickDeltaDispatch of self.
function tickDeltaDispatch(RiskParameters self) internal pure returns (uint16 result);
Parameters
| Name | Type | Description |
|---|---|---|
self | RiskParameters | The RiskParameters to retrieve the tickDeltaDispatch from |
Returns
| Name | Type | Description |
|---|---|---|
result | uint16 | The tickDeltaDispatch of self |
maxSpreadβ
Get the maxSpread of self.
function maxSpread(RiskParameters self) internal pure returns (uint24 result);
Parameters
| Name | Type | Description |
|---|---|---|
self | RiskParameters | The RiskParameters to retrieve the maxSpread from |
Returns
| Name | Type | Description |
|---|---|---|
result | uint24 | The maxSpread of self |
bpDecreaseBufferβ
Get the bpDecreaseBuffer of self.
function bpDecreaseBuffer(RiskParameters self) internal pure returns (uint32 result);
Parameters
| Name | Type | Description |
|---|---|---|
self | RiskParameters | The RiskParameters to retrieve the bpDecreaseBuffer from |
Returns
| Name | Type | Description |
|---|---|---|
result | uint32 | The bpDecreaseBuffer of self |
maxLegsβ
Get the maxLegs of self.
function maxLegs(RiskParameters self) internal pure returns (uint8 result);
Parameters
| Name | Type | Description |
|---|---|---|
self | RiskParameters | The RiskParameters to retrieve the maxLegs from |
Returns
| Name | Type | Description |
|---|---|---|
result | uint8 | The maxLegs of self |
feeRecipientβ
Get the feeRecipient of self.
function feeRecipient(RiskParameters self) internal pure returns (uint128 result);
Parameters
| Name | Type | Description |
|---|---|---|
self | RiskParameters | The RiskParameters to retrieve the feeRecipient from |
Returns
| Name | Type | Description |
|---|---|---|
result | uint128 | The feeRecipient of self |