For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get reward

1. Get the position reward list of one pool

use SDK.Pool.fetchPositionRewardList() method

Function input params

  • poolID: The pool object ID.

  • coinTypeA: Coin A type.

  • coinTypeB: Coin B type.

Example

async function getRewardListOfOnePool() {
  const poolId = '0x83c101a55563b037f4cd25e5b326b26ae6537dc8048004c1408079f7578dd160'
  const pool = await TestnetSDK.Pool.getPool(poolId)
  const res = await TestnetSDK.Pool.fetchPositionRewardList({
    pool_id: pool.poolAddress,
    coinTypeA: pool.coinTypeA,
    coinTypeB: pool.coinTypeB,
  })
  console.log('retrieva reward list of one pool', res)
}

// getRewardListOfOnePool()
/*
{
    liquidity: '1178890675',
    tick_lower_index: -2,
    tick_upper_index: 2,
    reward_amount_owed_0: '0',
    reward_amount_owed_1: '0',
    reward_amount_owed_2: '0',
    reward_growth_inside_0: '0',
    reward_growth_inside_1: '0',
    reward_growth_inside_2: '0',
    fee_growth_inside_a: '0',
    fee_owed_a: '0',
    fee_growth_inside_b: '0',
    fee_owed_b: '0',
    pos_object_id: '0x88e9779719cdb9d5e722267ca2ddd0681d6c845eadfe4f6e46f9e456b26ad15e'
  },

  ...

  {
    liquidity: '496569205127',
    tick_lower_index: -6,
    tick_upper_index: 4,
    reward_amount_owed_0: '0',
    reward_amount_owed_1: '0',
    reward_amount_owed_2: '0',
    reward_growth_inside_0: '0',
    reward_growth_inside_1: '0',
    reward_growth_inside_2: '0',
    fee_growth_inside_a: '0',
    fee_owed_a: '0',
    fee_growth_inside_b: '0',
    fee_owed_b: '0',
    pos_object_id: '0x004dcb4665475ed18b3327e35cdbd6360ce1028d08bec185bafdbfb57d2ef085'
  }, 
*/

2. Get the daily reward emission info for one pool

use sdk.Rewarder.emissionsEveryDay() method

Function input params

  • poolID: The pool object ID.

Example

3. Get rewards of position

use sdk.Rewarder.betchFetchPositionRewarders() method

Function input params

  • positionIDs: Array of position object IDs.

Example

Last updated