獲取所有產(chǎn)品
GET /web/etf/products.json
返回例子:
{
"success":true,
"data":[
{
"id":1,
"name":"BAI",
"period":{
"id":1,
"state":"selling",
"start_at":1532523600,
"end_at":1535634000,
"amount":"100000",
"bought":"5013.0",
"nper":1,
"can_buy":true
}
},
{
"id":2,
"name":"BAI+",
"period":{
"id":2,
"state":"selling",
"start_at":1532523600,
"end_at":1535634000,
"amount":"100000",
"bought":"3647.0",
"nper":1,
"can_buy":true
}
}
]
}
其中period
字段為期數(shù)咕别,里面amount
表示本期總共額度,bought
表示已經(jīng)生效的額度叉信,nper
表示第幾期。
獲取點(diǎn)數(shù)據(jù)
GET /web/etf/points/${id}?from=${from}&to=${to}
例子:
GET http://staging.bitrabbit.io/web/etf/points/1?from=2018-04-03&to=2018-08-01?locale=zh-CN
{
"success":true,
"data":{
"name":"BAI",
"first_price":"1.14",
"last_price":"1.589",
"points":[
{
"at":1522771200,
"price":"1.13"
},
{
"at":1522857600,
"price":"1.13"
}
]
}
}
獲取用戶(hù)所有訂單
GET /web/etf/orders.json
例子:
{
"success":true,
"data":[
{
"id":35,
"state":"submitted",
"active_time":0,
"redeem_time":0,
"volume":null,
"amount":"2.0",
"product_name":"BAI+",
"product_id":2,
"avg_price":null,
"avg_end_price":null,
"memo":null,
"currency":"USDT",
"created_at":"2018-07-31T11:24:02.000+08:00",
"nper":1
},
{
"id":34,
"state":"submitted",
"active_time":0,
"redeem_time":0,
"volume":null,
"amount":"1.0",
"product_name":"BAI",
"product_id":1,
"avg_price":null,
"avg_end_price":null,
"memo":null,
"currency":"USDT",
"created_at":"2018-07-31T11:23:46.000+08:00",
"nper":1
}
]
}
其中以product_id
來(lái)區(qū)分對(duì)應(yīng)哪個(gè)產(chǎn)品碾牌。state
枚舉如下:
{
"etf_state_submitting": "提交中",
"etf_state_submitted": "申購(gòu)中",
"etf_state_rejected": "已拒絕",
"etf_state_executed": "已生效",
"etf_state_redeeming": "贖回中",
"etf_state_redeemed": "已贖回"
}
avg_price
是生效時(shí)的均價(jià),avg_end_price
是贖回時(shí)的均價(jià)儡循,amount
是USDT數(shù)量舶吗,volume
是訂單的BAI份額。
用戶(hù)下訂單
POST /web/etf/orders.json
例子:
入?yún)?/p>
{
"amount":"100",
"currency":"USDT",
"product_id":2,
"period_id":1,
"locale":"zh-CN"
}
表示花費(fèi)100``USDT
購(gòu)買(mǎi)product_id
為2
的產(chǎn)品择膝,期數(shù)id為1