Seller

Seller

readEventInfo

Read CDS event details

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

** Request **

Params

Type

Description

_eventId

uint256

event id

** Response **

Params

Type

Description

underlyingHash

bytes32

Event hash of the subject cds

baseToken

address

pay tocken

baseToken

address

pay token

seller

address

CDS issuer

leverage

uint256

leverage,decimals=1

ticketId

uint256

issue CDS ticketid

creditMargin

uint256

The margin of the token submitted by CDS issuer

sellerBrokerage

uint256

CDS issuer fee income

closeDate

uint256

Close time of trading,timstamp

maturityDate

uint256

Maturity date of event,timestamp

challengeStart

uint256

Challenge start time ,timestamp

initialBalance

uint256

Seller initial balance

initialTurnover

uint256

seller turnover amount

userCount

uint256

Number of participating users

status

uint8

0:GUARANTEED,1:EARLYOCCURED,2:CONFIRMED,3:CHALLENGED,4:ENDED,5:CANCELLED

occur

boolean

cds event occur or not?

isStakeNFT

boolean

Whether to collateral NFT as credit collateral

sellerCleared

uint256

Seller whether to settle or not

inAdvance

bool

Default ahead

Issue

Issue CDS

import { issue } from "derivstudio/cds";
let transaction = issue(_tokenId,_leverage,_baseToken,_underlyingHash,_isStakeNFT,_maturityDate,_initialMargin,_minInvest);

Params

Type

Description

_tokenId

address

ticket id

_leverage

uint256

Leverage*10, e.g.,1.1 leverage is 11

_baseToken

address

Pay token

_underlyingHash

bytes32

CDS event

_isStakeNFT

uint256

Whether credit collateral is NFT or not

_maturityDate

uint256

CDS maturity date(seconds)

_initialMargin

uint256

Initial liquidity amount

_minInvest

uint256

Minimum liquidity amount

sellerSettlement

Issuer settle CDS

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

Params

Type

Description

_eventId

uint256

cds event id

cancelEvent

Issuer cancel CDS

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

Params

Type

Description

_eventId

uint256

cds event id

closeEvent

Any user triggers event (users or issuers settlement automatically trigger)

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

Params

Type

Description

_eventId

uint256

cds event id

eventInAdvance

Issuer triggers CDS event default ahead

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

Params

Type

Description

_eventId

uint256

cds event id

eventConfirm

Issuer confirms result

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

Params

Type

Description

_eventId

uint256

cds event id

_occur

bool

cds event occur or not?

Last updated