Skip to content

Latest commit

 

History

History
294 lines (160 loc) · 9.46 KB

IProtocolAdapter.IProtocolAdapter.md

File metadata and controls

294 lines (160 loc) · 9.46 KB

@metamask-institutional/defi-adapters / IProtocolAdapter / IProtocolAdapter

Interface: IProtocolAdapter

IProtocolAdapter.IProtocolAdapter

Table of contents

Properties

Methods

Properties

protocolId

protocolId: Protocol

Unique identifier of the protocol.

Defined in

IProtocolAdapter.ts:25


chainId

chainId: Chain

Unique identifier of the blockchain network.

Defined in

IProtocolAdapter.ts:30


productId

productId: string

Unique identifier for this protocol adapter

Defined in

IProtocolAdapter.ts:35


adaptersController

adaptersController: AdaptersController

Defined in

IProtocolAdapter.ts:37

Methods

getProtocolDetails

getProtocolDetails(): ProtocolDetails

Returns

ProtocolDetails

Object containing details about the protocol such as name and description.

Remarks

Returns high level metadata for the protocol

Defined in

IProtocolAdapter.ts:44


getProtocolTokens

getProtocolTokens(): Promise<Erc20Metadata[]>

Returns

Promise<Erc20Metadata[]>

An array of objects detailing the protocol tokens.

Remarks

Returns array of pool tokens (lp tokens) for the protocol

Defined in

IProtocolAdapter.ts:51


getPositions

getPositions(input): Promise<ProtocolPosition[]>

Parameters

Name Type Description
input GetPositionsInput Object with user-address and optional blockNumber override.

Returns

Promise<ProtocolPosition[]>

An array of objects detailing the user positions.

Remarks

Returns array of user positions opened in this protocol

Defined in

IProtocolAdapter.ts:60


getProtocolTokenToUnderlyingTokenRate

getProtocolTokenToUnderlyingTokenRate(input): Promise<ProtocolTokenUnderlyingRate>

Parameters

Name Type Description
input GetConversionRateInput Object with protocol-token-address and optional blockNumber override.

Returns

Promise<ProtocolTokenUnderlyingRate>

Object detailing the price per share of the protocol token.

Remarks

Returns "price" of lp-tokens in the form of the underlying tokens

Defined in

IProtocolAdapter.ts:69


getWithdrawals

getWithdrawals(input): Promise<MovementsByBlock[]>

Parameters

Name Type Description
input GetEventsInput Object specifying user-address, protocol-token-address (pool), and the block range.

Returns

Promise<MovementsByBlock[]>

Array of objects detailing withdrawal events within the specified block range.

Remarks

Returns the user's withdrawals from a position

Defined in

IProtocolAdapter.ts:80


getDeposits

getDeposits(input): Promise<MovementsByBlock[]>

Parameters

Name Type Description
input GetEventsInput Object specifying user-address, protocol-token-address (pool), and the block range.

Returns

Promise<MovementsByBlock[]>

Array of objects detailing deposit events within the specified block range.

Remarks

Returns the user's deposits to a position

Defined in

IProtocolAdapter.ts:89


getTotalValueLocked

getTotalValueLocked(input): Promise<ProtocolTokenTvl[]>

Parameters

Name Type Description
input GetTotalValueLockedInput Object with optional blockNumber override.

Returns

Promise<ProtocolTokenTvl[]>

An array of objects detailing the total value locked in each protocol pool.

Remarks

Returns the Tvl per pool defined in the underlying token

Defined in

IProtocolAdapter.ts:98


getApy

getApy(input): Promise<ProtocolTokenApy>

Parameters

Name Type Description
input GetApyInput Object with protocol-token-address and optional blockNumber override.

Returns

Promise<ProtocolTokenApy>

Object detailing the Annual Percentage Yield for each protocol pool without reward APY.

Remarks

Returns Apy per pool

Defined in

IProtocolAdapter.ts:109


getApr

getApr(input): Promise<ProtocolTokenApr>

Parameters

Name Type Description
input GetAprInput Object with protocol-token-address and optional blockNumber override.

Returns

Promise<ProtocolTokenApr>

Object detailing the Annual Percentage Rate without reward APR for each protocol pool.

Remarks

Returns Apr made per pool

Defined in

IProtocolAdapter.ts:118