Skip to content

leuhk/poly-flashloan-bot

 
 

Repository files navigation

Poly Flashloan Bot

An open source flashloan bot on polygon network

Prerequisites

This flashloan bot works with the smart contract.

You need to deploy your own smart contract on polygon mainnet if you want to run this bot.

Installation

1. Install Node.js & yarn, if you haven't already.

2. Clone This Repo

Run the following command.

https://github.com/yuichiroaoki/poly-flashloan-bot.git
cd poly-flashloan-bot

Quickstart

1. Setup Environment Variables

You'll need an ALCHEMY_POLYGON_RPC_URL environment variable. You can get one from Alchemy website for free.

Then, you can create a .env file with the following.

ALCHEMY_POLYGON_RPC_URL='<your-own-alchemy-polygon-mainnet-rpc-url>'

If you want to execute flashloan on the polygon mainnet, you need to add your PRIVATE_KEY environment variable as well, with a private key from your wallet.

PRIVATE_KEY='your-PRIVATE_KEY'

*Note: If using metamask, you'll have to add a 0x to the start of your private key)

2. Install Dependencies

Run the following command.

yarn install

3.Build

yarn build

4. Run Bot

yarn start

Configuration

Edit src/config.ts

If you have deployed your own contract, replace flashloan address to your deployed smart contract address.

flashloan address

export const flashloanAddress = "<your-deployed-contract-address>";

Note: If you update the flashloan smart contract, you need to replace this ABI to the new one.

ABI

This flashloan bot uses an ABI from this flashloan smart contract.

If you update the flashloan smart contract, you need to replace this ABI to the new one.

Docker

source startup.sh

About

Flashloan Bot on Polygon

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.8%
  • Dockerfile 1.7%
  • Shell 1.5%