Skip to main content

LiquidityParameters

Implements

  • Serializable

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new LiquidityParameters(tokenX?, tokenY?, binStep?, amountX?, amountY?, amountXMin?, amountYMin?, activeIdDesired?, idSlippage?, deltaIds?, distributionX?, distributionY?, to?, deadline?): LiquidityParameters

Parameters

NameTypeDefault valueDescription
tokenXIERC20undefinedThe address of token X
tokenYIERC20undefinedThe address of token Y
binStepu640The bin step of the pair
amountXu256ZEROThe amount to send of token X
amountYu256ZEROThe amount to send of token Y
amountXMinu256ZEROThe min amount of token X added to liquidity
amountYMinu256ZEROThe min amount of token Y added to liquidity
activeIdDesiredu640The active id that user wants to add liquidity from
idSlippageu640The number of id that are allowed to slip
deltaIdsi64[][]The list of delta ids to add liquidity (deltaId = activeId - desiredId)
distributionXu256[][]The distribution of tokenX with sum(distributionX) = 1e18 (100%) or 0 (0%)
distributionYu256[][]The distribution of tokenY with sum(distributionY) = 1e18 (100%) or 0 (0%)
toAddressundefinedThe address of the recipient
deadlineu640The deadline of the tx

Returns

LiquidityParameters

Defined in

assembly/structs/LiquidityParameters.ts:25

Properties

activeIdDesired

activeIdDesired: u64 = 0

The active id that user wants to add liquidity from

Defined in

assembly/structs/LiquidityParameters.ts:33


amountX

amountX: u256 = ZERO

The amount to send of token X

Defined in

assembly/structs/LiquidityParameters.ts:29


amountXMin

amountXMin: u256 = ZERO

The min amount of token X added to liquidity

Defined in

assembly/structs/LiquidityParameters.ts:31


amountY

amountY: u256 = ZERO

The amount to send of token Y

Defined in

assembly/structs/LiquidityParameters.ts:30


amountYMin

amountYMin: u256 = ZERO

The min amount of token Y added to liquidity

Defined in

assembly/structs/LiquidityParameters.ts:32


binStep

binStep: u64 = 0

The bin step of the pair

Defined in

assembly/structs/LiquidityParameters.ts:28


deadline

deadline: u64 = 0

The deadline of the tx

Defined in

assembly/structs/LiquidityParameters.ts:39


deltaIds

deltaIds: i64[] = []

The list of delta ids to add liquidity (deltaId = activeId - desiredId)

Defined in

assembly/structs/LiquidityParameters.ts:35


distributionX

distributionX: u256[] = []

The distribution of tokenX with sum(distributionX) = 1e18 (100%) or 0 (0%)

Defined in

assembly/structs/LiquidityParameters.ts:36


distributionY

distributionY: u256[] = []

The distribution of tokenY with sum(distributionY) = 1e18 (100%) or 0 (0%)

Defined in

assembly/structs/LiquidityParameters.ts:37


idSlippage

idSlippage: u64 = 0

The number of id that are allowed to slip

Defined in

assembly/structs/LiquidityParameters.ts:34


to

to: Address

The address of the recipient

Defined in

assembly/structs/LiquidityParameters.ts:38


tokenX

tokenX: IERC20

The address of token X

Defined in

assembly/structs/LiquidityParameters.ts:26


tokenY

tokenY: IERC20

The address of token Y

Defined in

assembly/structs/LiquidityParameters.ts:27

Methods

deserialize

deserialize(data, offset): Result<i32>

Parameters

NameType
dataStaticArray<u8>
offseti32

Returns

Result<i32>

Implementation of

Serializable.deserialize

Defined in

assembly/structs/LiquidityParameters.ts:65


serialize

serialize(): StaticArray<u8>

Returns

StaticArray<u8>

Implementation of

Serializable.serialize

Defined in

assembly/structs/LiquidityParameters.ts:46