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

CDS Buyer

Buyer

readUserTurnover

Read the turnover that the buyers have done

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

** Request **

Params

Type

Description

_eventId

uint256

event id

_user

address

user address

**Response **

Params

Type

Description

turnover

uint256

The amount of turnover

readIsBuyer

Read if the user is a buyer

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

** Request **

Params

Type

Description

_eventId

uint256

event id

** Response **

Params

Type

Description

isBuyer

boolean

is buyer

userBuy

Users buy CDS

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

Params

Type

Description

_eventId

uint256

cds event id

_amount

uint256

buy amount

buyerSettlement

Users settle CDS

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

params

type

Description

_eventId

uint256

cds event id

PreviousREADMENextChallenger

Last updated 1 year ago