@portals-fi/galaxy-farmer
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

Galaxy Farmer

unknown

Galaxy Farmer is a guide to farming the galaxy. Through the use of this library you can find the most profitable planets to farm, and the most profitable items to farm on those planets.

Galaxy Farmer provides a single programming interface to implement access any farming opportunity in DeFi. You can use the interface to stake/unstake LP tokens in farms, as well as to claim incentive rewards. You can also use it to aggregate data on the most profitable farms and discover the best farming opportunities.

Setup

  1. Clone the repo
  2. Install dependencies using npm install
  3. Generate typechain interfaces using npm run typechain:build
  4. Add a .env file to the root of the project with the following variables for RPC node URLs:
MAINNET_URL=
AVALANCHE_URL=
OPTIMISM_URL=
  1. Run the test suite using npm run test

Contributing to Galaxy Farmer

Galaxy Farmer is an open source project and we welcome contributions. If you have a favorite project that you would like to see added to Galaxy Farmer, please open an issue or submit a pull request.

Adding a new platform

Create a new folder in the src/platforms directory. The folder should be named after the protocol/platform. For example, if you are adding a new platform called MyPlatform, the folder should be named my-platform.

If the platform is a fork of an existing platform, you can copy the existing platform folder and rename it. For example, if you are adding a new platform called MyPlatform that is a fork of the Aave platform, you can copy the aave folder and rename it to my-platform.

If the farm is a fork of a common farming contract like MasterChef you can extend the class of that contract from src/common/platforms collection of common contracts.

The folder should contain the following:

  • index.ts - This file should export the MyPlatform class. The class should implement the IHandler interface from src/types/base/IHandler.ts. The class should be decorated with the @Platform decorator from src/common/decorators/platform.decorator.ts.
  • __tests__ - This folder should contain a test file for the MyPlatform class. The test file should be named MyPlatform.test.ts and should include meaningful tests for all of the functions in the MyPlatform class.

License

This repository is under the Business Source License 1.1

Disclaimer: Protocols supported by Galaxy Farmer are subject to change. Galaxy Farmer is not responsible for any losses incurred by using this library. Use at your own risk. Integration with Galaxy Farmer is not guaranteed to be bug-free. Galaxy Farmer is not responsible for any bugs in the library. Integration with Galaxy Farmer is not an endorsement of the subsequent protocol or its owners. Projects implemented in this library are risky and should be treated as such.

Readme

Keywords

none

Package Sidebar

Install

npm i @portals-fi/galaxy-farmer

Weekly Downloads

0

Version

2.1.0

License

BUSL-1.1

Unpacked Size

688 kB

Total Files

193

Last publish

Collaborators

  • mrunbanked