Skip to content

Latest commit

 

History

History
215 lines (139 loc) · 6.85 KB

adapter.md

File metadata and controls

215 lines (139 loc) · 6.85 KB

@metamask-institutional/defi-adapters / adapter

Module: adapter

Table of contents

Interfaces

Type Aliases

Variables

Type Aliases

TokenType

Ƭ TokenType: typeof TokenType[keyof typeof TokenType]

Defined in

adapter.ts:7

adapter.ts:14


PositionType

Ƭ PositionType: typeof PositionType[keyof typeof PositionType]

Defined in

adapter.ts:16

adapter.ts:43


GetBalancesInput

Ƭ GetBalancesInput: GetPositionsInput & { provider: CustomJsonRpcProvider ; chainId: Chain ; tokens: Erc20Metadata[] }

Defined in

adapter.ts:45


GetConversionRateInput

Ƭ GetConversionRateInput: Object

Type declaration

Name Type Description
blockNumber? number Optional override param
protocolTokenAddress string Protocol token address (LP token address).

Defined in

adapter.ts:51


GetApyInput

Ƭ GetApyInput: Object

Type declaration

Name Type Description
blockNumber? number Optional override param
protocolTokenAddress string Protocol token address (LP token address).

Defined in

adapter.ts:61


GetAprInput

Ƭ GetAprInput: Object

Type declaration

Name Type Description
blockNumber? number Optional override param
protocolTokenAddress string Protocol token address (LP token address).

Defined in

adapter.ts:72


GetEventsInput

Ƭ GetEventsInput: Object

Type declaration

Name Type Description
userAddress string User address we want to get events for
protocolTokenAddress string Protocol token we want to check related events for
fromBlock number Starting blocknumber to check from
toBlock number End blocknumber we want to check to e.g. current blocknumber
tokenId? string Used by NFT Defi Positions, e.g. uniswapV3

Defined in

adapter.ts:83


ProtocolDetails

Ƭ ProtocolDetails: Object

Type declaration

Name Type Description
protocolId Protocol Unique protocol id
chainId Chain Chain this adapter is for
name string Name of protocol
description string Description of protocol
iconUrl string Protocol icon
siteUrl string Protocol website
positionType PositionType Type of position One adapter per type
productId string Unique protocol-product name

Defined in

adapter.ts:110

Variables

TokenType

Const TokenType: Object

Type declaration

Name Type
Protocol "protocol"
Reward "claimable"
Underlying "underlying"
UnderlyingClaimable "underlying-claimable"
Fiat "fiat"

Defined in

adapter.ts:7

adapter.ts:14


PositionType

Const PositionType: Object

Type declaration

Name Type Description
Supply "supply" Liquidity position e.g. a dex pool
Lend "lend" Providing liquidity to a lending and borrow protocol
Borrow "borrow" Getting a loan from a lending and borrow protocol
Staked "stake" Staking a token e.g. staking eth or staking an lp token
Reward "reward" Claimable rewards, these type of positions will be merged with the equivalent lp position
FiatPrices "fiat-prices" -

Defined in

adapter.ts:16

adapter.ts:43