Estimate Future Position APR
Estimates APR for a future Uniswap V3 position using provided amounts, prices, and pool/range inputs.
Authorization
x-api-key In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/liquidity/estimate-apr" \ -H "Content-Type: application/json" \ -d '{ "chainId": 42161, "token0": "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f", "token1": "0xaf88d065e77c8cc2239327c5edb3a432268e5831", "token0Amount": "10.5", "token1Amount": "2500", "poolFeePercent": 0.3, "minPrice": 83475.12, "maxPrice": 102300.5 }'{ "estimatedApr": "12.34"}Create Swap Liquidity (Enso) POST
This endpoint creates liquidity for a swap liquidity pool through an Enso bundle: the swaps and the deposit are chained on-chain, so the deposit consumes the exact runtime swap outputs instead of worst-case estimates. Platform fees and gas fees are always charged in `tokenIn`.
Get Liquidity Amounts GET
Get the amounts of tokens needed to provide liquidity to a pool based on the maximum you want to spend in one token. You can pass the max amount for both tokens and receive quotes for the two possible scenarios, this way you can check in a single call what option works based on the amounts your user has. E.g. your user wants to provide liquidity to the ETH-USDC pool, and they have 100 USDC and 100 ETH in their wallet. By passing both as the max amounts in `tokenXMaxAmount` you'll get two quotes. One telling how much ETH you need to provided if you send 100 USDC and another telling how much USDC you need to provide given 100 ETH. Then you can choose which one actually fits the liquidity your user has. **Note**: If only one of them is returned it means the price range is outside the current price, so only one token can be provided to create liquidity, the other will always be zero.