Development FAQ
This page collects frequently asked questions specifically related to developin on Maverick's contracts.
How do I find the contract address for a pool or boosted position?
These are all linked on the page for each pool or boosted position.
Are there testnet addresses for the Maverick contracts?
The Maverick contracts are available on Ethereum Goerli for testing purposes. These are the same contracts used by Maverick on all networks. All addresses are listed here.
How do I calculate amountOutMinimum
?
amountOutMinimum
?The PoolInformation contract has a calculateSwap
estimator. It will tell you the output you can expect. Then you can set amountOutMinimum
to a slightly smaller value, in order to limit slippage to a worst case value.
Is there an SDK that will give me the best path for a given trade?
All of the aggregators (e.g., Odos, OpenOcean, 1inch, Paraswap) maintain APIs where you can route just through Maverick’s pools and find a best path.
How do I find the binID
for a pool?
binID
for a pool?Use binPositions
on the Pool contract: https://github.com/maverickprotocol/maverick-v1-interfaces/blob/main/contracts/interfaces/IPool.sol#L106
When calling removeLiquidity
, how do I find binId
and amount
for a wallet address?
removeLiquidity
, how do I find binId
and amount
for a wallet address?The PoolInformation contract has a view function that will tell you the binId
of your positions. Once you have that, the Pool contract has a balanceOf
function that will tell you the amount per bin. You can also overestimate and the contract will only return the amount you actually have.
What formula should I use to convert price
to tick
?
price
to tick
?The formula is log_1.0001(price) = tick * tickSpacing
How can I find the balance of an LP's token reserves?
Please see this page.
Last updated