Skip to main content

PositionDescriptor

Git Source - Generated with forge doc

Inherits: IPositionDescriptor

Produces a string containing the data URI for a JSON metadata string

State Variables

DAI

address private constant DAI = 0x6B175474E89094C44Da98b954EedeAC495271d0F;

USDC

address private constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;

USDT

address private constant USDT = 0xdAC17F958D2ee523a2206206994597C13D831ec7;

TBTC

address private constant TBTC = 0x8dAEBADE922dF735c38C80C7eBD708Af50815fAa;

WBTC

address private constant WBTC = 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599;

wrappedNative

address public immutable wrappedNative;

nativeCurrencyLabelBytes

bytes32 private immutable nativeCurrencyLabelBytes;

poolManager

IPoolManager public immutable poolManager;

Functions

constructor

constructor(IPoolManager _poolManager, address _wrappedNative, bytes32 _nativeCurrencyLabelBytes);

nativeCurrencyLabel

Returns the native currency label as a string

function nativeCurrencyLabel() public view returns (string memory);

tokenURI

Produces the URI describing a particular token ID

Note this URI may be a data: URI with the JSON contents directly inlined

function tokenURI(IPositionManager positionManager, uint256 tokenId) external view override returns (string memory);

Parameters

NameTypeDescription
positionManagerIPositionManagerThe position manager for which to describe the token
tokenIduint256The ID of the token for which to produce a description, which may not be valid

Returns

NameTypeDescription
<none>stringThe URI of the ERC721-compliant metadata

flipRatio

Returns true if currency0 has higher priority than currency1

function flipRatio(address currency0, address currency1) public view returns (bool);

Parameters

NameTypeDescription
currency0addressThe first currency address
currency1addressThe second currency address

Returns

NameTypeDescription
<none>boolTrue if currency0 has higher priority than currency1

currencyRatioPriority

Returns the priority of a currency. For certain currencies on mainnet, the smaller the currency, the higher the priority And those with the higher priority values (more positive values) will be in the numerator of the price ratio

function currencyRatioPriority(address currency) public view returns (int256);

Parameters

NameTypeDescription
currencyaddressThe currency address

Returns

NameTypeDescription
<none>int256The priority of the currency