Skip to Content

@cfxdevkit/executor


@cfxdevkit/executor / PriceSource

Interface: PriceSource

Defined in: packages/executor/src/price-checker.ts:11

Price source adapter interface.

Returns the spot price of tokenIn denominated in tokenOut, scaled by 1e18. Implementations may call a DEX (Swappi, etc.), an oracle, or a mock.

Methods

getPrice()

getPrice(tokenIn, tokenOut): Promise<bigint>

Defined in: packages/executor/src/price-checker.ts:15

Returns 0n if the pair is unknown or price cannot be fetched.

Parameters

tokenIn

string

tokenOut

string

Returns

Promise<bigint>