UNPKG

@cryptoalgebra/alm-sdk

Version:

Algebra ALM SDK

130 lines (129 loc) 3.29 kB
import { Signer } from '@ethersproject/abstract-signer'; import { Provider } from '@ethersproject/providers'; import { BigNumber } from 'ethers'; export type SignerOrProvider = Signer | Provider; export declare enum SupportedChainId { Base = 8453, BaseSepolia = 84532 } export declare const algebraVaultDecimals = 18; export type TotalAmountsBN = [BigNumber, BigNumber] & { total0: BigNumber; total1: BigNumber; }; export type UserAmountsBN = [BigNumber, BigNumber, BigNumber]; export type TotalAmounts = [string, string, string] & { total0: string; total1: string; }; export type UserAmounts = [string, string, string]; export type UserAmountsInVault = { poolAddress: string; vaultAddress: string; userAmounts: UserAmounts; }; export type UserAmountsInVaultBN = { poolAddress: string; vaultAddress: string; userAmounts: UserAmountsBN; }; export interface AlgebraVault { id: string; tokenA: string; tokenB: string; allowTokenA: boolean; allowTokenB: boolean; holdersCount?: string; fee?: string; } export type VaultShares = { vault: { id: string; tokenA: string; tokenB: string; pool: string; }; vaultShareBalance: string; vaultShareStaked: string; }; export type UserBalances = { vaultShares: VaultShares[]; }; export interface VaultState { totalAmount0: string; totalAmount1: string; createdAtTimestamp: string; vault: string; sqrtPrice: string; totalSupply: string; } export interface Fees extends VaultState { feeAmount0: string; feeAmount1: string; totalAmount0: string; totalAmount1: string; createdAtTimestamp: string; vault: string; sqrtPrice: string; totalSupply: string; } export interface VaultTransactionEvent extends VaultState { amount0: string; amount1: string; totalAmount0: string; totalAmount1: string; totalAmount0BeforeEvent: string; totalAmount1BeforeEvent: string; createdAtTimestamp: string; vault: string; sqrtPrice: string; totalSupply: string; shares: string; } export type FeesInfo = { timePeriod: number; feeAmount0: string; feeAmount1: string; pctAPR: number; }; export type DepositTokenRatio = { atTimestamp: string; percent: number; }; export type AverageDepositTokenRatio = { timePeriod: number; percent: number; }; export type VaultApr = { timeInterval: number; apr: number | null; }; export type FeeAprData = { feeApr_1d: number | null; feeApr_3d: number | null; feeApr_7d: number | null; feeApr_30d: number | null; }; export type PriceChange = { timeInterval: number; priceChange: number | null; }; export type UserBalanceInVault = { vaultAddress: string; poolAddress: string; shares: string; stakedShares: string; }; export type UserBalanceInVaultBN = { vaultAddress: string; poolAddress: string; shares: BigNumber; stakedShares: BigNumber; }; export type VaultMetrics = { timeInterval: number; lpPriceChange: number | null; lpApr: number | null; avgDtr: number; feeApr: number; };