Get the infos of the liquidity pool and initialize liquidity.
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;
}
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;
}[];
}
Init liquidiity and signer is needed here.
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;
}
initLiquidityForFundingPool
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;
}