AnalyzeBalancerLP
Analyze a 2-asset Balancer weighted-pool LP position's PnL. Decomposes impermanent loss using the weighted-pool formula where the base token's weight affects IL magnitude. Values are denominated in opp-token units per BalancerImpLoss's convention; fee income is not attributed in v1 because Balancer pools only expose vault-level fees with no per-LP attribution.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rpc_url | Yes | An Ethereum (or L2) JSON-RPC URL used to read live pool state. Required; supplied by you per call (BYO-RPC) and may carry your provider key. The endpoint stores and logs nothing — the URL is never persisted or written to logs. | |
| chain_id | No | Optional guard. If supplied and the RPC reports a different chain id, the call is rejected. Defaults to 1 (Ethereum mainnet) conceptually; omit to skip the check. | |
| pool_type | Yes | Which protocol the pool at pool_address belongs to. This tool accepts only balancer (2-asset weighted pool). | |
| lp_init_amt | Yes | Pool shares held by this position, in human units. | |
| block_number | No | Optional block number to pin the read to a historical block. Omit to read the latest block. | |
| pool_address | Yes | On-chain address of the pool/pair to analyze (Uniswap V2/V3 pair, Balancer weighted pool, or Curve stableswap pool). Required. Lowercase, uppercase, or checksum casing all work. | |
| entry_opp_amt | Yes | Amount of opp (second) token originally deposited. | |
| entry_base_amt | Yes | Amount of base (first) token originally deposited. | |
| holding_period_days | No | Optional holding period in days. If supplied, real_apr is annualized from net_pnl. |