This guide provides instructions on how to get started with building on Meteora’s DAMM v1 Farming program using the Farming TypeScript SDK.Before you begin, here are some important resources:
Once installed, you can initialize the Farming SDK in your TypeScript/JavaScript project like this:
Copy
Ask AI
import { PoolFarmImpl } from "@meteora-ag/farming-sdk";import { Connection } from "@solana/web3.js";// Connection, Wallet, and AnchorProvider to interact with the networkconst mainnetConnection = new Connection("https://api.mainnet-beta.solana.com");const farmingPools = await PoolFarmImpl.getFarmAddressesByPoolAddress( USDC_acUSDC_POOL);// farmingPools is an array (A pool can have multiple farms)const farmingPool = farmingPools[0];const farm = await PoolFarmImpl.create( mainnetConnection, farmingPool.farmAddress);
You can also get the pool with farm address from the DAMM v1 Pool With Farms endpoint.