Comment on page
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 are classic tokens such as ETH, BTC, DAI. We are currently using Empiric Network Mock for our testnet version.
po and p1 are the underlyings primitive, k is the product of reserves and L is the total LP supply
We call the preview redeem method from erc4626 standard (yagi) and calculate the price of the amount of underlyings.