# Mining

# getLPs

To get pools for liquidity mining

# Code sample:

const mining = new Mining(chainId)
const lps = await mining.getLPs()

# Response:

{
  pools: [
    {
      id: 0,
      title: 'LON/ETH',
      type: 'ETH',
      pool: 'Uniswap',
      poolUrl: 'https://uniswap.token.im/#/add/v2/ETH/0x0712629ced85a3a62e5bca96303b8fdd06cbf8dd',
      stakingRewardsAddress: '0xc0B303EbEe61E6e83c7952415A31dE74B2D2ef75',
      lpTokenAddress: '0xBd9f40acA981083890CF7E79838F9bF097F32992',
      totalRewardAmount: '1500000000000000000000000',
      endTimestamp: 1608553800,
      closed: true,
      rewardToken: '',
      rewardTokenAmount: ''
    },
    ...
  ],
  endTimestamp: 1639022400
}

# getMiningRewards

To get mining rewards

# Code sample:

const mining = new Mining(chainId)
const rewards = await mining.getMiningRewards()

# Response:

{
  currentPhase: 9,
  pools: [
    {
      lon: '15000000000000000000000000',
      phase: 0,
      startedAt: 1601078400,
      closedAt: 1608422400,
      powers: [Object],
      distribution: null
    },
    {
      lon: '275748173356703051573645',
      phase: 1,
      startedAt: 1617246000,
      closedAt: 1618618080,
      powers: [Object],
      distribution: [Object]
    },
    ...
  ]
}

# getMyMiningData

To get mining data

# Parameters:

Name Type
address string

# Code sample:

const address = await ethers.provider.getSigner().getAddress()
const mining = new Mining(chainId)
const miningData = await mining.getMyMiningData(address)

# Response:

{
  activateInvitations: 0,
  code: '',
  currentPhase: 9,
  invitations: 0,
  myReferralPower: 0,
  myTradePower: 0,
  myTradeVolume: 0,
  referralPower: 0,
  tradePower: 0,
  tradeVolume: 0,
  wallet: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
}

# getRoundTradeMining

To get round trade mining data

# Parameters:

Name Type
address string

# Code sample:

const address = await ethers.provider.getSigner().getAddress()
const mining = new Mining(chainId)
const roundMining = await mining.getRoundTradeMining(address)

# Response:

[
  ...
  {
    audited: true,
    claim: {},
    endAt: 1618618080,
    grantTime: 1618618080,
    issued: true,
    lon: '0',
    phase: 1,
    referralStats: {
      activateInvitations: 0,
      lon: '0',
      myReferralPower: '0',
      referralPower: '209.186803',
    },
    settled: true,
    tradeStats: {
      lon: '0',
      myTradePower: '0',
      myTradeVolume: '0',
      tradePower: '1317.902256',
    },
  },
  {
    audited: true,
    claim: {},
    endAt: 1608768000,
    grantTime: 1608768000,
    issued: true,
    lon: '0',
    phase: 0,
    referralStats: {
      activateInvitations: 0,
      lon: '0',
      myReferralPower: '0',
      referralPower: '1003.906165',
    },
    settled: true,
    tradeStats: {
      lon: '0',
      myTradePower: '0',
      myTradeVolume: '0',
      tradePower: '3447.658675',
    }
  }
]

# getTokenPriceRate

To get exchange rate with a selling amount

# Parameters:

Name Type
base string
quote string
baseAmount number

# Code sample:

const mining = new Mining(chainId)
const rate = await mining.getTokenPriceRate({
  base: 'USDT',
  quote: 'LON',
  baseAmount: 0.000001,
})

# Response:

{ marketName: 'blockcc', price: 0.4684059249419539 }