M
M
Morphine Docs
Search
⌃K
Comment on page
💸

PriceFeed

In the crypto industry, there have been several instances of hacks or exploitations caused by incorrect token pricing. One example is the "Warp" exploit, where a vulnerability in the calculation method for liquidity points was exploited by attackers. This allowed them to inflate the value of their tokens and drain the liquidity pools of large amounts of funds. This type of exploit highlights the importance of accurate and secure pricing mechanisms In DeFi, as incorrect pricing can lead to significant losses for both users and liquidity providers. To mitigate such risks, Morphine implemented a robust and transparent pricing mechanism.
We are supporting conversion from USD to token, token to USD and token to token for any kind of tokens including LP tokens, ERC4626 tokens, other derivative tokens and classic tokens.

Primitive Pricing

Primitive are classic tokens such as ETH, BTC, DAI. We are currently using Empiric Network Mock for our testnet version.

Derivative pricing:

Uniswap V2 LP - Like :

po and p1 are the underlyings primitive, k is the product of reserves and L is the total LP supply

ERC4626 Pricing

We call the preview redeem method from erc4626 standard (yagi) and calculate the price of the amount of underlyings.