Code Monkey home page Code Monkey logo

pancake-cli's Introduction

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

pancake-cli's People

Contributors

felixmohr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.