FAQ
Last updated
Last updated
The first and foremost form to fill is Afterwards, you can fill in any order:
DefiLlama -
Create a new position. Input the minimum and maximum price manually to set the range without using a preset, ensuring it's close to the correct price. A small amount of liquidity is sufficient. It will be a single token deposit since the current pool tick is not between the position ticks.
Make a swap.
If you deposited 1 token0
in step 1, you should proceed to a swap from token1
to an amount less than 1 of token0
.
no way to get it, because
- fee can be set by plugin
- fee set by plugin may depend on swap (amount, direction).
- plugin can set fee via .setFee() method of pool, writing the value to pool storage
- plugin can return fee via overrideFee
- plugin can set pluginFee
Since plugins (anyone can make them) are not required to have some sort of .getFee function with swap parameters that would return what the fee would be on a given swap, the only reliable way to find out the fee is on the beforeSwap() hook. Since it is called in the actual swap, it will set the fee via .setFee() or overrideFee.
Unfortunately, there is no way to call it onchain.
Make a call to a quoter (the fee set by beforeSwap via .setFee() will be visible)
Make a call via RPC to the beforeSwap method on the pool plugin, specifying from=pool_address (because there is a check there). The values of overrideFee and pluginFee will be returned.
If 0
is returned from p2, then use the fee from p1. This means that the plugin does not override, but sets it via .setFee().
No way to get it, because
- fee can be set by plugin
- fee set by plugin may depend on swap (amount, direction).
- plugin can return fee via overrideFee (if DynamicFee flag is on)
- plugin can set pluginFee
Since plugins (anyone can make them) are not required to have some sort of .getFee function with swap parameters that would return what the fee would be on a given swap, the only reliable way to find out the fee is on the beforeSwap() hook. Since it is called in the actual swap, it will set the fee via overrideFee.
Unfortunately, there is no way to call it onchain.
Make a call via RPC to the beforeSwap method on the pool plugin, specifying from=pool_address (because there is a check there). The values of overrideFee and pluginFee will be returned.
Reward are collected on certain events:
a tick cross, when a user adds/removes liquidity; reward rate change or reward amount change by the owner.
The static call of CollectRewards()
updates rewards as well, ensuring you receive the actual amounts
getRewardInfo()
has the info from the last time one of the mentioned events happened, doesn't include all uncollected rewards