Trade Bots API
This API allows you to place trades on a user's behalf using their 1CT ( one-click trading ) wallet. The user must first go to their settings page and generate an API Key and Key ID.
Last updated
GET /trade-bots/data/open_orders/{Your_Chain_Id}vela-api-key: {Your_Api_Key}
vela-key-id: {Your_Key_Id}"getDeposits": {
"method": "GET",
"endpoint": "https://api.vela.exchange/trade-bots/data/deposits/:chainId",
"headers": {
"VELA-API-KEY": "Your API Key",
"VELA-KEY-ID": "Your Key ID"
}
},"getWithdraws": {
"method": "GET",
"endpoint": "https://api.vela.exchange/trade-bots/data/withdraws/:chainId",
"headers": {
"VELA-API-KEY": "Your API Key",
"VELA-KEY-ID": "Your Key ID"
},
},"getOpenOrders": {
"method": "GET",
"endpoint": "https://api.vela.exchange/trade-bots/data/open_orders/:chainId?paginate=0",
"headers": {
"VELA-API-KEY": "Your API Key",
"VELA-KEY-ID": "Your Key ID"
}
},"getOpenPositions": {
"method": "GET",
"endpoint": "https://api.vela.exchange/trade-bots/data/open_positions/:chainId?paginate=0",
"headers": {
"VELA-API-KEY": "Your API Key",
"VELA-KEY-ID": "Your Key ID"
}
},"getClosedPositions": {
"method": "GET",
"endpoint": "https://api.vela.exchange/trade-bots/data/closed_positions/:chainId?paginate=0",
"headers": {
"VELA-API-KEY": "Your API Key",
"VELA-KEY-ID": "Your Key ID"
}
},"getPortfolios": {
"method": "GET",
"endpoint": "https://api.vela.exchange/trade-bots/data/portfolios/:chainId",
"headers": {
"VELA-API-KEY": "Your API Key",
"VELA-KEY-ID": "Your Key ID"
}
}"getBalances": {
"method": "GET",
"endpoint": "https://api.vela.exchange/trade-bots/data/balances/:chainId",
"headers": {
"VELA-API-KEY": "Your API Key",
"VELA-KEY-ID": "Your Key ID"
}
}"pairInfo": {
"method": "GET",
"endpoint": "https://api.vela.exchange/trade-bots/data/pairInfo/:chainId/:velaId",
"headers": {
"VELA-API-KEY": "Your API Key",
"VELA-KEY-ID": "Your Key ID"
}
}"getReferrals": {
"method": "GET",
"endpoint": "https://api.vela.exchange/trade-bots/data/referrals/:account"
}"checkReferrals": {
"method": "GET",
"endpoint": "https://api.vela.exchange/trade-bots/data/check_referrals",
"headers": {
"VELA-API-KEY": "Your API Key",
"VELA-KEY-ID": "Your Key ID"
}
}velaId : 1
assetSymbol : BTC/USD
fundingRate : -34315308077 // Divisor is 1000000000000000 (Multiply by 100 to get percentage)
borrowRateForLong : 50 // Divisor is 10000 (Multiply by 100 to get percentage)
borrowRateForShort : 2 // Divisor is 1000000 (Multiply by 100 to get percentage)
longOpenInterest : 59184915236162755974461601376533508 // 30 decimals
shortOpenInterest : 110511987612749582110504884622059762 // 30 decimals
maxLongOpenInterest : 1000000000000000000000000000000000000 // 30 decimals
maxShortOpenInterest : 1000000000000000000000000000000000000 // 30 decimals
longTradingFee : 800000000000000000000000000 // 30 Decimals
shortTradingFee : 800000000000000000000000000 // 30 Decimals{
"name": "{function_name}",
"chainId": "{chain_id}",
"params": {function_parameters}
}{
"name": "depositSelf",
"chainId": "42161",
"params": {
"amount": "10" // required
}
}{
"name": "depositSelfAllUSDC",
"chainId": "42161",
"params": {}
}{
"name": "newPositionOrder",
"chainId": "42161",
"params": {
"tokenId": "2", // required,
"isLong": true, // required,
"positionType": "Market", // required, Enum: "Market" "Limit" "Stop Market" "Stop Limit",
"lmtPrice": "1912.5", //Optional, price for "Limit", "Stop Limit"
"slippage": "0.3", // Optional, percentage for "Market", 0.3%
"stpPrice": "1910.2", // Optional, price for "Stop Market" and "Stop Limit"
"collateral": "20.0", // required, it should be at least 20
"size": "20.0" // required
}
}
{
"name": "newPositionOrderWithTPSL",
"chainId": "42161",
"params": {
"tokenId": "2", // required,
"isLong": true, // required,
"positionType": "Market", // required, Enum: "Market" "Limit" "Stop Market" "Stop Limit",
"lmtPrice": "1912.5", //Optional, price for "Limit", "Stop Limit"
"slippage": "0.3", // Optional, percentage for "Market", 0.3%
"stpPrice": "1910.2", // Optional, price for "Stop Market" and "Stop Limit"
"collateral": "20.0", // required, it should be at least 20
"size": "20.0" // required
"takeProfit": "1920.2", // Optional, If you want to place TP, then pass TP Price, if or not, dont pass
"stopLoss": "1812.5" // Optional, if you want to place SL, then pass SL Price, if or not, dont pass SL Price
}
}{
"name": "decreasePosition",
"chainId": "1",
"params": {
"posId": "10", // required
"size": "10.0", // required,
"isLong": true, // required,
"tokenId": "1", // required,
}
}{
"name": "addPosition",
"chainId": "1",
"params": {
"posId": "10", // required
"isLong": true, // required,
"tokenId": "1", // required,
"collateral": "10", // required
"size": "20.0" // required
}
}{
"name": "addCollateral",
"chainId": "42161",
"params": {
"posId": "10", // required
"amount": "10" // required
}
}{
"name": "removeCollateral",
"chainId": "42161",
"params": {
"posId": "10", // required
"amount": "10" // required
}
}{
"name": "addTPSL",
"chainId": "42161",
"params": {
"posId": "10",
"tpPrice": "1812.2", // Only for TP
"tpAmountPercent": "100.0", // percentage, Only for TP
"slPrice": "1812.2", // Only for SL
"slAmountPercent": "100.0", // percentage, Only for SL
}
}{
"name": "cancelPendingOrder",
"chainId": "42161",
"params": {
"posId": "10" // required
}
}{
"name": "cancelTriggerOrder",
"chainId": "42161",
"params": {
"posId": "10" // required
"orderId": "0", // required
}
}{
"name": "addTrailingStop",
"chainId": "42161",
"params": {
"posId": "10", // required
"collateral": "10.0", // required
"size": "20.0", // required
"amountPercent": "100", //required percentage
"trailType": "PERCENT", //required Enum: "PERCENT" "AMOUNT"
"stopLossPrice": "1920.0",// required
"trailingAmount": "0.2" //required if trailType is "PERCENT", this is 0.2%, if it is "AMOUNT", then 0.2
}
}{
"name": "setPlatformUsed",
"chainId": "42161",
"params": {
"platform": "0x...", // platform address, required
}
}"getCryptoChart": {
"method": "POST",
"endpoint": "https://api.vela.exchange/trade-bots/charts",
"headers": {
"Content-Type": "application/json",
"vela-api-key": "{Your_Api_Key}",
"vela-key-id": "{Your_Key_Id}"
},
"body": {
"pair": "crypto_pair",
"time": "time_period",
"from": "start_date",
"to": "end_date"
}
}