Skip to content

FelixMohr/pancake-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pancake-cli

License

This CLI can perform Pancakeswap trades for you.

Installation

  1. Create virtual environment: python -m venv venv
  2. . venv/bin/activate
  3. pip install -r requirements.txt

Using it

Set the environment variables:

  • PRIVATE_KEY private key of your wallet to trade with
  • WS_URL URL of web3 provider websocket (like Quicknode or Ankr)
  • PAIR_CONTRACT a Pancakeswap pair contract, e.g. 0x4Cb29498595A733c4B0d710E766BB89345eE945b

Then execute the following commands:

  1. . venv/bin/activate (if not done yet)
  2. python cli.py will start the CLI

Commands

  • amount [AMOUNT]: Set the amount to buy to AMOUNT BUSD
  • balance: Shows your balance of the target token and of BUSD
  • approve: Approves the Pancakeswap pair contract to spend your target token
  • approve BUSD: Approves the Pancakeswap pair contract to spend your BUSD
  • allowance: Shows if the Pancakeswap pair can spend your target token
  • allowance BUSD: Shows if the Pancakeswap pair can spend your BUSD
  • gas [GAS]: Set the gas price for swaps to GAS
  • slippage [SLIPPAGE]: Set the slippage for swaps to SLIPPAGE percent
  • sell-percentage [PERCENTAGE]: Sets the amount of target token to be sold to PERCENTAGE percent of its total amount at the time this command is executed. I.e. if you don' have the token when executing this command, the amount to be sold will remain "0" always.
  • sell-amount [AMOUNT]: Sets the amount to sell of target token to AMOUNT
  • buy: Perform buy transaction
  • sell: Perform sale transaction

Releases

No releases published

Packages

No packages published

Languages