VectorRuleQuantAMMStorage

Git Sourcearrow-up-right

Inherits:QuantAMMStoragearrow-up-right

This logic to pack and unpack vectors is hardcoded for square matrices only as that is the usecase for QuantAMM

Functions

_quantAMMPack128Matrix

Packs n 128 bit integers into n/2 256 bit integers

function _quantAMMPack128Matrix(int256[][] memory _sourceMatrix, int256[] storage _targetArray) internal;

Parameters

Name
Type
Description

_sourceMatrix

int256[][]

the matrix to pack

_targetArray

int256[]

the array to pack into

_quantAMMUnpack128Matrix

Unpacks packed array into a 2d array of 128 bit integers

function _quantAMMUnpack128Matrix(int256[] memory _sourceArray, uint256 _numberOfAssets)
    internal
    pure
    returns (int256[][] memory targetArray);

Parameters

Name
Type
Description

_sourceArray

int256[]

the array to unpack

_numberOfAssets

uint256

the number of 128 bit integers to unpack

Last updated