Retrieve reward
1. Retrieve the position reward list of one pool
Method: sdk.Almm.getEarnedRewards({ pool_id: string position_id: string coin_a: string coin_b: string rewards_token: string[] }: AlmmRewardsParams[] )
Params
pool_id
: The pool object ID.position_id
: Which position you want to querycoin_a
: Coin A type.coin_b
: Coin B type.rewards_token
: A list of coin types of reward tokens ofpool_id
Example
await magmaClmmSDK.Almm.getEarnedRewards([
{
pool_id:
"0x540e56df0e57ac0d779a64d1f9f01fe9ac03d4758623105e05b4f9facc5d0f61",
position_id:
"0xdbc446534c4be4dc3df8a5ddf84b526a1f94366b2e6ef427bf85285a3e55161f",
coin_a:
"0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
coin_b:
"0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS",
rewards_token: [
"0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
],
},
]);
2. Claim reward
Method: sdk.Almm.claimRewards({ pool_id: string coin_a: string coin_b: string position_id: string rewards_token: string[] }: AlmmCollectRewardParams[] )
Params
pool_id
: The pool object ID.coin_a
: Coin A type.coin_b
: Coin B type.position_id
: Which position you want to queryrewards_token
: A list of coin types of reward tokens ofpool_id
Last updated