RestAPI 模拟盘
RestAPI/Websocket 模拟盘使用前需要用户先通过KYC
模拟盘通过虚拟资金让您在实时市场环境练习交易、测试策略,从而提高熟练度并降低亏损风险
API Key
若要进行模拟盘API交易,请先创建模拟盘API Key。操作步骤如下:
登录Bitget账户 → 切换至模拟盘 → 进入个人中心 → 访问API Key管理 → 创建模拟盘API Key → 使用模拟盘API Key开始交易
Rest
请使用创建的模拟盘API Key进行接口调用,并在请求头中添加paptrading
参数,值设置为 1
RestAPI 模拟币对
合约模拟币对有:SUSDT, SBTC, SETH, SEOS, SUSDC, 模拟币是无价值的,只是给用户来模拟交易,试手交易的, 模拟币在注册账号之后就会自动到账户里:合约账户-模拟U本位合约账户
模拟币对也有规律,如BTCUSDT对应的模拟币对为SBTCSUSDT
子账户不支持模拟盘测试,请使用母账户测试
获取合约模拟币对信息
请求示例
curl "https://api.bitget.com/api/v2/mix/market/contracts?productType=susdt-futures"
method:GET
参数说明
productType 模拟盘业务线
- susdt-futures
模拟盘U本位合约
- scoin-futures
模拟盘币本位合约
- susdc-futures
模拟盘USDC本位合约
响应示例
{
"code": "00000",
"data": [
{
"baseCoin": "SBTC",
"buyLimitPriceRatio": "0.01",
"feeRateUpRatio": "0.005",
"limitOpenTime": "-1",
"maintainTime": "",
"makerFeeRate": "0.0002",
"minTradeNum": "0.001",
"offTime": "-1",
"openCostUpRatio": "0.01",
"priceEndStep": "5",
"pricePlace": "1",
"quoteCoin": "SUSDT",
"sellLimitPriceRatio": "0.01",
"sizeMultiplier": "0.001",
"supportMarginCoins": [
"SUSDT"
],
"symbol": "SBTCSUSDT",
"symbolStatus": "normal",
"symbolType": "perpetual",
"takerFeeRate": "0.0006",
"volumePlace": "3",
"deliveryTime": "",
"deliveryStartTime": "",
"launchTime": "",
"fundInterval": "",
"minLever": "",
"maxLever": "",
"posLimit": ""
}
],
"msg": "success",
"requestTime": 1690313813709
}
可见请求与响应都是模拟symbol与模拟币, 不成对出现的symbol & coin做为参数提交会报错
合约模拟币对下单接口
请求示例
''
curl -X POST "https://api.bitget.com/api/v2/mix/order/place-order" \
-H "ACCESS-KEY:*******" \
-H "ACCESS-SIGN:*******" \
-H "ACCESS-PASSPHRASE:*****" \
-H "ACCESS-TIMESTAMP:1659076670000" \
-H "locale:en-US" \
-H "Content-Type: application/json" \
-d '{
"symbol": "SETHSUSDT",
"productType": "susdt-futures",
"marginMode": "isolated",
"marginCoin": "SUSDT",
"size": "1.5",
"price": "2000",
"side": "buy",
"tradeSide": "open",
"orderType": "limit",
"force": "gtc",
"clientOid": "12121212122",
"reduceOnly": "NO",
"presetStopSurplusPrice": "2300",
"presetStopLossPrice": "1800"
}'
请求URI
- /api/v2/mix/order/place-order
Method
- POST
模拟币对下单返回的是模拟业务线的模拟币对的订单ID
响应示例
{
"code": "00000",
"msg": "success",
"requestTime": 1627293504612,
"data": {
"orderId": "121211212122",
"clientOid": "121211212122"
}
}