🤖 Repository layout updated to latest version
This commit was automatically generated by a script: https://gitfub.space/Jmaa/python-omni
This commit is contained in:
parent
b6a55091b2
commit
f7219edc1d
62
README.md
62
README.md
|
@ -6,12 +6,11 @@
|
||||||
|
|
||||||
Automatic one-way trades.
|
Automatic one-way trades.
|
||||||
|
|
||||||
This is a wrapper about [`fin_depo`](https://gitfub.space/Jmaa/fin-depo/) for
|
This program is a wrapper around
|
||||||
automatically trading one way trades, by using repeated trades
|
[`fin_depo`](https://gitfub.space/Jmaa/fin-depo/) for automatically trading
|
||||||
over a period.
|
one-way trades, by using repeated trades over a period. Can be used to slowly
|
||||||
|
enter or exit positions, for example low-volume crypto currencies, or as an
|
||||||
The primary motivation is for trading low-volume crypto assets slowly without
|
automated investment savings system.
|
||||||
affecting the price too much.
|
|
||||||
|
|
||||||
Supported sites:
|
Supported sites:
|
||||||
|
|
||||||
|
@ -27,23 +26,51 @@ pip install -r requirements.txt
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Run using from the top directory:
|
1. Create configuration file. See below and in `examples/` folder for inspiration.
|
||||||
|
2. [Create KuCoin API key](https://www.kucoin.com/account/api) with **General**
|
||||||
```shell
|
and **Spot Trading** permissions.
|
||||||
python -m crypto_seller
|
3. Add KuCoin API key secrets (`KUCOIN_KEY`, `KUCOIN_SECRET`, `KUCOIN_PASS`) to
|
||||||
```
|
an [`secret_loader` accessible
|
||||||
|
location](https://gitfub.space/Jmaa/secret_loader#user-content-accessible) .
|
||||||
|
4. Run script using `python -m crypto_seller --config CONFIG_FILE`.
|
||||||
|
|
||||||
The script will now automatically sell assets over time. The interval between
|
The script will now automatically sell assets over time. The interval between
|
||||||
sell-offs are randomized to avoid front-running, and the amounts are also
|
sell-offs are randomized to avoid front-running, and the amounts are also
|
||||||
randomized to avoid too consistent behaviour.
|
randomized to avoid certain attacks (only relevant for smallish intervals of
|
||||||
|
less than a week).
|
||||||
|
|
||||||
The log will both be displayed in the shell, and be placed in a log file
|
The log will both be displayed in the shell, and be placed in a log file
|
||||||
`output/log.txt`. Every sell-off will be logged to the `output/trades.csv`
|
`output/log.txt`. Every sell-off will be logged to the `output/trades.csv`
|
||||||
file, with as much information as possible. Keep both of these for tax
|
file, with as much information as possible. Keep both of these for tax
|
||||||
purposes, if relevant.
|
purposes, if relevant.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Example configurations can be found in the `examples/` folder.
|
||||||
|
|
||||||
|
Configurations are `.json` files, with the following fields:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"input_asset": str,
|
||||||
|
"output_asset": str,
|
||||||
|
"input_amount_low": float,
|
||||||
|
"input_amount_high": float,
|
||||||
|
"interval_minutes_low": int,
|
||||||
|
"interval_minutes_high": int
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
While `input_amount_low` and `input_amount_high` can be identical (and
|
||||||
|
the same for `interval_minutes_XX`) it is discouraged, to avoid frontrunning attacks.
|
||||||
|
|
||||||
## Auditing information
|
## Auditing information
|
||||||
|
|
||||||
|
As mentioned before, this program is mostly glue code and wrappering around
|
||||||
|
library functionality. The glue application code allows for running the main
|
||||||
|
loop of checking balance, selling amount and sleeping until the next iteration,
|
||||||
|
with some argument and configuration parsing thrown in.
|
||||||
|
|
||||||
The most relevant libraries for auditing are:
|
The most relevant libraries for auditing are:
|
||||||
|
|
||||||
- [`fin_depo`](https://gitfub.space/Jmaa/fin-depo): Library for programmatic
|
- [`fin_depo`](https://gitfub.space/Jmaa/fin-depo): Library for programmatic
|
||||||
|
@ -51,8 +78,11 @@ The most relevant libraries for auditing are:
|
||||||
This is the library that reads balances and places market orders.
|
This is the library that reads balances and places market orders.
|
||||||
- [`fin_defs`](https://gitfub.space/Jmaa/fin-defs): Definitions of financial
|
- [`fin_defs`](https://gitfub.space/Jmaa/fin-defs): Definitions of financial
|
||||||
assets and instruments. Used by `fin_depo`.
|
assets and instruments. Used by `fin_depo`.
|
||||||
- [`python-kucoin`](https://python-kucoin.readthedocs.io/en/latest/) is used by
|
- [`secret_loader`](https://gitfub.space/Jmaa/secret_loader): Library for
|
||||||
`fin_depo` for providing KuCoin support.
|
loading of secrets (passwords, API keys, secret keys, configuration files,
|
||||||
|
etc.) from standardized locations.
|
||||||
|
- [`python-kucoin`](https://python-kucoin.readthedocs.io/en/latest/): Used by
|
||||||
|
`fin_depo` to provide KuCoin backend.
|
||||||
|
|
||||||
## Taxation
|
## Taxation
|
||||||
|
|
||||||
|
@ -77,8 +107,8 @@ most mature on the danish market, and does support KuCoin.
|
||||||
* Catch runtime errors when selling
|
* Catch runtime errors when selling
|
||||||
* Show errors to log.
|
* Show errors to log.
|
||||||
* Stop loop and exit with results, and error indicator.
|
* Stop loop and exit with results, and error indicator.
|
||||||
- [ ] Document configuration
|
- [X] Document configuration
|
||||||
- [ ] Document code auditing
|
- [X] Document code auditing
|
||||||
- [X] Parse configuration from json.
|
- [X] Parse configuration from json.
|
||||||
- [X] Ensure sell time is included in order details
|
- [X] Ensure sell time is included in order details
|
||||||
- [X] Log all trades to CSV file.
|
- [X] Log all trades to CSV file.
|
||||||
|
|
62
setup.py
62
setup.py
|
@ -15,12 +15,11 @@ PACKAGE_DESCRIPTION = """
|
||||||
|
|
||||||
Automatic one-way trades.
|
Automatic one-way trades.
|
||||||
|
|
||||||
This is a wrapper about [`fin_depo`](https://gitfub.space/Jmaa/fin-depo/) for
|
This program is a wrapper around
|
||||||
automatically trading one way trades, by using repeated trades
|
[`fin_depo`](https://gitfub.space/Jmaa/fin-depo/) for automatically trading
|
||||||
over a period.
|
one-way trades, by using repeated trades over a period. Can be used to slowly
|
||||||
|
enter or exit positions, for example low-volume crypto currencies, or as an
|
||||||
The primary motivation is for trading low-volume crypto assets slowly without
|
automated investment savings system.
|
||||||
affecting the price too much.
|
|
||||||
|
|
||||||
Supported sites:
|
Supported sites:
|
||||||
|
|
||||||
|
@ -36,23 +35,51 @@ pip install -r requirements.txt
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Run using from the top directory:
|
1. Create configuration file. See below and in `examples/` folder for inspiration.
|
||||||
|
2. [Create KuCoin API key](https://www.kucoin.com/account/api) with **General**
|
||||||
```shell
|
and **Spot Trading** permissions.
|
||||||
python -m crypto_seller
|
3. Add KuCoin API key secrets (`KUCOIN_KEY`, `KUCOIN_SECRET`, `KUCOIN_PASS`) to
|
||||||
```
|
an [`secret_loader` accessible
|
||||||
|
location](https://gitfub.space/Jmaa/secret_loader#user-content-accessible) .
|
||||||
|
4. Run script using `python -m crypto_seller --config CONFIG_FILE`.
|
||||||
|
|
||||||
The script will now automatically sell assets over time. The interval between
|
The script will now automatically sell assets over time. The interval between
|
||||||
sell-offs are randomized to avoid front-running, and the amounts are also
|
sell-offs are randomized to avoid front-running, and the amounts are also
|
||||||
randomized to avoid too consistent behaviour.
|
randomized to avoid certain attacks (only relevant for smallish intervals of
|
||||||
|
less than a week).
|
||||||
|
|
||||||
The log will both be displayed in the shell, and be placed in a log file
|
The log will both be displayed in the shell, and be placed in a log file
|
||||||
`output/log.txt`. Every sell-off will be logged to the `output/trades.csv`
|
`output/log.txt`. Every sell-off will be logged to the `output/trades.csv`
|
||||||
file, with as much information as possible. Keep both of these for tax
|
file, with as much information as possible. Keep both of these for tax
|
||||||
purposes, if relevant.
|
purposes, if relevant.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Example configurations can be found in the `examples/` folder.
|
||||||
|
|
||||||
|
Configurations are `.json` files, with the following fields:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"input_asset": str,
|
||||||
|
"output_asset": str,
|
||||||
|
"input_amount_low": float,
|
||||||
|
"input_amount_high": float,
|
||||||
|
"interval_minutes_low": int,
|
||||||
|
"interval_minutes_high": int
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
While `input_amount_low` and `input_amount_high` can be identical (and
|
||||||
|
the same for `interval_minutes_XX`) it is discouraged, to avoid frontrunning attacks.
|
||||||
|
|
||||||
## Auditing information
|
## Auditing information
|
||||||
|
|
||||||
|
As mentioned before, this program is mostly glue code and wrappering around
|
||||||
|
library functionality. The glue application code allows for running the main
|
||||||
|
loop of checking balance, selling amount and sleeping until the next iteration,
|
||||||
|
with some argument and configuration parsing thrown in.
|
||||||
|
|
||||||
The most relevant libraries for auditing are:
|
The most relevant libraries for auditing are:
|
||||||
|
|
||||||
- [`fin_depo`](https://gitfub.space/Jmaa/fin-depo): Library for programmatic
|
- [`fin_depo`](https://gitfub.space/Jmaa/fin-depo): Library for programmatic
|
||||||
|
@ -60,8 +87,11 @@ The most relevant libraries for auditing are:
|
||||||
This is the library that reads balances and places market orders.
|
This is the library that reads balances and places market orders.
|
||||||
- [`fin_defs`](https://gitfub.space/Jmaa/fin-defs): Definitions of financial
|
- [`fin_defs`](https://gitfub.space/Jmaa/fin-defs): Definitions of financial
|
||||||
assets and instruments. Used by `fin_depo`.
|
assets and instruments. Used by `fin_depo`.
|
||||||
- [`python-kucoin`](https://python-kucoin.readthedocs.io/en/latest/) is used by
|
- [`secret_loader`](https://gitfub.space/Jmaa/secret_loader): Library for
|
||||||
`fin_depo` for providing KuCoin support.
|
loading of secrets (passwords, API keys, secret keys, configuration files,
|
||||||
|
etc.) from standardized locations.
|
||||||
|
- [`python-kucoin`](https://python-kucoin.readthedocs.io/en/latest/): Used by
|
||||||
|
`fin_depo` to provide KuCoin backend.
|
||||||
|
|
||||||
## Taxation
|
## Taxation
|
||||||
|
|
||||||
|
@ -86,8 +116,8 @@ most mature on the danish market, and does support KuCoin.
|
||||||
* Catch runtime errors when selling
|
* Catch runtime errors when selling
|
||||||
* Show errors to log.
|
* Show errors to log.
|
||||||
* Stop loop and exit with results, and error indicator.
|
* Stop loop and exit with results, and error indicator.
|
||||||
- [ ] Document configuration
|
- [X] Document configuration
|
||||||
- [ ] Document code auditing
|
- [X] Document code auditing
|
||||||
- [X] Parse configuration from json.
|
- [X] Parse configuration from json.
|
||||||
- [X] Ensure sell time is included in order details
|
- [X] Ensure sell time is included in order details
|
||||||
- [X] Log all trades to CSV file.
|
- [X] Log all trades to CSV file.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user