This Python code implements a simple Automate Market Maker (AMM) strategy for backpack.exchange. The strategy involves opening both Bid and Ask orders from the mid price to facilitate trading.
The AMM strategy follows these steps:
- Calculate the mid price by averaging the Bid and Ask prices.
- Determine the spread percentage (e.g., 1% or 2%) to set the Bid and Ask prices.
- Open Bid orders slightly below the mid price and Ask orders slightly above the mid price.
- Refresh order in every specific seconds (e.g., 15 seconds).
- Open the account on backpack.exchange Link to Backpack with Affiliate - little tip to dev
- Create API Key from Settings page in backpack, Please note API_KEY and API_SECRET you may use in next section
- Install Python 3 on your computer
- Clone this repository
git clone https://github.com/tanutcho/backpack-amm-bot.git
- Edit
sample.env
file to your API_KEY and API_SECRET from (2) - Rename
sample.env
to.env
- Install dependency and run backpack.py script
pip install python-dotenv
python backpack.py
Warning: Experimental Use Only
Love this code? Buy me a coffee
_ Solana Address:_ 4pPe7iUZikn4C8miw8C3WLQvyy6YZ24qWnvw52U7nHYP