https://github.com/edo1z/ftx-sample
FTX Sample
https://github.com/edo1z/ftx-sample
Last synced: 3 months ago
JSON representation
FTX Sample
- Host: GitHub
- URL: https://github.com/edo1z/ftx-sample
- Owner: edo1z
- License: mit
- Created: 2020-08-31T14:17:36.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-08T16:02:30.000Z (about 5 years ago)
- Last Synced: 2025-04-14T03:38:52.373Z (6 months ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 2
- Watchers: 1
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# FTX-sample
FTX-sample is the Automatic trading program for [FTX](https://ftx.com/#a=4882303)
## How to use
- Register your account on [FTX](https://ftx.com/#a=4882303).
- Create an [FTX](https://ftx.com/#a=4882303) API key and set it in the .env file.
- Install and start this program.## API Key
- Go to [https://ftx.com/profile](https://ftx.com/profile/#a=4882303) and click the "Create API Key" button in the "API Key" section. Copy the created API key and API secret key.## Install and start
```
$ git clone git@github.com:edo1z/ftx-sample.git
$ cd ftx-sample
$ npm install
$ vim .env
$ vim config/index.js
$ node main
```### .env
```
API_KEY=XXXXXXXXXXXXXXXXXXXX
API_SECRET_KEY=XXXXXXXXXXXXXXXXXXXXXX
```### config/index.js
- This file is used for automatic transaction settings.```
module.exports = {
amountPerTransaction: 1,
minTradeAmountDiff: 750000,
maxSpreadRate: 0.0015,
minProfitRate: 0.0001,
maxLossRate: 0.001,
maxLossRateOfModifyOrder: 0.0005,
orderTimeLimit: 10,
counterOrderTimeLimit: 30,
markets: ['ETH-PERP'],
},
```- `amountPerTransaction` is the amount per transaction ($)
- For example, if this parameter is 100 and ETH is $350, you will buy and sell about 0.28 ETH in one trade.
- `minTradeAmountDiff` is the difference between Bid and Ask size over a period of time.
- `maxSpreadRate` is the maximum spread that can be traded automatically.
- `minProfitRate` is the profit rate when making a profitable order by automatic trading
- `maxLossRate` is the loss rate when making a loss cut order for the market
- `maxLossRateOfModifyOrder` is the loss rate when resetting the order price to the current price
- `orderTimeLimit` is the valid order time (seconds)
- `counterOrderTimeLimit` is the valid time for counter orders. When the valid time expires, reset the current price.
- `markets` is a list of markets for automatic trading## License
MIT