Pool

Get the infos of the liquidity pool and initialize liquidity.

poolList

Get the list of liquidity pools

Copy

const res: IResType<IPool>= await floorswap.pool.poolList({
    page: 1
}: IPoolListParams)

interface IPoolListParams {
  page?: number;
}

interface IResType<T> {
  code: string;
  message: string;
  success: boolean;
  data: T;
}

interface IPool {
  collectionName: string;
  collectionAddress: string;
  nftsOffer: number;
  tokensOffer: number;
  volume24h: number;
  floorPrice: number;
  offerPrice: number;
}

IPoolListParams

IPool

poolDetail

Get details of pool

Copy

const res: IResType<IPoolDetail>= await floorswap.pool.poolDetail({
    collectionAddress: '...'
}: IPoolDetailParams)

interface IPoolDetailParams {
  collectionAddress: string;
}

interface IPoolDetail {
  collectionName: string;
  collectionAddress: string;
  nftsOffer: number;
  tokensOffer: number;
  volume24h: number;
  floorPrice: number;
  offerPrice: number;
  position: {
    pairAddress: string;
    status: number;
  }[];
}

IPoolDetailParams

IPoolDetail

initLiquidity

Init liquidiity and signer is needed here.

Copy

const txHash: string = await floorswap.pool.initLiquidity({
    signer,
    collectionAddress: '...',
    bondingCurve: 0,
    fee: '50000000000000000',
    delta: 5,
    tokenIdList: ['5'],
    value: '100000000000000000',
}: IInitLiquidityParams & { signer: ethers.Signer })

interface IInitLiquidityParams {
  collectionAddress: string;
  bondingCurve: number;
  fee: string;
  delta: number;
  tokenIdList: string[];
  value: string;
}

IInitLiquidityParams

initLiquidityForFundingPool

Init liquidity with Funding Pool. Please apply apiKey from Chamcha platform first.

Copy

const txHash: string = await floorswap.pool.initLiquidityForFundingPool({
    signer,
    collectionAddress: '...',
    bondingCurve: 0,
    fee: '50000000000000000',
    delta: 5,
    tokenIdList: ['5'],
    value: '100000000000000000',
}: IInitLiquidityParams)

interface IInitLiquidityParams {
  collectionAddress: string;
  bondingCurve: number;
  fee: string;
  delta: number;
  tokenIdList: string[];
  value: string;
}

IInitLiquidityParams

Last updated