From sgcWebSockets 4.5.0 FTX API is supported.
APIs supported
- WebSockets API: connect to a public websocket server and provides real-time market data updates.
- REST API: The REST API has endpoints for account and order management as well as public market data.
FTX WebSocket API
In order to connect to FTX WebSocket API, just create a new FTX API client and attach to TsgcWebSocketClient.
Find below an example:
FTX offers a variety of channels where you can subscribe to get real-time updates of market data, orders...
Find below a sample of how subscribe to a Ticker:
FTX REST API
FTX offers public Market Data through REST Endpoints, when you call one of these endpoints, you will get an snapshot of the market data requested.
The Market Data Endpoints doesn't require authentication, so are freely available to all users.
Example: to get an snapshot of the market BTC-PERP, do the following call
The FTX REST API offer public and private endpoints. The Private endpoints requires that messages are signed to increase the security of transactions.
First you must login to your FTX account and create a new API, you will get the following values:
- ApiKey
- ApiSecret
These fields must be configured in the FTX property of the FTX API client component.
Once configured, you can start to do private requests to the FTX REST API
Place Orders
Market Order
Place a new Market Order, buy 0.002 contracts of BTC-PERP
Limit Order
Place a new Limit Order, buy 0.002 contracts of BTC-PERP at price limit of 10000