# Deep Dive the LP Pricing by Nipun Pitimanaaree | Devcon SEA

- Speakers: [Nipun Pitimanaaree](https://streameth.org/speakers/nipun-pitimanaaree)
- Channel: [Devcon](https://streameth.org/devcon)
- Date: 2025-10-07
- Duration: 08:34
- Watch: https://streameth.org/watch/yt-zsohxOn91vc
- YouTube: https://www.youtube.com/watch?v=zsohxOn91vc

## Description

Accurate and robust oracle pricing is the backbone of DeFi. However, LP token prices can easily be manipulated if not calculated correctly.
In this talk, I will focus on how to calculate a "fair price" for LP tokens, ensuring security and accuracy. This includes LP token pricing for various protocols such as Uniswap V2, Uniswap V3, Trader Joe v2, Curve – sharing insights and implementations from my experience developing Alpha Homora, Stella, INIT Capital and INFINIT.

Speaker(s): Nipun Pitimanaaree
Skill level: Expert
Track: Cryptoeconomics
Keywords: Security, Mechanism design, Economics, defi

Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum, https://warpcast.com/devcon
Learn more about devcon: https://www.devcon.org/
Learn more about ethereum: https://ethereum.org/ 

Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on Swarm, IPFS and more.

Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. 
Devcon SEA was held in Bangkok, Thailand on Nov 12 - Nov 15, 2024.
Devcon is organized and presented by the Ethereum Foundation. To find out more, please visit https://ethereum.foundation/

## Transcript

[Music] hello everyone uh so my name is nipun from infinite uh def5 abstraction Le so today I'm going to give a talk about LP pricing so uh before we start uh what is LP uh everyone might be familiar uh it's like a chair of the pool uh depending on where you land where you deposit uh uni swap curve uh out balancer any kind of pool and you get an LP token in return in return it may be erc20 maybe not uh so uh LP pricing uh why is it important right it enables more use cases uh it creates more composability and capital efficiency where you can reuse uh the end product the chairs uh to be able to create more uh leverage uh lending borrowing more usages right uh LT value right uh easy it's whatever is in the pool divided by the shares right but uh you know this is not true not so easy life's not so easy right uh many many hacks in the past has occurred because we're using spot price and sandwich attack uh you can manipulate the price or you can even inflate uh price per share for the lp right so this talk is going to be focusing on the high level of what's important uh to compute robust LP pricing so LP price uh depends on two major things right uh one is what are you going to use the LP for use cases are you using it for claro or using it for borrowing uh second part is what LP types are you using right it depends are you using uni V2 LP token which is erc20 uni V3 which is uh ERC 721 or V4 or even curve uh or other amm variance right it depends so moving on to use cases so this will determine like what kind of pricing is needed for your use case so for example if you're going to use LP as collateral then you don't want to overestimate your price your LP price why because if you're using an as claro then you don't want people to be borrowing against your claro more than the value that you should have right so if you use Scaro don't overestimate the price second part is you don't want the price to dump right you don't want to have your collateral suddenly dump price by 50% um just because of just because uh the your algorithm is is prone to manipulation right so it can lead to bad debt because uh the Bor the the B borrow value stay the same LP collateral value suddenly drops right you can however underestimate the price at the cost of efficiency and at the cost of liquidation risk for for users uh on the other hand if you if you're going to use LP as for borrowing then it's going to be counter uh uh counterargument right uh you don't want to underestimate the price because otherwise you can borrow out more value than than what you should have at the same time you don't want price to pump for the borrowing tokens because suddenly your your debt soly can Skyrocket and then cost bad debt in the system and that can lead to attack vectors and at the same time you can overestimate the price of the borrowing tokens out but at the cost of capital efficiency and also liquidation risk for the users again so this is for LP use cases LP types uh there are many kinds of LP types but it'll it'll Define uh what kind of pricing can be implemented for example in univ 2 univ 2 you can donate money right you can transfer tokens and then you cost function so that means price and pump uh at the cost of uh money for the attackers so you should not enable borrowing for for univ v2 in V3 you can increase equility again anyone can increase equility increase the value price per share um so you don't want to use this as as a borrowing as a position as well so this is uh some things that we need to keep in mind and example of LV types uh un need V2 uni V3 you can find exact formula uh balancer uh generate uh unit SW V2 uh you can also find exact formula using tailor approximation uh curve stable swap you can use gradient descent solidly Pendle GMX Traer Joe whatever and other forms uh you can always find uh some form of exact and some maybe some approximation um so just a quick example uh you derive Fair balance and then you derive the fair pricing for the lp and I'm going to not going to go through the exact formula but um this is uh the rough calculation of uni V2 in V3 is going to be slightly more complex uh you derive from the price and then from Price reaction you derrive back to uh the fair fair pricing for for for the lp So yeah thank you thank you very much thank you um so do we have any questions please raise your hand over there no there what's the uh best place on chain to um use Unis swap uh NFS uh as collor the question is uh what's the best place to use uni swap on uni swap in uh V3 right uh yeah I suppose so um I am not sure right now uh but there are many uh protocols that are building on on top of DV3 um allowing to lend and you borrow out um also uh I think uh there are leverage uh leverage you farming protocols for sure um and there also I think uh I'm not sure if a is allowing uh un V3 position as clar or not I remember they they they did back in RV V2 they allow they have like am markets uh but they are not so much usage um yeah thank you okay there's another question in the middle okay hello yeah I just want to answer your question the best protocol is panoptic any other question back there hey I'm I'm curious to know if there are no Oracle pricing for a token in an LP po how could you still get the fair value of the LP price if there's no Oracle price right so so so this is given context of if you have Oracle price for the base asset right um that's a good question uh and the answer is going to be tricky um because if there's no true price or the base for the base assets then what do you treat the asset what what's actually a correct price right if it's if the asset is only available in in in a DEX for example in uh if you use like Pendle PT token usually the pricing is derived from pts pool itself um and I think uh you could find other source of source of PT pricing for example you can use twap at the cost of um uh time uh and risk but yeah so that's trade off because if that's if that's the only place where you can derive the the true price then that is a true price right um so so in LP pricing what you what you actually want is a robust pricing where you don't want to have like U manipulatable price uh by flat flash loan flash swap everything else so there should be a reference where we we should find what is the correct price uh thank you that was the last question thank you thank you very much um give a round of applause to nipun
