Liquidity Provider

Liquidity Provider

readIsLiquidityProvider

Check if a user is a liquidity provider

import { readIsLiquidityProvider } from "derivstudio/cds";
let queryTransaction = readIsLiquidityProvider(_eventId,_user);
let ret = sdk.query(queryTransaction);

** Request **

Params*

Type*

Description

_eventId

uint256

event id

_user

address

user address

**Response **

Params

Type

Description

isProvider

boolean

Is it a liquidity provider

readLiquidityProvider

Read the balance of liquidity providers

import { readIsLiquidityProvider } from "derivstudio/cds";
let queryTransaction = readIsLiquidityProvider(_eventId,_users);
let ret = sdk.query(queryTransaction);

** Request **

Params

Type

Description

_eventId

uint256

event id

_users

array< address >

user address array

** Response **

Params

Type

Description

_eventBalance

uint256[2][]

0:balance,1:turnover

addLiquidity

Add liquidity

import { addLiquidity } from "derivstudio/cds";
let transaction = addLiquidity(_eventId,amount);

params

type

Description

_eventId

uint256

cds event id

_amount

uint256

invest amount

removeLiquidity

Remove Liquidity

import { removeLiquidity } from "derivstudio/cds";
let transaction = removeLiquidity(_eventId,amount);

params

type

Description

_eventId

uint256

cds event id

_amount

uint256

Invest amount

liquiditySettlement

Liquidity providers settle cds

import { liquiditySettlement } from "derivstudio/cds";
let transaction = liquiditySettlement(_eventId);

Params

Type

Description

_eventId

uint256

cds event id

Last updated