@portals-fi/galaxy-farmer
v2.1.0
Published
A template for TypeScript projects with pre-configured tooling
Downloads
1
Readme
Galaxy Farmer
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
- Clone the repo
- Install dependencies using
npm install
- Generate typechain interfaces using
npm run typechain:build
- Add a
.env
file to the root of the project with the following variables for RPC node URLs:
MAINNET_URL=
AVALANCHE_URL=
OPTIMISM_URL=
- 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 theMyPlatform
class. The class should implement theIHandler
interface fromsrc/types/base/IHandler.ts
. The class should be decorated with the@Platform
decorator fromsrc/common/decorators/platform.decorator.ts
.__tests__
- This folder should contain a test file for theMyPlatform
class. The test file should be namedMyPlatform.test.ts
and should include meaningful tests for all of the functions in theMyPlatform
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.