Skip to main content

ICurveStETHPool

Git Source

Title: ICurveStETHPool

Minimal interface for the Curve stETH/ETH pool.

The pool has two tokens: ETH (index 0) and stETH (index 1).

Functions​

get_dy​

Get the amount of output coin for a given input.

function get_dy(int128 i, int128 j, uint256 dx) external view returns (uint256 dy);

Parameters

NameTypeDescription
iint128The index of the input coin.
jint128The index of the output coin.
dxuint256The amount of input coin.

Returns

NameTypeDescription
dyuint256The expected amount of output coin.

exchange​

Exchange between two tokens in the pool.

function exchange(int128 i, int128 j, uint256 dx, uint256 minDy) external payable returns (uint256 dy);

Parameters

NameTypeDescription
iint128The index of the input coin (0 = ETH, 1 = stETH).
jint128The index of the output coin (0 = ETH, 1 = stETH).
dxuint256The amount of input coin to exchange.
minDyuint256The minimum amount of output coin to receive.

Returns

NameTypeDescription
dyuint256The actual amount of output coin received.