Skip to content

Backend implementation of NFT (Axie Infinity) Sniper bot as-a-service in Nest.js

License

Notifications You must be signed in to change notification settings

YahyaOukharta/botaxie-backend

Repository files navigation


Botaxie
Axie infinity marketplace bot as a service

NFT (Axie Infinity) Sniper bot as-a-service in Nest.js.

Key FeaturesHow To UseTechnologiesContact and SupportLicense

HitCount

screenshot

Key Features

  • Authetication:
    • Json Web Token (JWT)
  • Fetches and filters recently listed axies
  • Replicates Ronin Wallet's purchase transaction
  • Buys the axie instantly if it matches the user's configuration (See Configurations)
  • Retries to buy a good axie while user wallet has funds available
  • Stops filtering for a user if reached target number of axies or funds were withdrawn
  • Logs all activity and purchase attempts
  • Protected HTTP endpoints for all user activity

How To Use

To clone and run this application, you'll need Git and Node.js (which comes with npm) installed on your computer.

Note : Before running the app, make you sure you made a .env file with valid parameters, see .env.sample

# .env
JWT_SECRET=secret
JWT_EXP=1d
ENCRYPTION_KEY=d85117047fd06d3afa79b6e44ee3a52eb426f
MIN_RON_BALANCE=0.001

From your command line:

# Clone this repository
$ git clone https://github.com/yahyaoukharta/botaxie-backend.git
# Go into the repository
$ cd botaxie-backend
# Install dependencies
$ npm install
# Run the app
$ npm run start:dev

Configurations

Users can specify to the bot which axies they are interested in by creating Configurations, the data type used resembles this :

// /src/types/AxieConfig
interface AxieConfig {
  maxPrice: number;

  minId?: number;
  maxId?: number;

  //Class
  _class?: AxieClass;

  //Min Stats
  minStats?: AxieStats;

  //Breed Count 0-7
  minBreedCount?: number;
  maxBreedCount?: number;

  // Purity 1-6
  minPurity?: number;
  maxPurity?: number;

  //Pureness 0-100 %
  minPureness?: number;
  maxPureness?: number;

  //Potential points
  minPotentialPoints?: PotentialPoints;

  //genes
  eyesD?: BodyPart;
  earsD?: BodyPart;
  backD?: BodyPart;
  mouthD?: BodyPart;
  hornD?: BodyPart;
  tailD?: BodyPart;
  eyesR1?: BodyPart;
  earsR1?: BodyPart;
  backR1?: BodyPart;
  mouthR1?: BodyPart;
  hornR1?: BodyPart;
  tailR1?: BodyPart;
  eyesR2?: BodyPart;
  earsR2?: BodyPart;
  backR2?: BodyPart;
  mouthR2?: BodyPart;
  hornR2?: BodyPart;
  tailR2?: BodyPart;
}

Note : You can notice that only maxPrice is mandatory, but users can use any other filters or leave empty

Instances

After creating a configuration, and having a wallet with enough funds, users can launch instances. When you have an instance running, it means the following :

  • The main bot's cron job will consider the user configuration when filtering the recently listed axies
  • Axies are matched with the oldest instances first
    • If an axie recently listed, and matches with two configurations, Botaxie will give priority to the owner of the oldest instance created: first come, first served.
  • When a config matches with an axie, a purchase attempt is done, the result is logged, and emitted in real time to the user.
  • Instance stop conditions :
    • Not enough funds in the user's wallet.
    • Reached the target amount of axie to buy using that instance.
    • Instance with no purchase for more than 24 hours.

Testing

Test the app's endpoint, by importing the collection /test/backend.postman_collection.json to Postman and running the requests.

Technologies

This app uses the following frameworks and libraries :

Contact and Support

You can always contact me for support via the following channels

LinkedIn Yahya Oukharta

GitHub @yahyaoukharta

Discord @Yhyo#9751

Email youkharta@gmail.com

License

MIT

About

Backend implementation of NFT (Axie Infinity) Sniper bot as-a-service in Nest.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published