MaverickV2BoostedPositionFactory

Inherits: IMaverickV2BoostedPositionFactory

Factory contract that deploys Maverick V2 Boosted Positions.

State Variables

NAME_PREFIX

string private constant NAME_PREFIX = "Maverick BP-";

SYMBOL_PREFIX

string private constant SYMBOL_PREFIX = "MBP-";

_allBoostedPositions

IMaverickV2BoostedPosition[] private _allBoostedPositions;

_boostedPositionsByPool

mapping(IMaverickV2Pool => IMaverickV2BoostedPosition[]) private _boostedPositionsByPool;

poolFactory

Pool factory that all BPs pool must be deployed from.

IMaverickV2Factory public immutable poolFactory;

isFactoryBoostedPosition

Returns whether or not input BP was created by this factory.

mapping(IMaverickV2BoostedPosition => bool) public isFactoryBoostedPosition;

Functions

constructor

Factory will only deploy BPs from the specified pool factory.

constructor(IMaverickV2Factory _poolFactory);

_createParameterValidation

function _createParameterValidation(IMaverickV2Pool pool, uint32[] memory binIds, uint128[] memory ratios, uint8 kind)
    internal
    view;

createBoostedPosition

Creates BP from the specified input parameters. Requirements:

  • Pool must be from pool factory

  • BP kind must be supported by the pool

  • BinIds have to be sorted in ascending order

  • ratios[0] must be 1e18; ratios are specified in D18 scale

  • ratio and binId arrays have to be the same length

  • movement-mode BPs can only have one binId

  • static-mode BPs can have at most 24 binIds

function createBoostedPosition(IMaverickV2Pool pool, uint32[] memory binIds, uint128[] memory ratios, uint8 kind)
    external
    returns (IMaverickV2BoostedPosition boostedPosition);

lookup

Look up BPs by range of indexes.

function lookup(uint256 startIndex, uint256 endIndex)
    external
    view
    returns (IMaverickV2BoostedPosition[] memory returnBoostedPositions);

lookup

Look up BPs by range of indexes.

function lookup(IMaverickV2Pool pool, uint256 startIndex, uint256 endIndex)
    external
    view
    returns (IMaverickV2BoostedPosition[] memory returnBoostedPositions);

_packBinIds

function _packBinIds(uint32[] memory binIds) private pure returns (bytes32[3] memory binIdsBytes);

_packRatios

function _packRatios(uint128[] memory ratios) internal pure returns (bytes32[12] memory ratiosBytes);

Last updated