Skip to main content
Track DAMM v1 farming releases here.
Program deprecation
The farming crate stays at 0.2.2. The deprecation is in reward-pool-internal #3, which is open. @mercurial-finance/farming-sdk@1.1.0 is the version in that pull request. npm still publishes @meteora-ag/farming-sdk@1.0.18 and @mercurial-finance/farming-sdk@1.0.18.
Breaking release. initialize_pool, create_user, deposit, fund, authorize_funder, deauthorize_funder, toggle_permission, unpause, and migrate_farming_rate fail with Deprecated (6012). Stakers exit with withdraw, claim, and close_user.

Release summary

The SDK package name in this pull request is @mercurial-finance/farming-sdk. The farming guides install @meteora-ag/farming-sdk.

What We Shipped

  • Deprecated new farms, new user accounts, new stakes, and reward funding
  • Left withdraw, claim, and close_user as the staker exit
  • Left pause, withdraw_extra_token, and close_pool for the pool authority after the reward period
  • Added closeUser to the TypeScript SDK

What To Do

IntegratorsWhat ChangedWhat To Do
Partners
  • initialize_pool, fund, authorize_funder, deauthorize_funder, toggle_permission, unpause, and migrate_farming_rate fail with Deprecated (6012).
  • pause still runs after reward_duration_end. unpause fails, so a pause stays in place.
  • close_pool requires the pool to be paused, the reward period to have ended, user_stake_count == 0, and staking_vault.amount == 0.
  • Stop creating farms and stop funding rewards.
  • Leave funded rewards in place until reward_duration_end. Stakers claim through that time.
  • After the reward period, pause the pool, withdraw_extra_token for any stake tokens above total_staked, wait until every user account is closed, then close_pool.
  • Skip migrate_farming_rate. get_reward_a_rate and get_reward_b_rate read the u128 rate, and read the legacy u64 rate when the u128 rate is zero.

Program: farming 0.2.2

Program ID (mainnet and devnet): FarmuwXPWXvefWUeqFAa5w6rifLkq5X6E8bimYvrhCB1Program PR #3

Changed

  • Upgrade to Anchor 1.2.1. The program is built for SBPF v3. Single-reward pools still pass one token account for reward A and reward B. Those accounts are marked dup so Anchor 1.2 accepts the duplicate mutable account.
  • Funded pools keep distributing rewards until reward_duration_end. fund no longer extends that time.
  • withdraw, claim, close_user, pause, withdraw_extra_token, and close_pool keep working. pause still requires reward_duration_end > 0 and a current time after reward_duration_end.
  • close_user still requires balance_staked == 0, reward_a_per_token_pending == 0, and reward_b_per_token_pending == 0. It decreases user_stake_count by 1 and returns the rent to the owner.
  • close_pool still requires paused, reward_duration_end > 0, a current time after reward_duration_end, user_stake_count == 0, and an empty staking vault. The authority signs. Remaining reward vault balances go to the refundee token accounts, and the vaults and pool account are closed.

Deprecated

  • initialize_pool, create_user, deposit, fund, authorize_funder, deauthorize_funder, toggle_permission, unpause, and migrate_farming_rate always fail with Deprecated (6012). Their accounts and instruction data are unchanged.
  • migrate_farming_rate is unused. Pool::get_reward_a_rate and Pool::get_reward_b_rate return reward_*_rate_u128, or _reward_*_rate when the u128 rate is zero.
Stop creating farms. Do not fund a farming pool, and do not stake LP into one.

TypeScript SDK: @mercurial-finance/farming-sdk 1.1.0

SDK PR #3
@mercurial-finance/farming-sdk@1.1.0 is the version in PR #3. It is not on npm yet. The published packages are @meteora-ag/farming-sdk@1.0.18 and @mercurial-finance/farming-sdk@1.0.18.

Added

  • closeUser. Closes the user account and returns its rent to the owner. The program allows it once nothing is staked and no reward is pending.
  • Re-exports the farming IDL and constants from the package entrypoint.

Deprecated

  • deposit. The method still builds a transaction. The program rejects deposit, and create_user when the user account is missing, with Deprecated (6012). Exit with withdraw, claim, and closeUser.

Changed

  • The exit is one transaction: withdraw the full balance when it is above zero, then claim when there is a reward or a stake was withdrawn, then closeUser. When the staking mint is also a reward mint, withdraw and claim can both create that token account. Keep one of those create instructions.
  • getUserBalance throws when the wallet has no user account in the farm.