ICurveStableSwapAdapter
Title: ICurveStableSwapAdapter
Authors: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80), Modified from Curve (https://github.com/curvefi/curve-contract)
Curve-StableSwap-specific config ABI. The adapter also implements IStrategy +
IProtocolAdapter. Single-asset, single-sided LP adapter over a 2-coin Curve
StableSwap pool: deposits the configured asset at coinIndex, holds (or stakes in a
gauge) the LP, and values the position via get_virtual_price. CRV/extra rewards are
forwarded RAW (swap-free) and are NOT counted in NAV.
Functions
pool
Returns the Curve StableSwap pool this adapter supplies to.
function pool() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
lpToken
Returns the pool's LP token.
function lpToken() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
gauge
Returns the staking gauge (address(0) when the adapter holds LP unstaked).
function gauge() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
crvToken
Returns the CRV (primary gauge reward) token forwarded raw on harvest (address(0) == none).
function crvToken() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
vault
Returns the Lattice vault funds are returned to.
function vault() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
coinIndex
Returns the pool coin index the adapter's asset occupies.
function coinIndex() external view returns (int128);Returns
| Name | Type | Description |
|---|---|---|
| <none> | int128 |
slippageBps
Returns the configured slippage tolerance in basis points.
function slippageBps() external view returns (uint256);Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
setGauge
Sets the staking gauge (admin only). address(0) clears it (run unstaked). Setting a new gauge does not migrate existing LP; stake/unstake happens on the next deploy/withdraw.
function setGauge(address gauge) external;Parameters
| Name | Type | Description |
|---|---|---|
| gauge | address |
setCrvToken
Sets the CRV reward token forwarded raw on harvest (admin only). address(0) skips forwarding (claim only). Decoupled from the gauge so integrators can wire the deployment's canonical CRV address (or clear it) without re-deploying the facet.
function setCrvToken(address token) external;Parameters
| Name | Type | Description |
|---|---|---|
| token | address |
setSlippageBps
Sets the slippage tolerance in basis points (admin only).
function setSlippageBps(uint256 slippageBps) external;Parameters
| Name | Type | Description |
|---|---|---|
| slippageBps | uint256 |
setRewardRecipient
Sets the reward recipient (admin only).
function setRewardRecipient(address recipient) external;Parameters
| Name | Type | Description |
|---|---|---|
| recipient | address |
Events
CurveStableSwapAdapterConfigured
Emitted once at init with the wiring.
event CurveStableSwapAdapterConfigured(
address indexed pool, address indexed lpToken, address indexed asset, int128 coinIndex
);Parameters
| Name | Type | Description |
|---|---|---|
| pool | address | The Curve StableSwap pool. |
| lpToken | address | The pool's LP token. |
| asset | address | The underlying asset this adapter supplies/withdraws. |
| coinIndex | int128 | The pool coin index asset occupies. |
CurveGaugeSet
Emitted when the gauge is set or changed (address(0) == unstaked).
event CurveGaugeSet(address indexed gauge);Parameters
| Name | Type | Description |
|---|---|---|
| gauge | address |
CurveCrvTokenSet
Emitted when the CRV reward token is set or cleared (address(0) == skip forwarding).
event CurveCrvTokenSet(address indexed token);Parameters
| Name | Type | Description |
|---|---|---|
| token | address |
CurveSlippageSet
Emitted when the slippage tolerance (bps) is changed.
event CurveSlippageSet(uint256 slippageBps);Parameters
| Name | Type | Description |
|---|---|---|
| slippageBps | uint256 |
Errors
CurveStableSwapAdapterAssetMismatch
The reward recipient is announced via IProtocolAdapter.RewardRecipientSet (shared with
the generic adapter ABI) — not redeclared here to avoid an event-name collision when the
facet inherits both interfaces.
The pool's coin at the configured index does not match the configured asset.
error CurveStableSwapAdapterAssetMismatch(address poolCoin, address configured);Parameters
| Name | Type | Description |
|---|---|---|
| poolCoin | address | |
| configured | address |
CurveStableSwapAdapterBadCoinIndex
The supplied coin index is out of range for a 2-coin pool (must be 0 or 1).
error CurveStableSwapAdapterBadCoinIndex(int128 coinIndex);Parameters
| Name | Type | Description |
|---|---|---|
| coinIndex | int128 |
CurveStableSwapAdapterSlippageTooHigh
The supplied slippage tolerance exceeds the allowed maximum (bps).
error CurveStableSwapAdapterSlippageTooHigh(uint256 slippageBps, uint256 maxBps);Parameters
| Name | Type | Description |
|---|---|---|
| slippageBps | uint256 | |
| maxBps | uint256 |