{"uid":"cap_yHb01PDhIxTHQspG-q4VW","slug":"finmath-uniswap-v3-token-amounts-calculator-928d6c06","name":"finmath Uniswap v3 Token Amounts Calculator","description":"Deterministic finance and crypto math for AI agents: TradFi (NPV, IRR, XIRR, Black-Scholes + Greeks, bonds, VaR, Sharpe) and DeFi (impermanent loss, perp liquidation, funding, Uniswap v3, health factor, cost basis). Exact, model-free arithmetic that LLMs get wrong — priced per call in USDC.","url":"https://finmath.qzqh5rrbkz.workers.dev/v1/uniswap_v3_amounts","method":"POST","headers":{},"bodySchema":{"type":"object","required":["price","liquidity","lower_price","upper_price"],"properties":{"price":{"type":"number","description":"price"},"liquidity":{"type":"number","description":"liquidity"},"lower_price":{"type":"number","description":"lower_price"},"upper_price":{"type":"number","description":"upper_price"}}},"responseSchema":{"type":"object","required":["result","meta"],"properties":{"meta":{"type":"object"},"result":{}}},"example":{"request":{"price":1500.5,"liquidity":1000000,"lower_price":1000,"upper_price":2000},"response":{"meta":{"tool":"uniswap_v3_amounts","model":true,"disclaimer":"Deterministic calculation utility. Not financial, investment, or trading advice.","assumptions":["concentrated-liquidity position math","ignores tick rounding and fees"],"deterministic":true},"result":{"amount0":3454.906960419048,"amount1":7113511.294809339,"in_range":true}}},"exampleRequest":{"price":1500.5,"liquidity":1000000,"lower_price":1000,"upper_price":2000},"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_cU4_PmE30MOVIAMBiLZ2E","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the token amounts (amount0 and amount1) held in a Uniswap v3 liquidity position given current price, liquidity, and the position's price range.","exampleAgentPrompt":"What are the actual token amounts in my Uniswap v3 position? The current price is 1800, the liquidity is 5000000, and the position range goes from 1600 to 2000.","exampleUseCases":null,"resultDescription":"Returns a result object containing the computed token amounts (amount0 and amount1) for the given Uniswap v3 liquidity position, along with metadata about the calculation. Amounts reflect how much of each token is held given the current price relative to the position's tick range.","failureModes":["Missing required fields (price, liquidity, lower_price, upper_price) returns a 400-level error","Non-numeric or negative values for price or liquidity may return a validation error","If current price is outside or inside the range, only one token amount may be non-zero — this is expected behavior, not an error","Payment failure (insufficient USDC balance) returns 402 Payment Required"],"whenToPreferThis":"Use this endpoint when you need exact, deterministic Uniswap v3 token amount calculations — especially when LLM arithmetic is unreliable for concentrated liquidity math. Prefer this over manual computation or general-purpose math tools when dealing with Uniswap v3 positions where precision matters for portfolio tracking, rebalancing decisions, or impermanent loss analysis.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:51:17.282Z","isFirstParty":false}