User

Brief Description

  • option trade-positions

Request URL

  • /api/defi/option/user/positions

Method

  • GET

Parameter

NameRequiredTypeExplain

user

yes

string

user address

## Return Parameter

NameTypeExplain

id

int

primary key

index_no

int

index id

pool_id

int

pool id

order_no

int

order No.

index_name

string

underlying name

knockout_ratio

string

knockout range

exercise_day

int

exercise cycle

start_price

string

start price

exercise_time

int

exercise time

pay_token

string

kind of token

price

string

buy price

position

int

position

is_call

int

0put,1call

amount

string

option profits

user_status

string

0:close position,1:exercise,2:knockoout

Return example

{
	"code": 0,
	"data": [
		{
			"id": 1,
			"index_no": 3,
			"pool_id": 1,
			"order_no": 1,
			"position": 1000,
			"balance": "111.000000000000000000",
			"is_call": 1,
			"price": "100.000000000000000000",
			"margin": "1.000000000000000000",
			"status": 1,
			"border_upper": "1.00000000",
			"border_lower": "1.00000000",
			"start_price": "1.00000000",
			"maker_income": "1.000000000000000000",
			"buyer": "1",
			"created_at": "2021-06-21 14:20:02",
			"updated_at": "2021-06-21 14:20:06",
			"exercise_time": 11,
			"index_name": "ETH  20%+BTC  30%+DOT  50%",
			"knockout_ratio": "7.50",
			"exercise_day": 1,
			"pay_token": "USDT",
			"amount": "1000000.000000000000000000"
		}
	],
	"extra": null
}

Brief Description

  • Delete invalid position

Request URL

  • /api/defi/defi/option/order/delete

Method

  • POST

Parameter

Parameter nameRequiredTypeExplain

order_no

No

string

order no

Return example

  {
  	"code":0,
	"data":null
}

Brief Description

  • index option trade -deal

Request URL

  • /api/defi/option/user/deals

Method

  • GET

Parameter

NameRequiredTypeExplain

user

yes

string

user address

Return parameter

NameTypeExplain

id

int

primary key

index_no

int

index id

pool_id

int

pool No.

order_no

int

order no.

index_name

string

uderlying name

is_call

int

0put,1call

knockout_ratio

string

knockout ratio

exercise_day

int

exercise cycle

exercise_time

int

exercise time

start_price

string

start time

index_price

string

current index price

pay_token

string

kind of payment token

deal_price

string

deal price

position

int

volume of trade

amount

string

profit

updated_at

string

deal time

type

int

状态【2reduce posion 3knockout 4close posion】

Return Example

{
	"code": 0,
	"data": [
		{
			"id": 1,
			"oid": 1,
			"index_no": 3,
			"pool_id": 1,
			"order_no": 1,
			"position": 10,
			"start_price": "1.00000000",
			"type": 2,
			"user": "1",
			"amount": "10.000000000000000000",
			"fee": "0.100000000000000000",
			"trans_hash": "111",
			"created_at": null,
			"updated_at": null,
			"index_name": "ETH  20%+BTC  30%+DOT  50%",
			"index_price": "97.59269696",
			"knockout_ratio": "7.50",
			"exercise_day": 1,
			"pay_token": "USDT",
			"is_call": 1,
			"exercise_time": 11,
			"deal_price": "1.000000000000000000"
		}
	],
	"extra": null
}

User role

  • get user role

Request URL

  • /api/defi/option/user/role

Method

  • POST

Parameter

Parameter nameRequiredTypeExplain

user

Yes

string

such as:0x517dF764a812bc41dA3ce9F6b11423Ba529c729e

Return example

{
  "code": 0,
  "data": {
    "is_maker": false,
    "is_fund_manager": true
  },
  "extra": null
}

Last updated