PositionImage

Inherits: IPositionImage

Renders svg for Maverick V2 position.

State Variables

NOT_FOUND

uint256 private constant NOT_FOUND = type(uint256).max;

position

IMaverickV2Position public position;

poolLens

IMaverickV2PoolLens public immutable poolLens;

deployer

address private immutable deployer;

Functions

constructor

constructor(IMaverickV2PoolLens _poolLens);

setPosition

function setPosition(IMaverickV2Position _position) external override;

image

Generates a JSON image URI for a given NFT token.

function image(uint256 tokenId, address) public view returns (string memory);

description

function description(PositionMetadata memory metadata) internal pure returns (string memory description_);

_feeString

function _feeString(uint256 fee) internal pure returns (string memory feeString);

getPositionMetadata

function getPositionMetadata(uint256 tokenId) internal view returns (PositionMetadata memory metadata);

getKind

function getKind(uint8 kind) internal pure returns (string memory output);

getPoolLabels

function getPoolLabels(PositionMetadata memory metadata) internal pure returns (string memory);

getPositionLabels

function getPositionLabels(PositionMetadata memory metadata) internal pure returns (string memory);

getBackground

function getBackground() internal pure returns (string memory);

svg

Generates an SVG image for a given NFT token.

function svg(PositionMetadata memory metadata) internal pure returns (bytes memory);

findTickIndex

function findTickIndex(IMaverickV2Position.PositionFullInformation memory info, int32 tick)
    internal
    pure
    returns (uint256);

renderTick

function renderTick(
    IMaverickV2Position.PositionFullInformation memory info,
    int32 tick,
    uint256 index,
    int32 activeTick
) internal pure returns (string memory);

getLiquidityBars

function getLiquidityBars(
    IMaverickV2Position.PositionFullInformation memory info,
    int32 activeTick,
    uint256 sqrtPrice,
    uint256 tickSpacing
) internal pure returns (string memory);

truncateString

function truncateString(string memory str, uint256 maxBytesLength) internal pure returns (string memory);

Structs

PositionMetadata

struct PositionMetadata {
    string poolName;
    string tokenId;
    string poolAddress;
    string tokenAAddress;
    string tokenBAddress;
    string fee;
    string width;
    string mode;
    string tokenABalance;
    string tokenASymbol;
    string tokenBBalance;
    string tokenBSymbol;
    string liquidityBars;
}

Last updated