📈Contract
Swap Contracts Trading API Documentation
side
side
The side of the trade.
BUY_OPEN
: open a long position.
SELL_CLOSE
: close a long position.
SELL_OPEN
: open a short position.
BUY_CLOSE
: close a short position.
priceType
priceType
Price types.
INPUT
: The system will use the price you entered exactly to fill the orders.
OPPONENT
: Orders will be filled using the opposite side's best quote.
For example, if you are opening 10 contracts long, the best buy price is 10 and the best sell price is 11. You will send an order buying 10 contracts at 11. If the order, is not fully filled, the rest will be left on the orderbook.
QUEUE
: Order will be send using the same side's best quote.
For example, if you are opening 10 contracts long, the best buy price is 10 and the best sell price is 11. You will be send an order buying 10 contracts at 10.
OVER
: The price will be the best opposite quote + overPrice(not a fixed value).
For example, if you are opening 10 contracts long, the best buy price is 10 and the best sell price is 11, you set the overPrice at 3. You will be send an order buying 10 contracts at (11+3)=14.
MARKET
: The price will be newest price * (1 ± 5%).
For example, if you are opening 10 contracts long, the latest price is 10. Then you will be sending out an order buying 10 contracts at (10 * 1.05)=10.5.
timeInForce
timeInForce
Time in force.
GTC
: Good till canceled. Meaning the order will stand unless otherwise cancelled.
IOC
: Immediate or cancel. Meaning the order will be cancelled if not executed immediately. Recommended if you want to fill the entire order immediately.
FOK
: Fill or kill. Meaning the order will be canceled if not immediately filled. Recommended if you want to fill as much as possible, but not necessarily all of, the order immediately.
LIMIT_MAKER
: Order will be cancelled if executed immediately.
orderType
orderType
Order type.
LIMIT
: Orders to be executed given a specified price or better.
STOP
: Order that will be triggered once it reaches the triggerPrice
.
For detailed request limit information, see brokerInfo.
Rate limiters (rateLimitType)
REQUESTS_WEIGHT
ORDERS
Rate limit intervals
SECOND
MINUTE
DAY
For example:
Public
Security Type: None
Endpoints under Public section can be accessed freely without requiring any API-key or signatures.
Get Broker Trading information (Contracts)
GET
https://api.coinflare.com/openapi/v1/brokerInfo
Get current contract trading rules.
Query Parameters
type
string
Trade section information. Possible values include token
, options
, and contracts
, If the parameter is not sent, all trading information will be returned.
Response:
timezone
string
UTC
Timezone of timestamp
serverTime
long
1554887652929
Retrieves the current time on server (in ms).
In the rateLimits
field: Order api request limit will be displayed.
rateLimitType
string
ORDERS
Rate Limit type
interval
string
SECOND
Rate Limit interval
limit
string
1500
Rate Limit value within the interval.
In the contracts
field: All actively trading contracts will be displayed.
symbol
string
BTCUSD
Name of the contract.
status
string
TRADING
Status of the contract.
baseAsset
string
BTCUSD
Base Asset of the trading pair. In the case with contracts, the contract itself is the base asset.
baseAssetPrecision
float
0.001
Precision of the contract quantity (baseAsset).
quoteAsset
string
USDT
Quote asset for the contract. Meaning the contract is quoted in that currency.
quoteAssetPrecision
float
0.001
Precision of the contract price (quoteAsset).
marginToken
string
BTC
Token used to settle funding and calculate PNL(profit and loss)
marginPrecision
float
0.0001
Precision of users' position margin.
inverse
bool
true
Whether the contract is inverse.
index
string
BTCUSDT
Index symbol of the underlying asset. Index price can be accessed at the index
endpoint. For instance, BTC-PERP-REV
uses BTCUSDT
for index price.
contractMultiplier
string
true
The multiplier of contract.
icebergAllowed
string
false
Whether iceberg orders are allowed.
For filters
in contracts
field:
filterType
string
PRICE_FILTER
Type of the filter.
minPrice
float
0.001
Minimum price allowed
maxPrice
float
100000.00000000
Maximum price allowed
tickSize
float
0.001
Precision of the contract price.
minQty
float
0.01
Minimum quantity allowed
maxQty
float
100000.00000000
Maximum quantity allowed
stepSize
float
0.001
Precision of the contract quantity
minNotional
float
1
Minimum trade size (quantity * price)
In the riskLimits
filed:
quantity
float
100
Positions below this amount follows the following requirement.
initialMargin
float
0.1
Initial margin rate requirement.
maintMargin
float
0.03
Minimum maintenance margin rate requirement.
Weight: 0
Get Contract Infomation
GET
https://api.coinflare.com/openapi/v1/contracts
Return all information regarding contracts
Insurance (PENDING)
GET
https://api.coinflare.com/openapi/contract/v1/insurance
Get current insurance funding
Query Parameters
symbol
string
Input specific symbol to return the corresponding records. If not entered, records for all symbols will be returned. E.g. BTCUSDT
fromId
number
Pagination, return records which id < fromId
toId
number
Pagination, return records which id > toId. If toId is given, toId cannot be 0.
limit
integer
Number of entries returned. Default to 20.
Response:
id
long
1552272184833
The ID of the record.
timestamp
long
155227218483
current server timestamp.
value
float
23.23
Balance of the insurance fund.
unit
string
BTC
Unit of the balance..
Weight: 0
Funding Rate (PENDING)
GET
https://api.coinflare.com/openapi/contract/v1/fundingRate
Get current funding rate.
Query Parameters
symbol
string
The contract to be returned, If not send, records for all symbols will be returned. E.g. BTCUSDT
state
string
Get current
or past
funding rate.
from
number
Timestamp to start
endTime
number
Timestamp to end
limit
integer
Number of entries returned. Default to 20.
Response:
symbol
string
BTCUSD
Name of the contracts
intervalStart
long
1554710400000
Timestamp when the interval started.
intervalEnd
long
1554710400000
Timestamp when the interval ended.
rate
float
0.00321
The funding rate of this interval.
index
float
10076.34
Index price at the time of settlement.
Weight: 0
Market
Security Type: None
Endpoints under Market section can be accessed freely without requiring any API-key or signatures.
Index
GET
https://api.coinflare.com/openapi/quote/v1/contract/index
Underlying asset index price.
Query Parameters
symbols
string
Underlying asset symbol. If this parameter is not sent, all symbols will be returned. E.g. BTCUSDT
Response:
index
float
8342.73
The index price of the instrument.
EDP
float
8432.32
The EDP (estimated delivery price of the contract). The average price of the index in the last 10 minutes. This will be the price on which the contract is going to be settled.
Depth
GET
https://api.coinflare.com/openapi/quote/v1/contract/depth
This endpoint retrieve contract market depth data. This endpoint updates every 3s.
Query Parameters
symbol
string
The contract name for which to retrieve the order book.. E.g. BTC-PERP-REV
limit
integer
The number of entries to return for bids and asks. Default 100; Max 100.
Response:
time
long
1550829103981
Current timestamp (ms)
bids
list
(see below)
List of all bids, best bids first. See below for entry details.
asks
list
(see below)
List of all asks, best asks first. See below for entry details.
The fields bids
and asks
are lists of orderbook price level entries, sorted from best to worst.
''
float
123.10
price level
''
float
300
The total quantity of orders for this price level
Merged Depth (Recommended)
GET
https://api.coinflare.com/openapi/quote/v1/contract/depth/merged
This endpoint retrieve contract market depth data. This endpoint updates every 0.5s.
Query Parameters
symbol
string
The contract name for which to retrieve the order book.. E.g. BTC-PERP-REV
limit
integer
The number of entries to return for bids and asks. Default 40; Max 40.
Response:
time
long
1550829103981
Current timestamp (ms)
bids
list
(see below)
List of all bids, best bids first. See below for entry details.
asks
list
(see below)
List of all asks, best asks first. See below for entry details.
The fields bids
and asks
are lists of orderbook price level entries, sorted from best to worst.
''
float
123.10
price level
''
float
300
The total quantity of orders for this price level
Recent Trades List
GET
https://api.coinflare.com/openapi/quote/v1/contract/trades
Get the latest trades that have occurred for a specific contract.
Query Parameters
symbol
string
Symbol Name. E.g. BTC-PERP-REV
limit
integer
Number of trades returned. Default 500; Max 1000
Response:
price
float
0.055
The price of the trade
time
long
1537797044116
Current timestamp (ms)
qty
float
5
The quantity traded
isBuyerMaker
string
true
true
= Order is a buy order when created, false
= Order is a sell order when created
Kline/candlestick data
GET
https://api.coinflare.com/openapi/quote/v1/klines
This endpoint retrieves kline data
Query Parameters
symbol
string
Symbol Name. E.g. BTC-PERP-REV
interval
string
Interval of the Kline. Possible values include: 1m
,5m
,15m
,30m
,1h
,1d
,1w
,1M
endTime
number
Timestamp to the last datapoint.
limit
integer
Default 500; Max 1000
Response:
''
long
1538728740000
Open Time
''
float
36.00000
Open
''
float
36.00000
High
''
float
36.00000
Low
''
float
36.00000
Close
''
float
148976.11427815
Trade volume amount
''
long
1538728740000
Close time
''
float
2434.19055334
Quote asset volume
''
integer
308
Number of trades
''
float
1756.87402397
Taker buy base asset volume
''
float
28.46694368
Taker buy quote asset volume
If startTime and endTime are not sent, the most recent klines are returned.
If the symbol is not sent, tickers for all symbols will be returned in an array.
base asset
means the quantity is expressed as the amount of contracts that were received by the buyer.quote asset
means the amount of tokens paid to acquire the contracts.
24hrs ticker price change statistics
GET
https://api.coinflare.com/openapi/quote/v1/contract/ticker/24hr
24 hour price change statistics. Careful when accessing this no symbol.
Path Parameters
symbol
string
Symbol Name. E.g. BTC-SWAP
Response:
time
long
1538728740000
Open Time
symbol
string
BTC-SWAP
Contract Name
bestBidPrice
float
4.000002000
Best Bid Price
bestAskPrice
float
4.000002000
Best Ask Price
lastPrice
float
4.000002000
Last Price
openPrice
float
99.0000000
Open Price
highPrice
float
100.0000000
High Price
lowPrice
float
0.10000000
Low Price
volume
float
8913.300000
Trade Volume
openInterest
float
21324243142
Open Interets
If the symbol is not sent, tickers for all symbols will be returned in an array.
Trade
Security Type: USER_DATA/TRADE
Endpoints under Trade require an API-key and a signature.
New Order
POST
https://api.coinflare.com/openapi/contract/v1/order
Places order for a contract. This API endpoint requires your request to be signed.
Query Parameters
clientOrderId
string
A unique ID of the order (user defined)
symbol
string
Name of the contract
side
string
Direction of the order. Possible values include BUY_OPEN
, SELL_OPEN
, BUY_CLOSE
, and SELL_CLOSE
orderType
string
The order type, possible type include: LIMIT
, STOP
quantity
number
The number of contracts trading. For MARKET
buy orders, quantity is the equivalent of amount.
price
number
Price of the order. REQUIRED for (LIMIT
& INPUT
) orders.
priceType
string
The price type, possible types include: INPUT
(Default)
, OPPONENT
, QUEUE
, OVER
, and MARKET
.
triggerPrice
number
The price at which the trigger order will be executed.
timeInForce
string
Time in force for LIMIT
orders. Possible values include GTC
(Default)
,FOK
,IOC
,LIMIT_MAKER
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
time
long
1570759718825
Timestamp when the order is created.
updateTime
long
1551062936784
Last time this order was updated
orderId
integer
469961015902208000
ID of the order.
clientOrderId
string
213443
A unique ID of the order.
symbol
string
BTC-PERP-REV
Name of the contract.
price
float
8200
Price of the order.
origQty
float
1.01
Quantity ordered
executedQty
float
1.01
Quantity of orders that has been executed
avgPrice
float
4754.24
Average price of filled orders.
marginLocked
float
200
Amount of margin locked for this order. This includes the actually margin needed plus fees to open and close the position.
orderType
string
YES
The order type, possible types: LIMIT
, STOP
priceType
string
INPUT
The price type. Possible values include INPUT
, OPPONENT
, QUEUE
, OVER
, and MARKET
.
side
string
BUY
Direction of the order. Possible values include BUY_OPEN
, SELL_OPEN
, BUY_CLOSE
, and SELL_CLOSE
.
status
string
NEW
The state of the order.Possible values include NEW
, PARTIALLY_FILLED
, FILLED
, CANCELED
, and REJECTED
.
timeInForce
string
GTC
Time in force. Possible values include GTC
,FOK
,IOC
, and LIMIT_MAKER
fees
Fees incurred for this order.
Notes:
For Market Orders, you need to set
orderType
asLIMIT
ANDpriceType
asMARKET
.You can get contracts' price, quantity precision configuration data in the
brokerInfo
endpoint.If your balance does not meet the margin requirement (which is the minimum margin requirement + open position fee + close position fee), "insufficient balance" error message will be returned.
For detailed information regarding various price types and order types. Please refer to the explanation section in the end.
Weight: 1
Query Order
GET
https://api.coinflare.com/openapi/contract/v1/getOrder
Get details on a specific order, regardless of order state.
Query Parameters
orderType
string
The order type, possible types: LIMIT
, STOP
orderId
string
Order Id. E.g. 507904211109878016
clientOrderId
string
Client Order Id. A unique ID of the order (user defined). E.g. 12094ahsihsiad
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
time
long
1551062936784
Timestamp when the order is created.
updateTime
long
1551062936784
Last time this order was updated
orderId
integer
891
ID of the order.
clientOrderId
string
213443
A unique ID of the order.
symbol
string
BTC-PERP-REV
Name of the contracts.
price
float
4765.29
Price of the order.
origQty
float
1.01
Quantity ordered
executedQty
float
1.01
Quantity of orders that has been executed
avgPrice
float
4754.24
Average price of filled orders.
marginLocked
float
200
Amount of margin locked for this order. This includes the actually margin needed plus fees to open and close the position.
orderType
string
LIMIT
The order type, possible types: LIMIT
and STOP
.
priceType
string
INPUT
The price type. Possible values include INPUT
, OPPONENT
, QUEUE
, OVER
, and MARKET
.
side
string
BUY_OPEN
Direction of the order. Possible values include BUY_OPEN
, SELL_OPEN
, BUY_CLOSE
, and SELL_CLOSE
.
status
string
NEW
The state of the order.Possible values include NEW
, PARTIALLY_FILLED
, FILLED
, CANCELED
, and REJECTED
.
timeInForce
string
GTC
Time in force. Possible values include GTC
,FOK
,IOC
, and LIMIT_MAKER
.
fees
Fees incurred for this order.
Weight: 1
Either
orderId
orclientOrderId
must be sentFor some historical orders
cummulativeQuoteQty
will be < 0, meaning the data is not available at this time.
Cancel Order
DELETE
https://api.coinflare.com/openapi/contract/v1/order/cancel
Cancel an active order
Query Parameters
orderType
string
The order type, possible types: LIMIT
and STOP
.
orderId
string
Order Id. E.g. 507904211109878016
clientOrderId
string
Client Order Id. A unique ID of the order (user defined). E.g. 12094ahsihsiad
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
time
long
1551062936784
Timestamp when the order is created.
updateTime
long
1551062936784
Last time this order was updated
orderId
integer
891
ID of the order.
clientOrderId
string
213443
A unique ID of the order.
symbol
string
BTC-PERP-REV
Name of the contract.
price
float
4765.29
Price of the order.
origQty
float
1.01
Quantity ordered
executedQty
float
1.01
Quantity of orders that has been executed
avgPrice
float
4754.24
Average price of filled orders.
marginLocked
float
200
Amount of margin locked for this order. This includes the actually margin needed plus fees to open and close the position.
orderType
string
LIMIT
The order type, possible types: LIMIT
and STOP
.
priceType
string
INPUT
The price type. Possible values include INPUT
, OPPONENT
, QUEUE
, OVER
, and MARKET
.
side
string
BUY_OPEN
Direction of the order. Possible values include BUY_OPEN
, BUY_CLOSE
, SELL_OPEN
and SELL_CLOSE
status
string
NEW
The state of the order.Possible values include NEW
, PARTIALLY_FILLED
, FILLED
, CANCELED
, and REJECTED
.
timeInForce
string
GTC
Time in force. Possible values include GTC
,FOK
,IOC
, and LIMIT_MAKER
fees
Fees incurred for this order.
In the fees
field:
feeToken
string
USDT
Fee token kind.
fee
float
0
Actual transaction fees occurred.
Weight: 1
Either
orderId
orclientOrderId
must be sent
Batch Cancel
DELETE
https://api.coinflare.com/openapi/contract/v1/order/batchCancel
Cancel orders en masse. (PENDING: batch cancel for STOP orders)
Query Parameters
symbol
string
Contract Name. E.g. BTC-PERP-REV
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
message
string
success
The message response of the cancel request.
timestamp
long
1541161088303
The timestamp when the response is returned.
Current Open Orders
GET
https://api.coinflare.com/openapi/contract/v1/openOrders
Get all open orders on a symbol. Careful when accessing this with no symbols.
Query Parameters
orderType
string
The order type, possible types: LIMIT
and STOP
.
symbol
string
Symbol to return open orders for. If not sent, orders of all contracts will be returned.
orderId
string
Order Id
limit
integer
Default 20; Max 1000
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
time
long
1551062936784
Timestamp when the order is created.
updateTime
long
1551062936784
Last time this order was updated
orderId
integer
891
ID of the order.
clientOrderId
string
213443
A unique ID of the order.
symbol
string
BTC-PERP-REV
Name of the contracts.
price
float
4765.29
Price of the order.
origQty
float
1.01
Quantity ordered
executedQty
float
1.01
Quantity of orders that has been executed
avgPrice
float
4754.24
Average price of filled orders.
marginLocked
float
200
Amount of margin locked for this order. This includes the actually margin needed plus fees to open and close the position.
orderType
string
LIMIT
The order type, possible types: LIMIT
and STOP
.
priceType
string
INPUT
The price type. Possible values include INPUT
, OPPONENT
, QUEUE
, OVER
, and MARKET
.
side
string
BUY_OPEN
Direction of the order. Possible values include BUY_OPEN
, SELL_OPEN
, BUY_CLOSE
, and SELL_CLOSE
.
status
string
NEW
The state of the order.Possible values include NEW
, PARTIALLY_FILLED
, FILLED
, CANCELED
, and REJECTED
.
timeInForce
string
GTC
Time in force. Possible values include GTC
,FOK
,IOC
, and LIMIT_MAKER
.
fees
Fees incurred for this order.
Weight: 1
If
orderId
is set, it will get orders < thatorderId
. Otherwise most recent orders are returned.
History Orders
GET
https://api.coinflare.com/openapi/contract/v1/historyOrders
Get all history orders. Careful when accessing this with no symbol.
Query Parameters
orderType
string
The order type, possible types: LIMIT
, STOP
symbol
string
Symbol Name. E.g. BTC-PERP-REV
orderId
integer
Order Id. E.g. 507904211109878016
limit
integer
Default 500; Max 1000
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
time
long
1551062936784
Timestamp when the order is created.
updateTime
long
1551062936784
Last time this order was updated
orderId
integer
891
ID of the order.
clientOrderId
string
213443
A unique ID of the order.
symbol
string
BTC-PERP-REV
Name of the contracts.
price
float
4765.29
Price of the order.
origQty
float
1.01
Quantity ordered
executedQty
float
1.01
Quantity of orders that has been executed
avgPrice
float
4754.24
Average price of filled orders.
marginLocked
float
200
Amount of margin locked for this order. This includes the actually margin needed plus fees to open and close the position.
orderType
string
LIMIT
The order type, possible types: LIMIT
and STOP
.
priceType
string
INPUT
The price type. Possible values include INPUT
, OPPONENT
, QUEUE
, OVER
, and MARKET
.
side
string
BUY_OPEN
Direction of the order. Possible values include BUY_OPEN
, SELL_OPEN
, BUY_CLOSE
, and SELL_CLOSE
.
status
string
NEW
The state of the order.Possible values include NEW
, PARTIALLY_FILLED
, FILLED
, CANCELED
, and REJECTED
.
timeInForce
string
GTC
Time in force. Possible values include GTC
,FOK
,IOC
, and LIMIT_MAKER
.
fees
Fees incurred for this order.
Weight: 5
If
orderId
is set, it will get orders < thatorderId
. Otherwise most recent orders are returned.
Trades
GET
https://api.coinflare.com/openapi/contract/v1/myTrades
Get historical trades.
Query Parameters
symbol
string
Symbol Name. E.g. BTC-PERP-REV
fromId
integer
Trade Id to fetch from
toId
integer
Trade Id to fetch to
limit
integer
Default 20; Max 1000
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
time
long
1551062936784
Timestamp when the order is created.
tradeId
long
49366
The ID for the trade
orderId
integer
891
ID of the order.
symbolId
string
BTC-PERP-REV
Name of the contract.
price
float
4765.29
Price of the trade.
quantity
float
1.01
Quantity of the trade.
feeTokenId
string
USDT
Fee token name.
fee
Fee of the trade.
side
string
BUY
Direction of the order. Possible values include BUY_OPEN
, SELL_OPEN
, BUY_CLOSE
, and SELL_CLOSE
.
orderType
string
LIMIT
The order type, possible types: LIMIT, MARKET
Weight: 5
If only
fromId
is set,it will get orders < thatfromId
in descending order.If only
toId
is set, it will get orders > thattoId
in ascending order.If
fromId
is set andtoId
is set, it will get orders < thatfromId
and > thattoId
in descending order.If
fromId
is not set andtoId
it not set, most recent order are returned in descending order.
Positions
GET
https://api.coinflare.com/openapi/contract/v1/positions
Retrieve current positions.
Query Parameters
symbol
string
Name of the contract. If not sent, positions for all contracts will be returned. E.g. BTC-PERP-REV
side
string
LONG
or SHORT
. Direction of the position. If not sent, positions for both sides will be returned.
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
symbol
string
BTC-PERP-REV
Name of the contract.
side
string
LONG
Position side.
avgPrice
float
100
Average price for opening the position.
position
float
20
Amount of contracts opened
available
float
15
Amount of contracts available to close.
leverage
float
5
Leverage of the position
lastPrice
float
100
Last trade price of the symbol.
positionValue
float
2000
Current position value.
flp
float
80
Forced liquidation price.
margin
float
20
Margin for this position.
marginRate
float
0.2
Margin rate for current position.
unrealizedPnL
float
0.0
Unrealized profit and loss for current position held.
profitRate
float
0.0000333
Rate of return for the position.
realizedPnL
float
6.8
Cumulative realized profit and loss for this symbol
.
Weight: 1
Modify Margin
POST
https://api.coinflare.com/openapi/contract/v1/modifyMargin
Modify margin for a specific symbol.
Query Parameters
symbol
string
The symbol's margin to be modified. E.g. BTC-PERP-REV
side
string
LONG
or SHORT
. Direction of the position.
amount
number
Amount of margin to be added (Positive Value) or removed (Negative Value). Please note that this amount refers to the underlying quote asset of the asset.
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
symbol
string
BTC-PERP-REV
The name of the contract.
margin
float
12.3
Updated margin for the symbol.
timestamp
long
1541161088303
Updated timestamp
Weight: 1
Modify Leverage
POST
https://api.coinflare.com/openapi/contract/v1/modifyLeverage
Modify leverage for a specific symbol and position.
Query Parameters
symbol
string
The symbol's margin to be modified. E.g. BTC-PERP-REV
side
string
LONG
or SHORT
. Direction of the position.
leverage
number
Position/Symbol leverage
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
symbol
string
BTC-PERP-REV
The name of the contract.
leverage
float
12.3
Updated leverage for the symbol.
timestamp
long
1541161088303
Updated timestamp
Account
Security Type: USER_DATA/TRADE
Endpoints under Account require an API-key and a signature.
Account Information
GET
https://api.coinflare.com/openapi/contract/v1/account
Get current contract account information (balances)
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
total
float
131.06671401
Total balance.
availableMargin
float
131.0545541
Available margin for use.
positionMargin
float
0.01215991
Margin for positions.
orderMargin
float
0
Margin locked for open orders.
Weight: 5
Transfer (PENDING)
POST
https://api.coinflare.com/openapi/v1/transfer
This endpoint is used to transfer funds across different accounts.
Query Parameters
from
string
Currently supports transferring assets across wallet
, option
, and contract
accounts.
to
string
Same as above.
currency
string
The intended currency to transfer. (USDT
, BTC
, etc.)
amount
number
Amount of currency to transfer.
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Weight: 1
Last updated