UNPKG

@angleprotocol/sdk

Version:
255 lines (254 loc) 7.01 kB
import { ChainId } from '.'; declare const MerklSupportedChainIds: readonly [ChainId.ARBITRUM, ChainId.MAINNET, ChainId.OPTIMISM, ChainId.POLYGON, ChainId.POLYGONZKEVM, ChainId.BASE]; export declare type MerklSupportedChainIdsType = typeof MerklSupportedChainIds[number]; export declare const isMerklSupportedChainId: (chainId: any) => chainId is ChainId.ARBITRUM | ChainId.MAINNET | ChainId.OPTIMISM | ChainId.POLYGON | ChainId.POLYGONZKEVM | ChainId.BASE; export declare enum AMMType { UniswapV3 = 0, SushiSwapV3 = 1, Retro = 2, PancakeSwapV3 = 3, Camelot = 4, BaseSwap = 5, Horiza = 6 } export declare enum ALMType { Arrakis = 0, Gamma = 2, DefiEdge = 4, Ichi = 5, Steer = 6, Range = 7, ArrakisV2 = 8, Unipilot = 9 } export declare enum UniswapV3Wrapper { Arrakis = 0, ArrakisV2 = 8, Gamma = 2, DefiEdge = 4, Ichi = 5, Steer = 6, Range = 7, Unipilot = 9 } export declare enum SushiSwapV3Wrapper { Gamma = 2, DefiEdge = 4, Range = 7, Steer = 6 } export declare enum RetroWrapper { Gamma = 2, Ichi = 5, Steer = 6, Range = 7, DefiEdge = 4 } export declare enum PancakeSwapV3Wrapper { Range = 7 } export declare enum CamelotWrapper { Gamma = 2, Range = 7 } declare type WrapperTypeMapping = { [AMMType.UniswapV3]: UniswapV3Wrapper; [AMMType.SushiSwapV3]: SushiSwapV3Wrapper; [AMMType.Retro]: RetroWrapper; [AMMType.PancakeSwapV3]: PancakeSwapV3Wrapper; [AMMType.Camelot]: CamelotWrapper; [AMMType.BaseSwap]: null; [AMMType.Horiza]: null; }; export declare const Wrapper: { 0: typeof UniswapV3Wrapper; 1: typeof SushiSwapV3Wrapper; 2: typeof RetroWrapper; 3: typeof PancakeSwapV3Wrapper; 4: typeof CamelotWrapper; 5: null; 6: null; }; export declare type WrapperType<T extends AMMType> = WrapperTypeMapping[T]; export declare enum BlacklistWrapper { Blacklist = 3 } export declare enum WhitelistWrapper { Whitelist = 0 } export declare enum AMMAlgorithmType { UniswapV3 = 0, AlgebraV1_9 = 1, BaseX = 2 } export declare const AMMAlgorithmMapping: { [amm in AMMType]: AMMAlgorithmType; }; declare type RewardOriginMapping = { [AMMType.UniswapV3]: 'UniswapV3' | keyof typeof Wrapper[AMMType.UniswapV3]; [AMMType.SushiSwapV3]: 'SushiSwap' | keyof typeof Wrapper[AMMType.SushiSwapV3]; [AMMType.Retro]: 'Retro' | keyof typeof Wrapper[AMMType.Retro]; [AMMType.PancakeSwapV3]: 'PancakeSwapV3' | keyof typeof Wrapper[AMMType.PancakeSwapV3]; [AMMType.Camelot]: 'Camelot' | keyof typeof Wrapper[AMMType.Camelot]; [AMMType.BaseSwap]: 'BaseSwap'; [AMMType.Horiza]: 'Horiza'; }; export declare type RewardOrigin<T extends AMMType> = RewardOriginMapping[T]; export declare type MerklRewardDistributionType = { [K in keyof typeof AMMType]: { amm: typeof AMMType[K]; ammAlgo: keyof typeof AMMAlgorithmType; boostedAddress: string; boostedReward: number; holders: { [holder: string]: { amount: string; amountWithoutBoost?: string; averageBoost: number; breakdown?: { [origin in RewardOrigin<typeof AMMType[K]>]?: string; }; }; }; lastUpdateEpoch: number; pool: string; token: string; tokenDecimals: number; tokenSymbol: string; totalAmount: string; }; }[keyof typeof AMMType]; export declare type UnderlyingTreeType = { [rewardId: string]: MerklRewardDistributionType; }; export declare type AggregatedRewardsType = { lastUpdateEpoch: number; rewards: UnderlyingTreeType; updateTimestamp: number; updateTxBlockNumber?: number; merklRoot: string; }; export declare type DistributionDataType<T extends AMMType> = { amount: number; blacklist: string[]; end: number; id: string; isBoosted: boolean; isLive: boolean; isMock: boolean; isOutOfRangeIncentivized: boolean; meanAPR: number; propFees: number; propToken0: number; propToken1: number; start: number; token: string; tokenDecimals: number; tokenSymbol: string; whitelist: string[]; wrappers: WrapperType<T>[]; breakdown?: { [origin in RewardOrigin<T>]?: number; }; lastBoostImpact?: number; unclaimed?: number; }; export declare type PoolDataType<T extends AMMType> = Partial<{ amm: AMMType; chainId: ChainId; endOfDisputePeriod: number; disputeLive: boolean; decimalToken0: number; decimalToken1: number; distributionData: DistributionDataType<T>[]; liquidity: number; pool: string; poolAMMAlgo: keyof typeof AMMAlgorithmType; poolFee: number; token0: string; token0InPool: number; token1: string; token1InPool: number; tokenSymbol0: string; tokenSymbol1: string; tvl?: number; meanAPR: number; aprs: { [description: string]: number; }; userTotalBalance0?: number; userTotalBalance1?: number; userTotalLiquidity?: number; userInRangeLiquidity?: number; userTVL?: number; almDetails?: { balance0?: number; balance1?: number; tvl?: number; poolBalance0?: number; poolBalance1?: number; almLiquidity?: number; almInRangeLiquidity?: number; origin: WrapperType<T> | -1; label: string; address: string; }[]; rewardsPerToken?: { [token: string]: { decimals: number; unclaimedUnformatted: string; unclaimed: number; accumulatedSinceInception: number; accumulatedSinceInceptionUnformatted: string; symbol: string; breakdown: { [origin in RewardOrigin<T>]?: number; }; }; }; }>; export declare type MerklAPIData = { merkleRoot: string; message: string; validRewardTokens: { token: string; minimumAmountPerEpoch: number; decimals: number; symbol: string; }[]; pools: { [K in keyof typeof AMMType]: { [address: string]: PoolDataType<typeof AMMType[K]>; }; }[keyof typeof AMMType]; signed?: boolean; feeRebate?: number; transactionData?: { [token: string]: { claim: string; token: string; leaf: string; proof?: string[]; }; }; }; export declare type NFTManagerPositionType = { endTimestamp: number; id: string; liquidity: string; maxLiquidity?: string; pool: string; tickLower: number; tickUpper: number; startTimestamp: number; }; export declare type DirectPositionType = { endTimestamp: number; owner: string; startTimestamp: number; tickLower: number; tickUpper: number; liquidity: string; maxLiquidity?: string; }; export {};