We are excited to announce the release of a rudimentary liquidity-providing script for BasicSwap DEX. This user-friendly script enables you to offer liquidity for your preferred trading pairs and set a markup above or below the market price that lets you benefit from arbitrage opportunities.
Furthermore, the script is designed to automatically republish your offers when they expire, adhering to your predefined pricing strategy. This ensures that your offers consistently reflect the current market rate, plus any additional premium you have chosen to apply.
Note: While this is currently made available as a companion script, we anticipate that many of its features will eventually be integrated into BasicSwap's core functionality.
How to Get Started
To get started, simply update your BasicSwap DEX instance. The script is included in the basicswap/scripts
folder.
- How to update BasicSwap DEX (Academy): https://academy.particl.io/en/latest/basicswap-guides/basicswapguides_update.html
- How to update BasicSwap DEX (Youtube): https://youtu.be/kk3FtE_TKBQ
To run the script, you’ll need to first edit the JSON template configuration file (template_createoffers.json
) included with the update to your liking, then rename it to createoffers.json
. You can find the instructions on how to properly edit that file, as well as all possible variables, here on the Particl Academy.
Once that’s done, simply run the script with the command python createoffers.py
.
Note: The script needs to run continuously to be take effect. Closing the terminal tab that runs it will terminate it.
For this reason, we recommend executing the script using Byobu or Screen.
Considerations and Recommendations
- For the script to correctly republish orders and update prices, it must keep on running. Starting to script and then closing the terminal tab will shut it down. As such, we recommend running it with a background task processor, such as Byobu or Screen for example.
- This script is best used in combination with a cloud-based version of BasicSwap. When combined with a VPS setup, you can then ensure that both your BasicSwap node and your script keep running 24/7, offering a true hands-off approach to liquidity provision. Follow this link for a complete video tutorial on how to setup BasicSwap DEX on a cloud.
- Be mindful that, once a swap completes, your offers are not taken off of the order book. As such, it might not be ideal to set your offers as “auto-accept” if you only intend on making one swap. We have a couple of solutions to give the options to limit the number of swaps per order which will come at a later stage, but for now, it’s important to be aware of this behaviour.
- Be careful about your configuration file’s formatting. JSON requires you to keep the exact same indentations and logic, so watch out when editing the file.
- The script defaults to using adaptor signatures, which will cause issues if you’re using a non-Segwit coin on the offering side (i.e., Firo, PIVX). In those cases, make sure to configure the pair to use secret hash swaps by putting
"swap_type": "secret_hash"
in the configuration file. - If you use the production (isolated) docker setup, you can bundle the script with your BasicSwap launch sequence by adding it to your docker-compose configuration file (https://github.com/tecnovert/basicswap/blob/master/docker/production/compose-fragments/8_script.yml).
Become a Liquidity Provider!
Liquidity is fundamental to order book based exchanges, which is why we need your assistance. The first version of this liquidity-providing script makes it simpler than ever to offer liquidity without fees, contributing to BasicSwap's success and making swaps that respect our privacy a more viable option for all.
We appreciate all of your help and thank you for your unwavering support in this vital mission for our privacy and liberties!
The Open-Source Revolution
We're on a mission to create a private, independent, and pro-liberty digital economy that is fair and open to all. Learn more about what we do at any of the following links.
Be a part of the movement and join us in the fight for our freedoms by meeting the community and spreading the word far and wide!
Discord Telegram Element / Matrix
Learn more about Particl with these in-depth resources.
Website BasicSwap DEX Academy Wiki
Follow the link below to get a list of all other useful Particl-related links you may find helpful.