Skip to content

Adapters v2

Igor Sobolev edited this page May 25, 2020 · 1 revision

Table of Contents

AaveAssetAdapter is ProtocolAdapter

Asset adapter for Aave protocol.

AaveDebtAdapter is ProtocolAdapter

Debt adapter for Aave protocol.

AaveTokenAdapter is TokenAdapter

Token adapter for ATokens.

BalancerAdapter is ProtocolAdapter

Adapter for Balancer protocol.

BalancerTokenAdapter is TokenAdapter

Token adapter for Balancer pool tokens.

BancorAdapter is ProtocolAdapter

Adapter for Bancor pools. Address of SmartToken should be passed.

BancorTokenAdapter is TokenAdapter

Token adapter for SmartTokens. Works with Converters of version 11 and higher.

CompoundAssetAdapter is ProtocolAdapter

Asset adapter for Compound protocol.

CompoundDebtAdapter is ProtocolAdapter

Debt adapter for Compound protocol.

CompoundTokenAdapter is TokenAdapter

Token adapter for CTokens.

CurveAdapter is ProtocolAdapter

Adapter for curve.fi protocol.

CurveTokenAdapter is TokenAdapter

Token adapter for Curve pool tokens. Supports only Compound, Y, bUSD, and sUSDC pools.

DmmAssetAdapter is ProtocolAdapter

Adapter for DeFi Money Market. DMM doesn't have a notion of on-chain debt/borrowing (for now). Therefore, there's no debt-related adapter in here and it was left out on purpose!

DmmTokenAdapter is TokenAdapter

Token adapter for MTokens.

DyDxAssetAdapter is ProtocolAdapter

Asset adapter for dYdX protocol.

DyDxDebtAdapter is ProtocolAdapter

Debt adapter for dYdX protocol.

IdleAdapter is ProtocolAdapter

Adapter for idle.finance protocol.

IdleTokenAdapter is TokenAdapter

Token adapter for IdleTokens.

IearnAdapter is ProtocolAdapter

Adapter for iearn.finance protocol. Deployed twice for v2 and v3 versions of the protocol.

IearnTokenAdapter is TokenAdapter

Token adapter for YTokens.

ChaiAdapter is ProtocolAdapter, MKRAdapter

Adapter for Chai protocol.

DSRAdapter is ProtocolAdapter, MKRAdapter

Adapter for Dai Savings Rate protocol.

MCDAssetAdapter is ProtocolAdapter, MKRAdapter

Asset adapter for Multi-Collateral Dai vaults.

MCDDebtAdapter is ProtocolAdapter, MKRAdapter

Debt adapter for Multi-Collateral Dai vaults.

MKRAdapter (abstract contract)

Base contract for Maker adapters. Includes all the required constants and pure functions with calculations.

PieDAOPieAdapter is ProtocolAdapter

Adapter for PieDAO protocol. Supports BTC++ only.

PieDAOPieTokenAdapter is TokenAdapter

Adapter for PieDAO protocol. Supports BTC++ only.

PoolTogetherAdapter is ProtocolAdapter

Adapter for PoolTogether protocol. Supports SAI, DAI, and USDC pools.

PoolTogetherTokenAdapter is TokenAdapter

Token adapter for PoolTogether pools.

SynthetixAssetAdapter is ProtocolAdapter

Asset adapter for Synthetix protocol. Returns SNX collateral (SNX tokens + escrowed rewards), against which synths can be issued.

SynthetixDebtAdapter is ProtocolAdapter

Debt adapter for Synthetix protocol. Returns sUSD debt to the protocol.

TokenSetsAdapter is ProtocolAdapter

Adapter for TokenSets.

TokenSetsTokenAdapter is TokenAdapter

Token adapter for SetTokens.

UniswapV1Adapter is ProtocolAdapter

Adapter for Uniswap V1 protocol.

UniswapV1TokenAdapter is TokenAdapter

Token adapter for Uniswap V1 pool tokens.

UniswapV2Adapter is ProtocolAdapter

Adapter for Uniswap V2 protocol.

UniswapV2TokenAdapter is TokenAdapter

Token adapter for Uniswap V2 pool tokens (pairs).

ZrxAdapter is ProtocolAdapter

Adapter for 0x Staking protocol.

ProtocolAdapter (interface)

Interface for protocol adapters. Includes all the functions required to be implemented.

NOTE: Adapters inheriting this interface MUST be stateless. Only internal constant state variables MUST be used. Only internal functions SHOULD be used.

view functions


adapterType() returns (string)

MUST return "Asset" or "Debt".


tokenType() returns (string)

MUST return token type (default is "ERC20"). Currently supported token types are: "ERC20", "AToken", "Balancer pool token", "CToken", "Curve pool token", "IdleToken", "YToken", "Chai token", "PoolTogether pool", "SetToken", and "Uniswap V1 pool token.


function getBalance(address token, address account) returns (uint256)

MUST return amount of the given token locked on the protocol or owed to the protocol by the given account.

TokenAdapter (interface)

Interface for token adapters. Includes all the functions required to be implemented.

NOTE: Adapters inheriting this interface MUST be stateless. Only internal constant state variables MUST be used. Only internal functions SHOULD be used.

view functions


function getMetadata(address token) returns (TokenMetadata)

MUST return TokenMetadata struct with ERC20-style token info.


function getComponents(address token) returns (Component[])

MUST return array of Component structs with underlying tokens rates for the given token.

Clone this wiki locally