ClearDAO FAQ
  • Getting Started
    • How it Works
    • Product
    • Roadmap
    • Team
    • ClearDAO Token
    • ClearDAO Token Bridge
    • Contact
  • Development Resources
    • SDK
      • ClearDAO Developer Guide
      • Deploy Contracts
        • Options and Notes
          • Quick Start
          • Configure Contract
          • Contract Upgrade
          • Contract Address
        • TRS
      • Configure Contract Parameters
      • Interact With Contracts
        • Options
        • Notes
        • TRS
        • CDS
          • README
          • CDS Buyer
          • Challenger
          • Liquidity Provider
          • Ticket
          • Ticket Market
          • Ticket Sale
          • Seller
      • Contract Reference
        • Oracle
        • Index Contract
        • Option Contract
        • Market Maker Contract
        • Note Contract
      • APIs
        • CDS
          • Config
          • Ticket
          • Ticket Sale
          • Transaction
          • CDS Market
          • Issue CDS
          • CDS Category
          • Ticket Market
        • Options and Notes
          • Configure
          • Price
          • User
          • Index
          • Option Parameter Configuration
          • Faucet
          • Market Maker
        • TRS
        • CLEARIndex
    • Barrier Options
    • NFT Marketplace
    • ClearIndex
  • Governance
    • CLH Staking Module
Powered by GitBook
On this page
  1. Development Resources
  2. SDK
  3. Interact With Contracts
  4. CDS

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

PreviousChallengerNextTicket

Last updated 1 year ago