To price LP tokens, it is not enough to simply add the values of all assets in the pool as this is easily manipulated. We use a more robust procedure for calculating Balancer LP token values.
For a given Balancer pool containing assets 1, ..., n, define the following:
The constant product of the Balancer pool is
Note that the amounts are easily manipulatable, but the product is not. And, as we require asset pricing oracles elsewhere, we can presume that the prices are also not easily manipulatable (controls to assure against this will be discussed elsewhere).
To make the manipulation-resistant BPT oracles, it will be enough to express the pricing of BPT tokens in terms of solely manipulation-resistant variables .
The portfolio value of the Balancer pool can be calculated as
Then, in turn, the BPT price can be calculated as