Skip to content

Commit

Permalink
Adding new strategy configuration system
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Nov 24, 2022
1 parent b8ff8c1 commit 612b9fa
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 1 deletion.
4 changes: 3 additions & 1 deletion configurations/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Executor configurations
# Executor configurations (legacy)

**These are legacy configuration files. See [../env/]

This folder contains configuration scripts for different trading strategy executions

Expand Down
7 changes: 7 additions & 0 deletions env/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Executor configurations (legacy)

**These are legacy configuration files. See [env folder](../env/) for recent files.

This folder contains configuration scripts for different trading strategy executions.
These are incomplete configuration files that need to be processed
by `create-docker-env-secrets.sh.`
31 changes: 31 additions & 0 deletions env/pancake-eth-usd-sma.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# This is a configuration file for pancake-eth-usdc-sma.py strategy
#
# This is only partial configuration.
# To createa full .env configuration file for Docker container, which also contains secrets,
# you need to run create-docker-env-with-secrets.sh having this file as an input.
#

# Metadata

EXECUTOR_ID=pancake-eth-usd-sma
NAME="Quickswap momentum"
DOMAIN_NAME="pancake-eth-usd-sma.tradingstrategy.ai"
SHORT_DESCRIPTION="A data collection test that trades on Polygon MATIC/USDC pairs."
LONG_DESCRIPTION="This strategy is a test strategy that does not aim to generated profit. The strategy trades on MATIC/USDC pairs on QuickSwap. The strategy rebalances every 16 hours to generate maximum amount of data. Based on 4h candles, the strategy calculates the momentum and picks highest gainers. The portfolio can hold 6 positions at once."
ICON_URL="https://i0.wp.com/bloody-disgusting.com/wp-content/uploads/2022/01/watch-robocop-the-series.png?w=1270"

# 12 hours
export MAX_DATA_DELAY_MINUTES=720

# Blockchain transaction broadcasting parameters
GAS_PRICE_METHOD="london"
EXECUTION_TYPE="uniswap_v2_hot_wallet"
APPROVAL_TYPE="unchecked"

# Webhook server configuration for Docker.
# Always static.
# This is mapped to the host in docker-compose.yml
HTTP_PORT=3456
HTTP_HOST=0.0.0.0

27 changes: 27 additions & 0 deletions scripts/create-docker-env-with-secrets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# Creates .env file for a trade-executor Docker container
#
# - Reads public .env configuration variables
# - Reads secret environment variables
# - Generates some file locations based on the strategy id
# - Validates environment variables
# - Writes the output to a single file
#
# Usage:
#
# # Load your non-committed secrets from the server root
# source ~/my-secrets.env
#
# # Combine the env configuration file with the secrets
# scripts/create-docker-env-with-secrets.sh env/pancake-eth-usd-sma.env > ~/pancake-eth-usd-sma-final.env
#



#
# Generated environment variables.
# These maps to the physical paths on the server,
# also mapped in docker-compose.yml
#
export CACHE_PATH="cache/${EXECUTOR_ID}"
export STRATEGY_FILE="strategies/${EXECUTOR_ID}.py"

0 comments on commit 612b9fa

Please sign in to comment.