Quick Start
This guide details the steps needed to install and initialise the Polysynth SDK for Python.
Good to know: The SDK is composed of two key Python packages: Web3 (A Python library for interacting with Ethereum) and Polysynth (the package implementing the Python SDK itself).


To use Polysynth, you first need to install it and its dependencies.

Install or Update Python

Before installing Polysynth, install Python 3.7.2 or later. For information about how to get the latest version of Python, see the official Python documentation.

Install Polysynth

Install the latest release via pip:
pip install polysynth
If you have a version of polysynth installed already. Please make sure its upgraded to the latest version using:
pip install --upgrade polysynth

Initialising the Polysynth Class

If you want to trade you need to provide your address and private key. If not, you can set them to None. In addition, the Polysynth class takes several optional parameters, as documented in the API Reference.
from polysynth import Polysynth
address = "YOUR WALLET ADDRESS" # or None if you're not going to make transactions
private_key = "YOUR PRIVATE KEY" # or None if you're not going to make transactions
provider = "WEB3 PROVIDER URL" # can also be set through the environment variable `PROVIDER`
polysynth = Polysynth(address=address, private_key=private_key, provider=provider)

Test Tokens

Post initialisation, to be able to trade, you can mint test stable coin tokens using the following command:
Test tokens will be credited to the wallet address used for initialisation.

Environment Variables

The program expects environment variables to be set in order to run the program. You can use an Infura node since the transactions are being signed locally and broadcast as raw transactions. The environment variable is:
PROVIDER # HTTP Provider for web3/RPC url
You can find the RPC url for testnet and mainnet here.

Gas Pricing

To modify the gas pricing strategy you need to pass a custom Web3 instance to the Polysynth constructor. You can find details for how to configure Web3 gas strategies in their documentation.