CenturionDEX

Overview

Last modified:

Table of contents

Enumerations

Classes

Type Aliases

Variables

Functions

Type Aliases

BigintIsh

Ƭ BigintIsh: JSBI | string | number

Defined in

constants.ts:24


Currency

Ƭ Currency: NativeCurrency | Token

Defined in

entities/currency.ts:4

Variables

MaxUint256

Const MaxUint256: default

Defined in

constants.ts:37


WETH9

Const WETH9: Object

Known WETH9 implementation addresses, used in our implementation of Ether#wrapped

Index signature

▪ [chainId: number]: Token

Defined in

entities/weth9.ts:6

Functions

computePriceImpact

computePriceImpactTBase, TQuote(midPrice, inputAmount, outputAmount): Percent

Returns the percent difference between the mid price and the execution price, i.e. price impact.

Type parameters

NameType
TBaseextends Currency
TQuoteextends Currency

Parameters

NameTypeDescription
midPricePriceTBase, TQuotemid price before the trade
inputAmountCurrencyAmountTBasethe input amount of the trade
outputAmountCurrencyAmountTQuotethe output amount of the trade

Returns

Percent

Defined in

utils/computePriceImpact.ts:9


sortedInsert

sortedInsertT(items, add, maxSize, comparator): T | null

Type parameters

Name
T

Parameters

NameType
itemsT[]
addT
maxSizenumber
comparator(a: T, b: T) => number

Returns

T | null

Defined in

utils/sortedInsert.ts:5


sqrt

sqrt(value): JSBI

Computes floor(sqrt(value))

Parameters

NameTypeDescription
valuedefaultthe value for which to compute the square root, rounded down

Returns

JSBI

Defined in

utils/sqrt.ts:14


validateAndParseAddress

validateAndParseAddress(address): string

Validates an address and returns the parsed (checksummed) version of that address

Parameters

NameTypeDescription
addressstringthe unchecksummed hex address

Returns

string

Defined in

utils/validateAndParseAddress.ts:7