Fork helpers

Uniswap V2

There are a few different helpers for Uni V2 forks but we recommend using uniTvlExport.

const { uniTvlExport } = require('../helper/unknownTokens')
const chain = 'yourChain'
const factory = '0x...' // v2 factory address

module.exports = uniTvlExport(chain, factory)

Uniswap V3

There are a few different helpers for Uni V3 forks but we recommend using uniTvlExport.

const { uniV3Export } = require('../helper/uniswapV3')

module.exports = uniV3Export({
  chainX: { factory: '0x...', fromBlock: 'block when factory contract was deployed' },
  chainY: { factory: '0x...', fromBlock: 'block when factory contract was deployed' },
})

GMX

const { gmxExports } = require('../helper/gmx')

module.exports = {
  bsc: {
    tvl: gmxExports({ vault: '0x...', })
  }
}

Aave

const { aaveExports } = require("../helper/aave")

Compound

const { compoundExports2 } = require("../helper/compound");
module.exports = {
  polygon: compoundExports2({ 
    comptroller: '0x...',
    cether: '0x...', // optional, needed if gas token is used
  }),
};

Liquity

const { getLiquityTvl } = require("../helper/liquity.js")

module.exports = {
  chainX: {
    tvl: getLiquityTvl('0x...'),
  }
}

Balancer V2


const { onChainTvl } = require('../helper/balancer')

module.exports = {
  metis: {
    tvl: onChainTvl('0x...', <startBlock>),
  }
}

Last updated