0.0.86 • Published 2 months ago

@ichidao/ichi-vaults-sdk v0.0.86

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Ichivaults Logo

@ichidao/ichi-vaults-sdk

MIT License

This sdk contains collection of functions to interact with IchiVault's smart contract.

Table of Contents

Installation

Install with

yarn add @ichidao/ichi-vaults-sdk

or

npm install @ichidao/ichi-vaults-sdk

Usage

Subgraphs

This SDK uses subgraphs to obtain information about ICHI vaults. The subgraphs are deployed in the Subgraph Studio and published on Arbitrum One. If you prefer to use published subgraphs, you need to add your subgraph API key to the SUBGRAPH_API_KEY environment variable. Otherwise, the SDK will use the subgraph's Studio endpoint.

Vault

1. approveDepositToken()

paramtypedefaultrequired
accountAddressstring-true
tokenIdx0 | 1-true
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
amountstring | number | BigNumberundefinedfalse
overridesOverridesundefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { approveDepositToken, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const accountAddress = "0xaaaa...aaaaaa"
const amount = 100
const dex = SupportedDex.UniswapV3

const txnDetails = await approveDepositToken(
    accountAddress,
    0, // token idx can be 0 or 1
    vaultAddress,
    web3Provider,
    dex,
    amount // (optional)
);

await txnDetails.wait();

// can now deposit token0
// ...

2. deposit()

paramtypedefaultrequired
accountAddressstring-true
amount0string | number | BigNumber-true
amount1string | number | BigNumber-true
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
percentSlippagenumber1false
overridesOverridesundefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { deposit, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const dex = SupportedDex.UniswapV3
const accountAddress = "0xaaaa...aaaaaa"

const amount0 = 100
const amount1 = 0

const txnDetails = await deposit(
    accountAddress,
    amount0, // can be 0 when only depositing amount1
    amount1, // can be 0 when only depositing amount0
    vaultAddress,
    web3Provider,
    dex,
    1 // acceptable slippage (percents)
)

3. depositNativeToken()

paramtypedefaultrequired
accountAddressstring-true
amount0string | number | BigNumber-true
amount1string | number | BigNumber-true
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
percentSlippagenumber1false
overridesOverridesundefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { deposit, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const dex = SupportedDex.UniswapV3
const accountAddress = "0xaaaa...aaaaaa"

const amount0 = 100
const amount1 = 0

const txnDetails = await depositNativeToken(
    accountAddress,
    amount0, // can be 0 when only depositing amount1
    amount1, // can be 0 when only depositing amount0
    vaultAddress,
    web3Provider,
    dex,
    1 // acceptable slippage (percents)
)

4. approveVaultToken()

paramtypedefaultrequired
accountAddressstring-true
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
sharesstring | number | BigNumberundefinedfalse
overridesOverridesundefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { approveVaultToken, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const accountAddress = "0xaaaa...aaaaaa"
const amount = 100
const dex = SupportedDex.UniswapV3

const txnDetails = await approveVaultToken(
    accountAddress,
    vaultAddress,
    web3Provider,
    dex,
    amount // (optional)
);

await txnDetails.wait();

// can now deposit token0
// ...

5. isVaultTokenApproved()

paramtypedefaultrequired
accountAddressstring-true
sharesstring | number | BigNumber,-true
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
import { Web3Provider } from '@ethersproject/providers';
import { isVaultTokenApproved, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const accountAddress = "0xaaaa...aaaaaa"
const amount = 100
const dex = SupportedDex.UniswapV3

const isApproved: boolean = await isVaultTokenApproved(
    accountAddress,
    amount,
    vaultAddress,
    web3Provider,
    dex
)

6. withdraw()

paramtypedefaultrequired
accountAddressstring-true
sharesstring | number | BigNumber-true
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
overridesOverridesundefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { getUserBalance, withdraw, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const dex = SupportedDex.UniswapV3
const accountAddress = "0xaaaa...aaaaaa"

const totalUserShares: string = await getUserBalance(
    accountAddress,
    vaultAddress,
    web3Provider,
    dex,
)

let shares = Number(totalUserShare) * 0.5 // 50% of user deshare balance

const txnDetails = await withdraw(
    accountAddress,
    shares,
    vaultAddress,
    web3Provider,
    dex
)

7. withdrawWithSlippage()

paramtypedefaultrequired
accountAddressstring-true
sharesstring | number | BigNumber-true
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
percentSlippagenumber1false
overridesOverridesundefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { getUserBalance, withdraw, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const dex = SupportedDex.UniswapV3
const accountAddress = "0xaaaa...aaaaaa"

const totalUserShares: string = await getUserBalance(
    accountAddress,
    vaultAddress,
    web3Provider,
    dex,
)

let shares = Number(totalUserShare) * 0.5 // 50% of user deshare balance

const txnDetails = await withdraw(
    accountAddress,
    shares,
    vaultAddress,
    web3Provider,
    dex
)

8. withdrawNativeToken()

paramtypedefaultrequired
accountAddressstring-true
sharesstring | number | BigNumber-true
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
percentSlippagenumber1false
overridesOverridesundefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { getUserBalance, withdraw, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const dex = SupportedDex.UniswapV3
const accountAddress = "0xaaaa...aaaaaa"

const totalUserShares: string = await getUserBalance(
    accountAddress,
    vaultAddress,
    web3Provider,
    dex
)

let shares = Number(totalUserShare) * 0.5 // 50% of user deshare balance

const txnDetails = await withdraw(
    accountAddress,
    shares,
    vaultAddress,
    web3Provider,
    dex
)

9. isDepositTokenApproved()

paramtypedefaultrequired
accountAddressstring-true
tokenIdx0 | 1-true
amountstring | number,-true
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
import { Web3Provider } from '@ethersproject/providers';
import { isDepositTokenApproved, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const accountAddress = "0xaaaa...aaaaaa"
const amount = '10.5'
const dex = SupportedDex.UniswapV3

const isToken0Approved: boolean = await isDepositTokenApproved(
    accountAddress,
    0, // token idx can be 0 or 1
    amount,
    vaultAddress,
    web3Provider,
    dex
)

10. isTokenAllowed()

paramtypedefaultrequired
tokenIdx0 | 1-true
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
import { Web3Provider } from '@ethersproject/providers';
import { isTokenAllowed, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const dex = SupportedDex.UniswapV3

const isAllowed = await isTokenAllowed(
    0, // token idx can be 0 or 1
    vaultAddress,
    web3Provider,
    dex
)

11. getMaxDepositAmount()

paramtypedefaultrequired
tokenIdx0 | 1-true
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
import { Web3Provider } from '@ethersproject/providers';
import { getMaxDepositAmount, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const dex = SupportedDex.UniswapV3

const maxAmount = await getMaxDepositAmount(
    0, // token idx can be 0 or 1
    vaultAddress,
    web3Provider,
    dex
)

12. getUserBalance()

paramtypedefaultrequired
accountAddressstring-true
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
rawtrueundefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { getUserBalance, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const dex = SupportedDex.UniswapV3
const accountAddress = "0xaaaa...aaaaaa"

const shares: string = await getUserBalance(
    accountAddress,
    vaultAddress,
    web3Provider,
    dex
)

// - or -

const sharesBN: BigNumber = await getUserBalance(
    accountAddress,
    vaultAddress,
    web3Provider,
    dex,
    true
)

13. getUserAmounts()

paramtypedefaultrequired
accountAddressstring-true
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
rawtrueundefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { getUserAmounts, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const dex = SupportedDex.UniswapV3
const accountAddress = "0xaaaa...aaaaaa"

const amounts: [string, string] & {amount0: string, amount1: string} = await getUserAmounts(
    accountAddress,
    vaultAddress,
    web3Provider,
    dex
)

// - or -

const amountsBN: [BigNumber, BigNumber] & {amount0: BigNumber, amount1: BigNumber} = await getUserAmounts(
    accountAddress,
    vaultAddress,
    web3Provider,
    dex,
    true
)

14. getAllUserBalances()

paramtypedefaultrequired
accountAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
rawtrueundefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { getAllUserBalances, SupportedDex, UserBalanceInVault, UserBalanceInVaultBN } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const dex = SupportedDex.UniswapV3
const accountAddress = "0xaaaa...aaaaaa"

const userBalancesInVaults: UserBalanceInVault[] = await getAllUserBalances(
    accountAddress,
    web3Provider,
    dex
)

// - or -

const userBalancesInVaultsBN: UserBalanceInVaultBN[] = await getAllUserBalances(
    accountAddress,
    web3Provider,
    dex,
    true
)

15. getAllUserAmounts()

paramtypedefaultrequired
accountAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
rawtrueundefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { getAllUserAmounts, SupportedDex, UserAmountsInVault, UserAmountsInVaultBN } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const dex = SupportedDex.UniswapV3
const accountAddress = "0xaaaa...aaaaaa"

const amounts: UserAmountsInVault[] = await getAllUserAmounts(
    accountAddress,
    web3Provider,
    dex,
)

// - or -

const amountsBN: UserAmountsInVaultBN[] = await getAllUserAmounts(
    accountAddress,
    web3Provider,
    dex,
    true
)

16. getTotalSupply()

paramtypedefaultrequired
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
rawtrueundefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { getTotalSupply, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const dex = SupportedDex.UniswapV3

const shares: string = await getTotalSupply(
    accountAddress,
    vaultAddress,
    web3Provider,
    dex
)

// - or -

const sharesBN: BigNumber = await getTotalSupply(
    accountAddress,
    vaultAddress,
    web3Provider,
    dex,
    true
)

17. getTotalAmounts()

paramtypedefaultrequired
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
rawtrueundefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { getTotalAmounts, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132"
const dex = SupportedDex.UniswapV3
const accountAddress = "0xaaaa...aaaaaa"

const amounts: [string, string] & {total0: string, total1: string} = await getTotalAmounts(
    accountAddress,
    vaultAddress,
    web3Provider,
    dex
)

// - or -

const amountsBN: [BigNumber, BigNumber] & {total0: BigNumber, total1: BigNumber} = await getTotalAmounts(
    accountAddress,
    vaultAddress,
    web3Provider,
    dex,
    true
)

18. getFeesCollected()

paramtypedefaultrequired
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
rawOrDaystrue or numberundefinedfalse
daysnumberundefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { getFeesCollected, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132";
const dex = SupportedDex.UniswapV3;
const days = 7;

const amounts: [string, string] & {total0: string, total1: string} = await getFeesCollected(
    vaultAddress,
    web3Provider,
    dex
)

// - or -

const amountsBN: [BigNumber, BigNumber] & {total0: BigNumber, total1: BigNumber} = await getFeesCollected(
    vaultAddress,
    web3Provider,
    dex,
    true
)

// - or -

const amounts: [string, string] & {total0: string, total1: string} = await getFeesCollected(
    vaultAddress,
    web3Provider,
    dex,
    days
)

// - or -

const amountsBN: [BigNumber, BigNumber] & {total0: BigNumber, total1: BigNumber} = await getFeesCollected(
    vaultAddress,
    web3Provider,
    dex,
    true,
    days
)

19. getFeesCollectedInfo()

paramtypedefaultrequired
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
forDaysnumber[]undefinedfalse
import { Web3Provider } from '@ethersproject/providers';
import { getFeesCollectedInfo, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132";
const dex = SupportedDex.UniswapV3;
const days = [2, 5, 14, 60];

const feesInfo: FeesInfo[] = await getFeesCollectedInfo(
    vaultAddress,
    web3Provider,
    dex
)

// - or -

const feesInfo: FeesInfo[] = await getFeesCollectedInfo(
    vaultAddress,
    web3Provider,
    dex,
    days
)

20. getAverageDepositTokenRatios()

paramtypedefaultrequired
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
timeIntervalsnumber[]1, 7, 30false
import { Web3Provider } from '@ethersproject/providers';
import { getFeesCollectedInfo, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132";
const dex = SupportedDex.UniswapV3;
const days = [2, 5, 14, 60];

const averageDtr: AverageDepositTokenRatio[] = await getAverageDepositTokenRatios(
    vaultAddress,
    web3Provider,
    dex
)

// - or -

const averageDtr: AverageDepositTokenRatio[] = await getAverageDepositTokenRatios(
    vaultAddress,
    web3Provider,
    dex,
    days
)

21. getLpApr()

paramtypedefaultrequired
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
timeIntervalsnumber[]1, 7, 30false
import { Web3Provider } from '@ethersproject/providers';
import { getLpApr, SupportedDex, VaultApr } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132";
const dex = SupportedDex.UniswapV3;
const days = [2, 5, 14, 60];

const averageDtr: VaultApr[] = await getLpApr(
    vaultAddress,
    web3Provider,
    dex
)

// - or -

const averageDtr: VaultApr[] = await getLpApr(
    vaultAddress,
    web3Provider,
    dex,
    days
)

22. getLpPriceChange()

paramtypedefaultrequired
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
timeIntervalsnumber[]1, 7, 30false
import { Web3Provider } from '@ethersproject/providers';
import { getLpPriceChange, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132";
const dex = SupportedDex.UniswapV3;
const days = [2, 5, 14, 60];

const lpPriceChange: PriceChange[] = await getLpPriceChange(
    vaultAddress,
    web3Provider,
    dex
)

// - or -

const lpPriceChange: PriceChange[] = await getLpPriceChange(
    vaultAddress,
    web3Provider,
    dex,
    days
)

23. getVaultMetrics()

paramtypedefaultrequired
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
timeIntervalsnumber[]1, 7, 30false
import { Web3Provider } from '@ethersproject/providers';
import { getVaultMetrics, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132";
const dex = SupportedDex.UniswapV3;
const days = [2, 5, 14, 60];

const vaultMetrics: VaultMetrics[] = await getVaultMetrics(
    vaultAddress,
    web3Provider,
    dex
)

// - or -

const vaultMetrics: VaultMetrics[] = await getVaultMetrics(
    vaultAddress,
    web3Provider,
    dex,
    days
)

24. getIchiVaultInfo()

paramtypedefaultrequired
chainSupportedChain-true
dexSupportedDex-true
vaultAddressstring-true
jsonProviderJsonRpcProvider-false
import { Web3Provider } from '@ethersproject/providers';
import { getIchiVaultInfo, SupportedDex, SupportedChain, IchiVault } from '@ichidao/ichi-vaults-sdk';

const vaultAddress = "0x3ac9...a5f132"
const dex = SupportedDex.UniswapV3;
const chain = SupportedChain.Polygon;

const vaultInfo = await getIchiVaultInfo(chain, dex, vaultAddress);
if (vaultInfo) {
    const addressTokenA = vaultInfo.tokenA;
}

25. getVaultsByTokens()

paramtypedefaultrequired
chainSupportedChain-true
dexSupportedDex-true
depositTokenAddressstring-true
pairedTokenAddressstring-true
import { Web3Provider } from '@ethersproject/providers';
import { getVaultsByTokens, SupportedDex, SupportedChain, IchiVault } from '@ichidao/ichi-vaults-sdk';

const depositToken = "0x1b...bfd6"
const pairedToken = "0x11...c4d6"
const dex = SupportedDex.UniswapV3;
const chain = SupportedChain.Polygon;

const vaults = await getVaultsByTokens(chain, dex, depositToken, pairedToken)
if (vaults.length === 0) {
    console.log("Couldn't find vaults with these parameters")
} else {
    const vaultAddress = vaults[0].id;
}

26. getVaultsByPool()

paramtypedefaultrequired
poolAddressstring-true
chainSupportedChainId-true
dexSupportedDex-true
import { Web3Provider } from '@ethersproject/providers';
import { getVaultsByPool, SupportedDex, SupportedChainId } from '@ichidao/ichi-vaults-sdk';

const poolAddress = "0x1b...2fd6"
const dex = SupportedDex.UniswapV3;
const chain = SupportedChainId.Polygon;

const vaults = await getVaultsByPool(poolAddress, chain, dex)
if (vaults.length === 0) {
    console.log("Couldn't find vaults with these parameters")
} else {
    const vaultAddress = vaults[0].vault;
}

27. getVaultPositions()

paramtypedefaultrequired
vaultAddressstring-true
jsonProviderJsonRpcProvider-true
dexSupportedDex-true
import { Web3Provider } from '@ethersproject/providers';
import { getVaultPositions, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
const vaultAddress = "0x3ac9...a5f132";
const dex = SupportedDex.UniswapV3;

const vaultPositions: VaultPositionsInfo = await getVaultPositions(
    vaultAddress,
    web3Provider,
    dex
);
const currentTick = vaultPositions.currentTick;

28. getSupportedDexes()

paramtypedefaultrequired
chainIdSupportedChainId-true
import { getSupportedDexes, SupportedChainId, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const chainId = SupportedChainId.polygon;

const dexes: SupportedDex[] = getSupportedDexes(chainId);

29. getChainsForDex()

paramtypedefaultrequired
dexSupportedDex-true
import { getChainsForDex, SupportedChainId, SupportedDex } from '@ichidao/ichi-vaults-sdk';

const dex = SupportedChainId.UniswapV3;

const chains: SupportedChainId[] = getChainsForDex(dex);

Types

SupportedChainId

enum SupportedChainId {
  arbitrum = 42161,
  arthera = 10242,
  arthera_testnet = 10243,
  base = 8453,
  berachain = 80084,
  blast = 81457,
  blast_sepolia_testnet = 168587773,
  bsc = 56,
  celo = 42220,
  eon = 7332,
  evmos = 9001,
  fantom = 250,
  flare = 14,
  fuse = 122,
  haven1_devnet = 8110,
  hedera = 295,
  hedera_testnet = 296,
  kava = 2222,
  linea = 59144,
  mainnet = 1,
  mantle = 5000,
  mode = 34443,
  polygon = 137,
  polygon_zkevm = 1101,
  real = 111188,
  rootstock = 30,
  scroll = 534352,
  skale_europa = 2046399126,
  taiko = 167000,
  taiko_hekla = 167009,
  unreal = 18233,
  x_layer_testnet = 195,
  zircuit = 48900,
  zksync_era = 324,
  zksync_era_testnet = 280,
}

SupportedDex

enum SupportedDex {
  Agni = 'Agni',
  Ascent = 'Ascent',
  Blueprint = 'Blueprint',
  Cleo = 'Cleo',
  Crust = 'Crust',
  Equalizer = 'Equalizer',
  Fenix = 'Fenix',
  Forge = 'Forge',
  Haven1 = 'Haven1',
  Henjin = 'Henjin',
  Kim = 'Kim',
  Kinetix = 'Kinetix',
  Kodiak = 'Kodiak',
  Linehub = 'Linehub',
  Lynex = 'Lynex',
  Metavault = 'Metavault',
  Nile = 'Nile',
  Ocelex = 'Ocelex',
  Pancakeswap = 'PancakeSwap',
  Pearl = 'Pearl',
  Quickswap = 'QuickSwap',
  Ramses = 'Ramses',
  Retro = 'Retro',
  SaucerSwap = 'SaucerSwap',
  SparkDex = 'SparkDex',
  SparkDexV1 = 'SparkDexV1',
  SpiritSwap = 'SpiritSwap',
  Sushiswap = 'SushiSwap',
  Thena = 'Thena',
  Thirdfy = 'Thirdfy',
  Thruster = 'Thruster',
  Ubeswap = 'Ubeswap',
  UniswapV3 = 'Uniswap V3',
  Velocore = 'Velocore',
  Voltage = 'Voltage',
  XSwap = 'XSwap',
}

IchiVault

interface IchiVault {
  id: string; // vault address
  tokenA: string; // token0 address
  tokenB: string; // token1 address
  allowTokenA: boolean;
  allowTokenB: boolean;
  holdersCount?: string // number of vault LP holders
  fee?: string
}

FeesInfo

type FeesInfo  = {
  timePeriod: number; // in days
  feeAmount0: string; // in token0
  feeAmount1: string; // in token1
  pctAPR: number; // yearly APR based on the timePeriod
}

AverageDepositTokenRatio

type AverageDepositTokenRatio  = {
  timePeriod: number; // in days
  percent: number;
}

VaultApr

type VaultApr  = {
  timeInterval: number; // in days
  apr: number; // percent
}

PriceChange

type PriceChange  = {
  timeInterval: number; // in days
  priceChange: number; // percent
}

VaultMetrics

type VaultMetrics  = {
  timeInterval: number; // in days
  lpPriceChange: number | null;
  lpApr: number | null; // percent
  avgDtr: number;
  feeApr: number;
}

UserAmountsBN

type UserAmountsBN =
  [BigNumber, BigNumber] & { amount0: BigNumber; amount1: BigNumber };

UserAmounts

type UserAmounts = [string, string] & { amount0: string; amount1: string };

UserAmountsInVault

type UserAmountsInVault = {
  vaultAddress: string;
  userAmounts: UserAmounts;
}

UserAmountsInVaultBN

type UserAmountsInVaultBN = {
  vaultAddress: string;
  userAmounts: UserAmountsBN;
}

UserBalanceInVault

type UserBalanceInVault = {
  vaultAddress: string;
  shares: string;
};

UserBalanceInVaultBN

type UserBalanceInVaultBN = {
  vaultAddress: string;
  shares: BigNumber;
};

VaultPositionsInfo

type VaultPositionsInfo = {
  currentTick: number,
  currentPrice: number,
  positions: {
    tickLower: number,
    tickUpper: number,
    priceLower: number,
    priceUpper: number,
    liquidity: string;
    amountToken0: string;
    amountToken1: string;
    positionTvl: number; // in deposit tokens
  } [],
}
0.0.85

2 months ago

0.0.86

2 months ago

0.0.84

3 months ago

0.0.81

3 months ago

0.0.82

3 months ago

0.0.83

3 months ago

0.0.80

3 months ago

0.0.76

4 months ago

0.0.77

4 months ago

0.0.78

3 months ago

0.0.79

3 months ago

0.0.44

7 months ago

0.0.45

7 months ago

0.0.46

7 months ago

0.0.47

7 months ago

0.0.73

4 months ago

0.0.74

4 months ago

0.0.75

4 months ago

0.0.70

5 months ago

0.0.71

5 months ago

0.0.72

4 months ago

0.0.62

5 months ago

0.0.63

5 months ago

0.0.64

5 months ago

0.0.65

5 months ago

0.0.66

5 months ago

0.0.67

5 months ago

0.0.68

5 months ago

0.0.69

5 months ago

0.0.60

6 months ago

0.0.61

5 months ago

0.0.59

6 months ago

0.0.51

7 months ago

0.0.52

6 months ago

0.0.53

6 months ago

0.0.54

6 months ago

0.0.55

6 months ago

0.0.56

6 months ago

0.0.57

6 months ago

0.0.58

6 months ago

0.0.50

7 months ago

0.0.48

7 months ago

0.0.49

7 months ago

0.0.41

8 months ago

0.0.42

8 months ago

0.0.43

8 months ago

0.0.40

8 months ago

0.0.38

8 months ago

0.0.39

8 months ago

0.0.37

8 months ago

0.0.36

8 months ago

0.0.35

8 months ago

0.0.34

8 months ago

0.0.33

8 months ago

0.0.32

8 months ago

0.0.31

8 months ago

0.0.30

9 months ago

0.0.29

9 months ago

0.0.28

9 months ago

0.0.27

9 months ago

0.0.26

9 months ago

0.0.25

9 months ago

0.0.24

10 months ago

0.0.23

10 months ago

0.0.22

11 months ago

0.0.21

11 months ago

0.0.20

11 months ago

0.0.19

11 months ago

0.0.17

12 months ago

0.0.18

12 months ago

0.0.16

12 months ago

0.0.15

12 months ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago