ICurvePool
Title: ICurvePool
Interface for Curve StableSwap pools.
Used for USDC/plDXY-BEAR swaps. Indices: USDC=0, plDXY-BEAR=1.
Functions
get_dy
Calculates expected output for a swap.
function get_dy(
uint256 i,
uint256 j,
uint256 dx
) external view returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
i | uint256 | Input token index. |
j | uint256 | Output token index. |
dx | uint256 | Input amount. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | Expected output amount. |
exchange
Executes a token swap.
function exchange(
uint256 i,
uint256 j,
uint256 dx,
uint256 min_dy
) external payable returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
i | uint256 | Input token index. |
j | uint256 | Output token index. |
dx | uint256 | Input amount. |
min_dy | uint256 | Minimum output (slippage protection). |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | Actual output amount. |
price_oracle
Returns EMA oracle price (18 decimals).
function price_oracle() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | Price of token1 in terms of token0. |