Skip to main content

TenorMarketIdLib

Git Source - Generated with forge doc

Title: TenorMarketIdLib

Encodes the Tenor market ID, the identity of a lending Tenor market that survives renewal.

A Tenor market is a (chainId, midnight, loanToken, collateralParams, rcfThreshold, enterGate, liquidatorGate) tuple.

Many Midnight markets (one per maturity) can share the same Tenor market.

Vault-wrapped Tenor markets are identified by the vault address packed into the same slot.

Functions

toTenorMarketId

Returns the hash of a Midnight market with maturity excluded.

function toTenorMarketId(Market memory market) internal pure returns (bytes32);

vaultToTenorMarketId

Encodes a vault address as a Tenor market ID (vault address in the high 20 bytes).

function vaultToTenorMarketId(address vault) internal pure returns (bytes32);

tenorMarketIdToVault

Recovers a vault address from a Tenor market ID created by vaultToTenorMarketId.

function tenorMarketIdToVault(bytes32 tenorMarketId) internal pure returns (address);