V3TypeQuoter
Inherits: QuoterUtils, Masks
Functions
_getV3TypeAmountOut
Calculates amountOut for Uniswap V3 style pools
Note: calldata-offset-table:
| Offset | Length (bytes) | Description |
|---|---|---|
| 0 | 20 | pool |
| 20 | 1 | forkId |
| 21 | 2 | fee |
| 23 | 2 | calldataLength |
| 25 | calldataLength | calldata |
function _getV3TypeAmountOut(
uint256 amountIn,
address tokenIn,
address tokenOut,
uint256 currentOffset
)
internal
returns (uint256 amountOut, uint256 newOffset);
Parameters
| Name | Type | Description |
|---|---|---|
amountIn |
uint256 |
Input amount |
tokenIn |
address |
Input token address |
tokenOut |
address |
Output token address |
currentOffset |
uint256 |
Current position in the calldata |
Returns
| Name | Type | Description |
|---|---|---|
amountOut |
uint256 |
Output amount |
newOffset |
uint256 |
Updated calldata offset after processing |
_getIzumiAmountOut
Calculates amountOut for Izumi pools
Note: calldata-offset-table:
| Offset | Length (bytes) | Description |
|---|---|---|
| 0 | 20 | pool |
| 20 | 1 | forkId |
| 21 | 2 | fee |
| 23 | 2 | calldataLength |
| 25 | calldataLength | calldata |
function _getIzumiAmountOut(
uint256 amountIn,
address tokenIn,
address tokenOut,
uint256 currentOffset
)
internal
returns (uint256 amountOut, uint256 newOffset);
Parameters
| Name | Type | Description |
|---|---|---|
amountIn |
uint256 |
Input amount |
tokenIn |
address |
Input token address |
tokenOut |
address |
Output token address |
currentOffset |
uint256 |
Current position in the calldata |
Returns
| Name | Type | Description |
|---|---|---|
amountOut |
uint256 |
Output amount |
newOffset |
uint256 |
Updated calldata offset after processing |
fallback
fallback() external;
swapY2XCallback
function swapY2XCallback(uint256 x, uint256, bytes calldata) external pure;
swapX2YCallback
function swapX2YCallback(uint256, uint256 y, bytes calldata) external pure;