Options
All
  • Public
  • Public/Protected
  • All
Menu

Zap class represents a zap trade on a particular pool, which allows to exchange single asset for PLP token.

Zap performs a swap to get second asset from the pool and then adds liquidity using both of those assets. Users may be left with some leftovers due to rounding and slippage settings.

Zaps are meant only for Constant Product pools; For Stableswaps, adding only one asset works out of the box.

Typically, users don't have to manually instantiate this class. Use Pool.prepareZap instead.

Hierarchy

  • Zap

Index

Constructors

  • new Zap(pool: Pool, asset: Asset, amount: number, slippagePct: number): Zap
  • Parameters

    • pool: Pool

      The pool the zap is going to be performed in.

    • asset: Asset

      The asset that will be used in zap.

    • amount: number

      Amount to be used in zap.

    • slippagePct: number

      The maximum amount of slippage allowed in performing the swap.

    Returns Zap

Properties

amount: number

Amount to be used in zap.

asset: Asset

The asset that will be used in zap.

liquidityAddition: LiquidityAddition

Liquidity Addition object that will be executed during the zap.

params: ZapParams

All amounts used in swap and add liquidity transactions.

pool: Pool

The pool the zap is going to be performed in.

slippagePct: number

The maximum amount of slippage allowed in performing the swap.

swap: Swap

The swap object that will be executed during the zap.

Methods

  • isAssetPrimary(): boolean
  • Creates the transactions needed to perform zap and returns them as a transaction group ready to be signed and committed.

    Parameters

    • address: string

      The account that will be performing the zap.

    Returns Promise<TransactionGroup>

    A transaction group that when executed will perform the zap.

Generated using TypeDoc