Code Monkey home page Code Monkey logo

1inch_swap's Introduction

1inch_swap

1inch.io Swap API using PYTHON on BSC (Binance Smart Chain)

This bot can be used to swap from One Crypto Asset to Another using 1inch Exchange and BSC (Binance Smart Chain Route)
Arbitrage Can be done using this api and further rules to set slippage and margin
Instead of using Private Key, a local mainnet can be attached to Metamask for Transaction Approval which can lead to lesser fees

Requirements

  1. pip install web3
  2. pip install --force-reinstall jsonschema==3.2.0
  3. pip install websocket-client

Paramters Explaination for swap

  1. fromTokenAddress : Contract Address of Token to swap FROM
  2. toTokenAddress : Contract Address of Token to swap TO
  3. withdrawAccount : Withdrawal Wallet Address
  4. destReceiver : Wallet address to receive the assets in ( Leave Blank if Withdraw Account is Same as Receiver )
  5. private_key : Private key of the Withdraw Wallet
  6. slippage : slippage % in int
  7. gasLimit : gas limit of to spend on transaction
  8. amount : Amount of asset to Swap
  9. gasPrice : Gas price to spend on transaction

Example Swap 1 BNB to USDT

  1. fromTokenAddress = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
  2. toTokenAddress = 0x55d398326f99059ff775485246999027b3197955
  3. withdrawAccount = "0xF15f243bb5xxxxxxxxxxxxxxxxxxxxxxxxxxx"
  4. destReceiver = 0xF15f243bb5xxxxxxxxxxxxxxxxxxxxxxxxxxx
  5. private_key = "18xxxxxxxb4325xxxxxxx8c9e4axxxxxxxc0b5c1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  6. slippage = 5
  7. gasLimit = 10000000
  8. amount = 1
  9. gasPrice = 5000000000

Parameters of binance_price_tracker.py

  1. pair : Pair u want to track, example BNB to USDT so pair will be bnbusdt # List of pairs available on binance api documentation

For any queries email or raise a issue

1inch_swap's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

1inch_swap's Issues

Question about functionality

Doubt about the functionality if I can use it within Pancakeswap, to exchange tokens, an example has a token that has 0% taxes I can use the arbitration robot to make the movement, it would be the exchange of the token for BNB and the BNB for token.

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.