CDS Market

Brief description

  • CDS market

Request URL

  • /api/market

Method

  • POST

Parameter

Parameter nameRequiredTypeExplain

chain_type

Yes

string

network chain type

page

No

string

page number,default 1

limit

No

string

page pagination ,default 5

order_field

No

string

order by field,available:(total_margin,created_at,price)

order_direction

No

string

order direction,asc or desc

cat_id

No

int

event category id

Return example

{
  "code": 0,
  "data": [
    {
      "total_margin": "1020.000000000000000000",
      "total_dealt": "0.000000000000000000",
      "id": 1,
      "event_id": 0,
      "chain_type": 1,
      "underlying": "It's not going to happen tonight to admire the full moon",
      "leverage": "2.0",
      "trade_end_time": 1649845547,
	  "cat_id": 1
    }
  ],
  "extra": {
    "total": 1,
    "category_list": [
      {
        "cat_id": 1,
        "cat_name": "Business"
      },
      {
        "cat_id": 2,
        "cat_name": "Chess"
      },
      {
        "cat_id": 3,
        "cat_name": "Coronavirus"
      },
      {
        "cat_id": 4,
        "cat_name": "Crypto"
      },
      {
        "cat_id": 5,
        "cat_name": "Global Politics"
      }
    ]
  }
}

Brief description

  • Seller issued cds

Request URL

  • /api/issued

Method

  • POST

Parameter

Parameter nameRequiredTypeExplain

chain_type

Yes

string

network chain type

address

Yes

string

seller address

page

No

string

page number,default 1

limit

No

string

page pagination ,default 5

order_field

No

string

order by field,available:(total_margin,created_at,price)

order_direction

No

string

order direction,asc or desc

cat_id

No

int

event category id

Return example

{
  "code": 0,
  "data": [
    {
      "appeal_id": null,
      "underlying": "It's not going to happen tonight to admire the full moon",
      "maturity_date": 1649845547,
      "total_margin": "1020.000000000000000000",
      "appeal_start_time": 1650018347,
      "status": 0,
      "appeal_status": 0,
      "occur": 0,
      "cat_id": 1,
      "user_total_margin": "20.000000000000000000",
      "profit": "0.000000000000000000",
      "appeal_end_time": "1650623147"
    }
  ],
  "extra": {
    "total": 1,
    "appeal_status_dict": [
      "idle",
      "started",
      "succeed",
      "failed"
    ],
    "status_dict": [
      "guarantee",
      "occur",
      "confirmed",
      "appeal",
      "end",
      "cancelled"
    ],
    "category_list": [
      {
        "cat_id": 1,
        "cat_name": "Business"
      },
      {
        "cat_id": 2,
        "cat_name": "Chess"
      },
      {
        "cat_id": 3,
        "cat_name": "Coronavirus"
      },
      {
        "cat_id": 4,
        "cat_name": "Crypto"
      },
      {
        "cat_id": 5,
        "cat_name": "Global Politics"
      }
    ]
  }
}

Brief description

  • Seller deposited cds

Request URL

  • /api/deposited

Method

  • POST

Parameter

Parameter nameRequiredTypeExplain

chain_type

Yes

string

network chain type

address

Yes

string

liquidity provider address

page

No

string

page number,default 1

limit

No

string

page pagination ,default 5

order_field

No

string

order by field,available:(total_margin,created_at,price)

order_direction

No

string

order direction,asc or desc

cat_id

No

int

event category id

Return example

{
  "code": 0,
  "data": [
    {
      "appeal_id": null,
      "underlying": "It's not going to happen tonight to admire the full moon",
      "maturity_date": 1649845547,
      "total_margin": "1020.000000000000000000",
      "appeal_start_time": 1650018347,
      "status": 0,
      "appeal_status": 0,
      "occur": 0,
      "cat_id": 1,
      "user_total_margin": "20.000000000000000000",
      "profit": "0.000000000000000000",
      "appeal_end_time": "1650623147"
    }
  ],
  "extra": {
    "total": 1,
    "appeal_status_dict": [
      "idle",
      "started",
      "succeed",
      "failed"
    ],
    "status_dict": [
      "guarantee",
      "occur",
      "confirmed",
      "appeal",
      "end",
      "cancelled"
    ],
    "category_list": [
      {
        "cat_id": 1,
        "cat_name": "Business"
      },
      {
        "cat_id": 2,
        "cat_name": "Chess"
      },
      {
        "cat_id": 3,
        "cat_name": "Coronavirus"
      },
      {
        "cat_id": 4,
        "cat_name": "Crypto"
      },
      {
        "cat_id": 5,
        "cat_name": "Global Politics"
      }
    ]
  }
}

Brief description

  • User bought cds

Request URL

  • /api/bought

Method

  • POST

Parameter

Parameter nameRequiredTypeExplain

chain_type

Yes

string

network chain type

address

Yes

string

buyer address

page

No

string

page number,default 1

limit

No

string

page pagination ,default 5

order_field

No

string

order by field,available:(total_margin,created_at,price)

order_direction

No

string

order direction,asc or desc

cat_id

No

int

event category id

Return example

{
  "code": 0,
  "data": [
    {
      "appeal_id": null,
      "underlying": "It's not going to happen tonight to admire the full moon",
      "maturity_date": 1649845547,
      "total_margin": "1020.000000000000000000",
      "appeal_start_time": 1650018347,
      "status": 0,
      "appeal_status": 0,
      "occur": 0,
      "cat_id": 1,
      "premium": "30.000000000000000000",
      "margin": "60.000000000000000000",
      "appeal_end_time": "1650623147"
    }
  ],
  "extra": {
    "total": 1,
    "appeal_status_dict": [
      "idle",
      "started",
      "succeed",
      "failed"
    ],
    "status_dict": [
      "guarantee",
      "occur",
      "confirmed",
      "appeal",
      "end",
      "cancelled"
    ],
    "category_list": [
      {
        "cat_id": 1,
        "cat_name": "Business"
      },
      {
        "cat_id": 2,
        "cat_name": "Chess"
      },
      {
        "cat_id": 3,
        "cat_name": "Coronavirus"
      },
      {
        "cat_id": 4,
        "cat_name": "Crypto"
      },
      {
        "cat_id": 5,
        "cat_name": "Global Politics"
      }
    ]
  }
}

Brief description

  • User dealt

Request URL

  • /api/user-dealt

Method

  • POST

Parameter

Parameter nameRequiredTypeExplain

id

Yes

string

cds_id

address

Yes

string

Buyers address

Return example

{
  "code": 0,
  "data": {
    "dealt": 0,
    "turnover": "0.000000000000000000",
    "lp_balance": "600.000000000000000000",
    "record": [
      {
        "id": 1,
        "chain_type": 1,
        "type": 2,
        "user": "0xf2189edf207c35101d6240e0181b9c2004bbdc47",
        "event_id": 0,
        "pay_token": "0xb8272d8dd058bdaf1d2c2337fde1131915318dbd",
        "amount": "100.000000000000000000",
        "trans_hash": "0xf8fc1185231eefbd8a538cac42e6e33b9d4d31e2690ec89c9d3e6b5c1c2a19a5",
        "created_at": "2022-05-08 17:41:51",
        "updated_at": "2022-05-08 17:41:51"
      }
    ]
  },
  "extra": null
}

Return parameter description

Parameter nameTypeExplain

type

int

1:user buy,2:LP add,3:LP remove

Record

Parameter nameTypeExplain

dealt

int

Buyer invest amount

turnover

int

lps turnover amount with buyers

lp_balance

int

lps undealt amount

Remark

  • The information of issued is in data of cds,initial_balance is issuer initial balance, and initial_turnover is initiail turnover amount.

Last updated