@merkl/api 0.21.47 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/cache/index.d.ts +1 -1
- package/dist/src/constants.d.ts +8 -8
- package/dist/src/eden/index.d.ts +16937 -8167
- package/dist/src/eden/index.js +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Ajna.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Badger.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Clamm.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Compound.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/CompoundV3.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Dolomite.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/ERC721.d.ts +2 -2
- package/dist/src/engine/deprecated/dynamicData/implementations/ERCMultiToken.d.ts +2 -2
- package/dist/src/engine/deprecated/dynamicData/implementations/EigenLayer.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Encompassing.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Erc20.d.ts +105 -3
- package/dist/src/engine/deprecated/dynamicData/implementations/Erc20Snapshot.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/EventBased.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Hyperdrive.d.ts +2 -2
- package/dist/src/engine/deprecated/dynamicData/implementations/Morpho.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Radiant.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Silo.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/UniswapV4.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Vest.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/default.d.ts +2 -2
- package/dist/src/engine/deprecated/dynamicData/utils/fetchA51Strategies.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/utils/fetchClamInfo.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/utils/fetchLogs.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/utils/getCompV2ForksVaults.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/utils/getDolomiteMarkets.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/utils/getEulerV2Vaults.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/utils/getFixedApr.d.ts +1 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/GenericProcessor.d.ts +6 -6
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/factoryFinder.d.ts +1 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/hardcoded.d.ts +2 -2
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/ownerFinder.d.ts +1 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/treasuryFinder.d.ts +1 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AaveProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AnglesLiquid.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AssetProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AuraProcessor.d.ts +4 -4
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.d.ts +4 -4
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BalancerGaugeProcessor.d.ts +4 -4
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BalancerPoolProcessor.d.ts +4 -4
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BalancerV3PoolProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BeefyProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BunniV2Processor.d.ts +4 -4
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/CompoundProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/ERC4626Processor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EnzymeProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EqualizerGaugeProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EulerBorrowProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EulerLendProcessor.d.ts +2 -2
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/FluidProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/FraxProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/GammaALMProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/GammaProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/GearboxProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/HanjiVaultProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/HoldStationProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/HourglassProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/MaverickBPProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/MetamorphoProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/PendleProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/PendleYTProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/RadiantProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/RfxProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/Satlayer.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SpectraProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SpectraYTProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SpliceProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/StabilityProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SturdySiloProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/TempestVaultProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/TemplateProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/TorosProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/UniswapProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/VicunaProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/WoofiProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/ZkSwapThreePoolProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/curveNPoolProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/curveProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/processorMapping.d.ts +1 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/stakedCurveProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/xU308Processor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesPrices.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound1.d.ts +1 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound2.d.ts +2 -2
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound3.d.ts +2 -2
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound4.d.ts +2 -2
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/tokenTypeStruct.d.ts +2 -2
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/tokenTypeToProtocolAndAction.d.ts +3 -3
- package/dist/src/engine/implementations/Ajna/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Ajna/tvl.d.ts +2 -2
- package/dist/src/engine/implementations/Ambient/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Ambient/tvl.d.ts +2 -2
- package/dist/src/engine/implementations/Badger/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/Clamm/metadata.d.ts +22 -22
- package/dist/src/engine/implementations/Compound/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/CompoundV3/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/Default/metadata.d.ts +3 -3
- package/dist/src/engine/implementations/Dolomite/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/EigenLayer/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/EigenLayer/tvl.d.ts +2 -2
- package/dist/src/engine/implementations/Encompassing/metadata.d.ts +3 -3
- package/dist/src/engine/implementations/Erc20/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/detect.d.ts +2 -2
- package/dist/src/engine/implementations/Erc20/subTypes/factories.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/aave/metadata.d.ts +6 -6
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/aave/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/euler/metadata.d.ts +6 -6
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/euler/tvl.d.ts +2 -2
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/hypurrfiIsolatedMarket/metadata.d.ts +6 -6
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/hypurrfiIsolatedMarket/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/lendleVaults/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/lendleVaults/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/metamorpho/metadata.d.ts +17 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/metamorpho/tvl.d.ts +6 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/pino/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/pino/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/termmax/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/termmax/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/termmaxVault/metadata.d.ts +18 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/termmaxVault/tvl.d.ts +6 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/uniswapV2/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/uniswapV2/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/index.d.ts +3 -2
- package/dist/src/engine/implementations/Erc20/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20Snapshot/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/Erc721/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/ErcMultiToken/metadata.d.ts +6 -6
- package/dist/src/engine/implementations/EventBased/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/FraxLend/metadataBorrow.d.ts +24 -0
- package/dist/src/engine/implementations/FraxLend/metadataCollateral.d.ts +18 -0
- package/dist/src/engine/implementations/FraxLend/tvlBorrow.d.ts +7 -0
- package/dist/src/engine/implementations/FraxLend/tvlCollateral.d.ts +7 -0
- package/dist/src/engine/implementations/Hyperdrive/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Invalid/metadata.d.ts +2 -2
- package/dist/src/engine/implementations/Ion/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/JsonAirdrop/metadata.d.ts +7 -7
- package/dist/src/engine/implementations/Locker/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Locker/tvl.d.ts +2 -2
- package/dist/src/engine/implementations/Morpho/metadata.d.ts +7 -7
- package/dist/src/engine/implementations/MultiLog/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/MultiLog/tvl.d.ts +3 -3
- package/dist/src/engine/implementations/Radiant/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/Silo/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/UniswapV4/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/UniswapV4/tvl.d.ts +2 -2
- package/dist/src/engine/implementations/Vest/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/morphoBorrow/metadata.d.ts +20 -0
- package/dist/src/engine/implementations/morphoBorrow/tvl.d.ts +7 -0
- package/dist/src/engine/implementations/morphoCollateral/metadata.d.ts +20 -0
- package/dist/src/engine/implementations/morphoCollateral/tvl.d.ts +7 -0
- package/dist/src/engine/implementations/morphoSupply/metadata.d.ts +20 -0
- package/dist/src/engine/implementations/morphoSupply/tvl.d.ts +7 -0
- package/dist/src/engine/metadata/factory.d.ts +1 -1
- package/dist/src/engine/tvl/factory.d.ts +2 -2
- package/dist/src/engine/tvl/logStates.d.ts +1 -1
- package/dist/src/hooks/checkQueryAddressValidity.d.ts +6 -2
- package/dist/src/hooks/checkQueryChainIdValidity.d.ts +6 -2
- package/dist/src/index.d.ts +5548 -2626
- package/dist/src/jobs/{dynamic-data.d.ts → update-v3-caches.d.ts} +4 -1
- package/dist/src/libs/computeFee.d.ts +1 -1
- package/dist/src/libs/deprecated-merklv3/index.d.ts +3 -3
- package/dist/src/libs/merklChainData.d.ts +1 -1
- package/dist/src/libs/parse/marketsWithCache.d.ts +1 -1
- package/dist/src/libs/positions/EigenLayer/index.d.ts +2 -2
- package/dist/src/libs/positions/ajna/index.d.ts +2 -2
- package/dist/src/libs/positions/badger/index.d.ts +2 -2
- package/dist/src/libs/positions/clamm/index.d.ts +1 -1
- package/dist/src/libs/positions/clamm/thegraph/fetchAlmPositions.d.ts +1 -1
- package/dist/src/libs/positions/clamm/thegraph/fetchAmmPositions.d.ts +1 -1
- package/dist/src/libs/positions/clamm/thegraph/fetchFarmedPositions.d.ts +1 -1
- package/dist/src/libs/positions/compound/index.d.ts +2 -2
- package/dist/src/libs/positions/dolomite/index.d.ts +2 -2
- package/dist/src/libs/positions/erc20/index.d.ts +2 -2
- package/dist/src/libs/positions/euler/index.d.ts +2 -2
- package/dist/src/libs/positions/index.d.ts +1 -1
- package/dist/src/libs/positions/morpho/index.d.ts +2 -2
- package/dist/src/libs/positions/prepareFetch.d.ts +1 -1
- package/dist/src/libs/positions/silo/index.d.ts +2 -2
- package/dist/src/libs/positions/types.d.ts +1 -1
- package/dist/src/libs/staticCampaigns.d.ts +1 -1
- package/dist/src/libs/tokens/balances.d.ts +1 -1
- package/dist/src/libs/tokens/tokenInfo.d.ts +1 -1
- package/dist/src/modules/v4/accounting/accounting.controller.d.ts +98 -33
- package/dist/src/modules/v4/accounting/accounting.repository.d.ts +41 -41
- package/dist/src/modules/v4/accounting/accounting.service.d.ts +7 -7
- package/dist/src/modules/v4/apr/apr.model.d.ts +8 -8
- package/dist/src/modules/v4/apr/apr.service.d.ts +1 -1
- package/dist/src/modules/v4/authentication/authentication.controller.d.ts +24 -2
- package/dist/src/modules/v4/blacklist/blacklist.controller.d.ts +64 -37
- package/dist/src/modules/v4/blacklist/blacklist.repository.d.ts +4 -4
- package/dist/src/modules/v4/blacklist/blacklist.service.d.ts +5 -5
- package/dist/src/modules/v4/boost/boost.controller.d.ts +25 -3
- package/dist/src/modules/v4/cache/cache.repository.d.ts +1 -1
- package/dist/src/modules/v4/cache/cache.service.d.ts +1 -1
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +665 -504
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +30 -9
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +191 -191
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +415 -319
- package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +352 -282
- package/dist/src/modules/v4/chain/chain.controller.d.ts +91 -47
- package/dist/src/modules/v4/chain/chain.model.d.ts +11 -3
- package/dist/src/modules/v4/chain/chain.repository.d.ts +10 -10
- package/dist/src/modules/v4/chain/chain.service.d.ts +10 -10
- package/dist/src/modules/v4/chainInteraction/chainInteraction.service.d.ts +1 -1
- package/dist/src/modules/v4/claims/claims.controller.d.ts +15 -2
- package/dist/src/modules/v4/claims/claims.repository.d.ts +1 -1
- package/dist/src/modules/v4/claims/claims.service.d.ts +3 -3
- package/dist/src/modules/v4/computedValue/computedValue.controller.d.ts +47 -7
- package/dist/src/modules/v4/computedValue/computedValue.repository.d.ts +2 -2
- package/dist/src/modules/v4/computedValue/computedValue.service.d.ts +2 -2
- package/dist/src/modules/v4/creator/creator.controller.d.ts +160 -88
- package/dist/src/modules/v4/creator/creator.model.d.ts +1 -1
- package/dist/src/modules/v4/creator/creator.repository.d.ts +20 -20
- package/dist/src/modules/v4/creator/creator.service.d.ts +47 -47
- package/dist/src/modules/v4/dynamicData/dynamicData.model.d.ts +1 -1
- package/dist/src/modules/v4/dynamicData/dynamicData.service.d.ts +1 -1
- package/dist/src/modules/v4/enso/enso.service.d.ts +17 -17
- package/dist/src/modules/v4/explorer/explorer.controller.d.ts +19 -6
- package/dist/src/modules/v4/explorer/explorer.model.d.ts +2 -2
- package/dist/src/modules/v4/explorer/explorer.repository.d.ts +5 -5
- package/dist/src/modules/v4/explorer/explorer.service.d.ts +7 -7
- package/dist/src/modules/v4/interaction/interaction.controller.d.ts +39 -8
- package/dist/src/modules/v4/interaction/interaction.model.d.ts +1 -1
- package/dist/src/modules/v4/interaction/interaction.service.d.ts +2 -2
- package/dist/src/modules/v4/kyberzap/kyberzap.service.d.ts +1 -1
- package/dist/src/modules/v4/liquidity/implementations/AjnaPositionFetcher.d.ts +2 -2
- package/dist/src/modules/v4/liquidity/implementations/BadgerPositionFetcher.d.ts +2 -2
- package/dist/src/modules/v4/liquidity/implementations/ClammPositionFetcher.d.ts +2 -2
- package/dist/src/modules/v4/liquidity/implementations/DolomitePositionFetcher.d.ts +2 -2
- package/dist/src/modules/v4/liquidity/implementations/ERC20PositionFetcher.d.ts +3 -3
- package/dist/src/modules/v4/liquidity/implementations/EulerPositionFetcher.d.ts +2 -2
- package/dist/src/modules/v4/liquidity/liquidity.controller.d.ts +24 -13
- package/dist/src/modules/v4/liquidity/liquidity.model.d.ts +2 -2
- package/dist/src/modules/v4/liquidity/liquidity.repository.d.ts +1 -1
- package/dist/src/modules/v4/merklRoot/merklRoot.controller.d.ts +42 -22
- package/dist/src/modules/v4/merklRoot/merklRoot.repository.d.ts +7 -7
- package/dist/src/modules/v4/merklRoot/merklRoot.service.d.ts +18 -8
- package/dist/src/modules/v4/nodes/node.controller.d.ts +65 -0
- package/dist/src/modules/v4/nodes/node.model.d.ts +21 -0
- package/dist/src/modules/v4/nodes/node.repository.d.ts +21 -0
- package/dist/src/modules/v4/nodes/node.service.d.ts +21 -0
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +743 -644
- package/dist/src/modules/v4/opportunity/opportunity.converter.d.ts +111 -5
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +116 -81
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +408 -408
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +489 -459
- package/dist/src/modules/v4/parse/parse.controller.d.ts +64 -0
- package/dist/src/modules/v4/parse/parse.model.d.ts +10 -0
- package/dist/src/modules/v4/payload/payload.controller.d.ts +125 -0
- package/dist/src/modules/v4/payload/payload.model.d.ts +307 -0
- package/dist/src/modules/v4/payload/payload.service.d.ts +27 -0
- package/dist/src/modules/v4/price/price.controller.d.ts +93 -50
- package/dist/src/modules/v4/price/price.model.d.ts +16 -16
- package/dist/src/modules/v4/price/price.repository.d.ts +11 -11
- package/dist/src/modules/v4/price/price.service.d.ts +9 -9
- package/dist/src/modules/v4/prisma/index.d.ts +1 -1
- package/dist/src/modules/v4/programPayload/programPayload.controller.d.ts +939 -146
- package/dist/src/modules/v4/programPayload/programPayload.model.d.ts +12 -14
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +450 -362
- package/dist/src/modules/v4/programPayload/programPayload.service.d.ts +40 -19
- package/dist/src/modules/v4/protocol/protocol.controller.d.ts +117 -67
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +2 -2
- package/dist/src/modules/v4/protocol/protocol.repository.d.ts +29 -29
- package/dist/src/modules/v4/protocol/protocol.service.d.ts +9 -6
- package/dist/src/modules/v4/referral/referral.controller.d.ts +29 -7
- package/dist/src/modules/v4/referral/referral.service.d.ts +8 -8
- package/dist/src/modules/v4/reward/reward.controller.d.ts +261 -93
- package/dist/src/modules/v4/reward/reward.converter.d.ts +1 -1
- package/dist/src/modules/v4/reward/reward.model.d.ts +3 -3
- package/dist/src/modules/v4/reward/reward.repository.d.ts +55 -54
- package/dist/src/modules/v4/reward/reward.service.d.ts +260 -260
- package/dist/src/modules/v4/router.d.ts +4706 -2394
- package/dist/src/modules/v4/status/status.controller.d.ts +127 -64
- package/dist/src/modules/v4/status/status.model.d.ts +10 -10
- package/dist/src/modules/v4/status/status.repository.d.ts +35 -35
- package/dist/src/modules/v4/status/status.service.d.ts +23 -23
- package/dist/src/modules/v4/token/token.controller.d.ts +224 -130
- package/dist/src/modules/v4/token/token.model.d.ts +1 -1
- package/dist/src/modules/v4/token/token.repository.d.ts +41 -37
- package/dist/src/modules/v4/token/token.service.d.ts +106 -101
- package/dist/src/modules/v4/turtle/turtle.controller.d.ts +15 -2
- package/dist/src/modules/v4/tvl/tvl.model.d.ts +5 -5
- package/dist/src/modules/v4/tvl/tvl.service.d.ts +1 -1
- package/dist/src/modules/v4/uniswap/uniswap.controller.d.ts +248 -11
- package/dist/src/modules/v4/uniswap/uniswap.model.d.ts +3 -3
- package/dist/src/modules/v4/uniswap/uniswap.repository.d.ts +4 -4
- package/dist/src/modules/v4/uniswap/uniswap.service.d.ts +3 -3
- package/dist/src/modules/v4/user/user.controller.d.ts +175 -164
- package/dist/src/modules/v4/user/user.model.d.ts +10 -1
- package/dist/src/modules/v4/user/user.repository.d.ts +7 -7
- package/dist/src/modules/v4/user/user.service.d.ts +7 -7
- package/dist/src/plugins/error-handling.plugin.d.ts +7 -3
- package/dist/src/routes/v1/allowances.d.ts +18 -5
- package/dist/src/routes/v1/balances.d.ts +16 -3
- package/dist/src/routes/v1/prices.d.ts +15 -2
- package/dist/src/routes/v1/router.d.ts +44 -4
- package/dist/src/routes/v1/tokens.d.ts +15 -2
- package/dist/src/routes/v2/merkl.d.ts +41 -4
- package/dist/src/routes/v2/router.d.ts +41 -4
- package/dist/src/routes/v3/app.d.ts +15 -2
- package/dist/src/routes/v3/blacklist.d.ts +15 -2
- package/dist/src/routes/v3/campaign/delay.d.ts +27 -16
- package/dist/src/routes/v3/campaignClaims.d.ts +15 -2
- package/dist/src/routes/v3/campaignUnclaimed.d.ts +15 -2
- package/dist/src/routes/v3/campaigns.d.ts +17 -4
- package/dist/src/routes/v3/campaignsForMainParameter.d.ts +15 -2
- package/dist/src/routes/v3/campaignsRewardsReport.d.ts +15 -2
- package/dist/src/routes/v3/claims.d.ts +15 -2
- package/dist/src/routes/v3/compoundV2.d.ts +15 -2
- package/dist/src/routes/v3/createCampaign.d.ts +16 -3
- package/dist/src/routes/v3/dolomite.d.ts +15 -2
- package/dist/src/routes/v3/euler.d.ts +43 -14
- package/dist/src/routes/v3/fetch.d.ts +15 -2
- package/dist/src/routes/v3/health.d.ts +15 -2
- package/dist/src/routes/v3/lostyield.d.ts +15 -2
- package/dist/src/routes/v3/merkl.d.ts +34 -6
- package/dist/src/routes/v3/morphoMarkets.d.ts +15 -2
- package/dist/src/routes/v3/morphoVaults.d.ts +15 -2
- package/dist/src/routes/v3/multiChainPositions.d.ts +15 -2
- package/dist/src/routes/v3/opportunity.d.ts +72 -6
- package/dist/src/routes/v3/overview.d.ts +15 -2
- package/dist/src/routes/v3/parse.d.ts +15 -2
- package/dist/src/routes/v3/payload.d.ts +19 -6
- package/dist/src/routes/v3/poolInfo.d.ts +18 -5
- package/dist/src/routes/v3/positions.d.ts +15 -2
- package/dist/src/routes/v3/radiant.d.ts +15 -2
- package/dist/src/routes/v3/recipients.d.ts +15 -2
- package/dist/src/routes/v3/rewards.d.ts +18 -5
- package/dist/src/routes/v3/rewardsReport.d.ts +16 -3
- package/dist/src/routes/v3/router.d.ts +608 -55
- package/dist/src/routes/v3/silo.d.ts +15 -2
- package/dist/src/routes/v3/token.d.ts +16 -3
- package/dist/src/routes/v3/twt/participants.d.ts +24 -13
- package/dist/src/routes/v3/uniswapv4.d.ts +192 -19
- package/dist/src/routes/v3/updates.d.ts +15 -2
- package/dist/src/routes/v3/userRewards.d.ts +18 -5
- package/dist/src/utils/decodeCalls.d.ts +1 -1
- package/dist/src/utils/encodeCalls.d.ts +2 -2
- package/dist/src/utils/error.d.ts +8 -4
- package/dist/src/utils/generateCardName.d.ts +2 -2
- package/dist/src/utils/generic.d.ts +2 -2
- package/dist/src/utils/lastBlockBefore.d.ts +1 -1
- package/dist/src/utils/logger.d.ts +0 -8
- package/dist/src/utils/pricer.d.ts +1 -1
- package/dist/src/utils/prices/chainlinkRead.d.ts +1 -1
- package/dist/src/utils/prices/curveVirtualPrice.d.ts +1 -1
- package/dist/src/utils/prices/getDQUICK.d.ts +1 -1
- package/dist/src/utils/prices/priceFetcherFactory.d.ts +1 -1
- package/dist/src/utils/prices/services/OnChainCallService.d.ts +1 -1
- package/dist/src/utils/prices/services/coinGeckoService.d.ts +1 -1
- package/dist/src/utils/prices/services/defillamaService.d.ts +1 -1
- package/dist/src/utils/prices/services/dexScreenerService.d.ts +1 -1
- package/dist/src/utils/prices/services/erc4626Service.d.ts +1 -1
- package/dist/src/utils/prices/services/getERC4626.d.ts +1 -1
- package/dist/src/utils/prices/services/indexCoopService.d.ts +1 -1
- package/dist/src/utils/prices/services/priceFetcher.d.ts +1 -1
- package/dist/src/utils/prices/uniV2Price.d.ts +1 -1
- package/dist/src/utils/providers.d.ts +113 -2
- package/dist/src/utils/queries/allCampaigns.d.ts +1 -2
- package/dist/src/utils/sanitizeChain.d.ts +2 -2
- package/dist/src/utils/stryke.d.ts +1 -1
- package/dist/src/utils/throw.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +28 -48
- package/dist/database/api/.generated/default.d.ts +0 -1
- package/dist/database/api/.generated/default.js +0 -1
- package/dist/database/api/.generated/drizzle/schema.d.ts +0 -3342
- package/dist/database/api/.generated/drizzle/schema.js +0 -928
- package/dist/database/api/.generated/drizzle/schema.ts +0 -989
- package/dist/database/api/.generated/edge.d.ts +0 -1
- package/dist/database/api/.generated/edge.js +0 -725
- package/dist/database/api/.generated/index-browser.js +0 -696
- package/dist/database/api/.generated/index.d.ts +0 -48645
- package/dist/database/api/.generated/index.js +0 -758
- package/dist/database/api/.generated/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
- package/dist/database/api/.generated/libquery_engine-linux-arm64-openssl-1.1.x.so.node +0 -0
- package/dist/database/api/.generated/libquery_engine-linux-arm64-openssl-3.0.x.so.node +0 -0
- package/dist/database/api/.generated/libquery_engine-linux-musl-arm64-openssl-3.0.x.so.node +0 -0
- package/dist/database/api/.generated/package.json +0 -97
- package/dist/database/api/.generated/runtime/edge-esm.js +0 -31
- package/dist/database/api/.generated/runtime/edge.js +0 -31
- package/dist/database/api/.generated/runtime/index-browser.d.ts +0 -365
- package/dist/database/api/.generated/runtime/index-browser.js +0 -13
- package/dist/database/api/.generated/runtime/library.d.ts +0 -3447
- package/dist/database/api/.generated/runtime/library.js +0 -143
- package/dist/database/api/.generated/runtime/react-native.js +0 -80
- package/dist/database/api/.generated/runtime/wasm.js +0 -32
- package/dist/database/api/.generated/schema.prisma +0 -482
- package/dist/database/api/.generated/wasm.d.ts +0 -1
- package/dist/database/api/.generated/wasm.js +0 -696
- package/dist/database/engine/.generated/default.d.ts +0 -1
- package/dist/database/engine/.generated/default.js +0 -1
- package/dist/database/engine/.generated/edge.d.ts +0 -1
- package/dist/database/engine/.generated/edge.js +0 -485
- package/dist/database/engine/.generated/index-browser.js +0 -456
- package/dist/database/engine/.generated/index.d.ts +0 -22107
- package/dist/database/engine/.generated/index.js +0 -518
- package/dist/database/engine/.generated/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
- package/dist/database/engine/.generated/libquery_engine-linux-arm64-openssl-1.1.x.so.node +0 -0
- package/dist/database/engine/.generated/libquery_engine-linux-arm64-openssl-3.0.x.so.node +0 -0
- package/dist/database/engine/.generated/libquery_engine-linux-musl-arm64-openssl-3.0.x.so.node +0 -0
- package/dist/database/engine/.generated/package.json +0 -97
- package/dist/database/engine/.generated/runtime/edge-esm.js +0 -31
- package/dist/database/engine/.generated/runtime/edge.js +0 -31
- package/dist/database/engine/.generated/runtime/index-browser.d.ts +0 -365
- package/dist/database/engine/.generated/runtime/index-browser.js +0 -13
- package/dist/database/engine/.generated/runtime/library.d.ts +0 -3447
- package/dist/database/engine/.generated/runtime/library.js +0 -143
- package/dist/database/engine/.generated/runtime/react-native.js +0 -80
- package/dist/database/engine/.generated/runtime/wasm.js +0 -32
- package/dist/database/engine/.generated/schema.prisma +0 -248
- package/dist/database/engine/.generated/wasm.d.ts +0 -1
- package/dist/database/engine/.generated/wasm.js +0 -456
- package/dist/database/index.d.ts +0 -29
- package/dist/database/index.js +0 -17
- package/dist/src/cache/declaration.js +0 -121
- package/dist/src/cache/index.js +0 -161
- package/dist/src/cache/redis.js +0 -57
- package/dist/src/constants.js +0 -93
- package/dist/src/engine/deprecated/dynamicData/implementations/Ajna.js +0 -107
- package/dist/src/engine/deprecated/dynamicData/implementations/Badger.js +0 -90
- package/dist/src/engine/deprecated/dynamicData/implementations/Clamm.js +0 -975
- package/dist/src/engine/deprecated/dynamicData/implementations/Compound.js +0 -139
- package/dist/src/engine/deprecated/dynamicData/implementations/CompoundV3.js +0 -101
- package/dist/src/engine/deprecated/dynamicData/implementations/Dolomite.js +0 -59
- package/dist/src/engine/deprecated/dynamicData/implementations/ERC721.js +0 -87
- package/dist/src/engine/deprecated/dynamicData/implementations/ERCMultiToken.js +0 -161
- package/dist/src/engine/deprecated/dynamicData/implementations/EigenLayer.js +0 -67
- package/dist/src/engine/deprecated/dynamicData/implementations/Encompassing.js +0 -26
- package/dist/src/engine/deprecated/dynamicData/implementations/Erc20.js +0 -162
- package/dist/src/engine/deprecated/dynamicData/implementations/Erc20Snapshot.js +0 -32
- package/dist/src/engine/deprecated/dynamicData/implementations/EventBased.js +0 -129
- package/dist/src/engine/deprecated/dynamicData/implementations/Hyperdrive.js +0 -112
- package/dist/src/engine/deprecated/dynamicData/implementations/Morpho.js +0 -132
- package/dist/src/engine/deprecated/dynamicData/implementations/Radiant.js +0 -123
- package/dist/src/engine/deprecated/dynamicData/implementations/Silo.js +0 -112
- package/dist/src/engine/deprecated/dynamicData/implementations/UniswapV4.js +0 -255
- package/dist/src/engine/deprecated/dynamicData/implementations/Vest.js +0 -61
- package/dist/src/engine/deprecated/dynamicData/implementations/default.js +0 -5
- package/dist/src/engine/deprecated/dynamicData/utils/fetchA51Strategies.js +0 -44
- package/dist/src/engine/deprecated/dynamicData/utils/fetchClamInfo.js +0 -27
- package/dist/src/engine/deprecated/dynamicData/utils/fetchLogs.js +0 -149
- package/dist/src/engine/deprecated/dynamicData/utils/getCompV2ForksVaults.js +0 -141
- package/dist/src/engine/deprecated/dynamicData/utils/getContractCreationBlock.js +0 -44
- package/dist/src/engine/deprecated/dynamicData/utils/getDolomiteMarkets.js +0 -53
- package/dist/src/engine/deprecated/dynamicData/utils/getEulerV2Vaults.js +0 -266
- package/dist/src/engine/deprecated/dynamicData/utils/getFixedApr.js +0 -27
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/GenericProcessor.js +0 -335
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/eulerVaultNames.js +0 -13
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/factoryFinder.js +0 -47
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/getBlacklistedSupply.js +0 -22
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/getCrossCurveTokenPrice.js +0 -13
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/hardcoded.js +0 -30
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/metamorphoTvl.d.ts +0 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/metamorphoTvl.js +0 -35
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/ownerFinder.js +0 -16
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/spliceTVL.js +0 -23
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/treasuryFinder.js +0 -10
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AaveProcessor.js +0 -26
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AnglesLiquid.js +0 -51
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AssetProcessor.js +0 -48
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AuraProcessor.js +0 -113
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.js +0 -111
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BalancerGaugeProcessor.js +0 -86
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BalancerPoolProcessor.js +0 -101
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BalancerV3PoolProcessor.js +0 -81
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BeefyProcessor.js +0 -54
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BunniV2Processor.js +0 -91
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/CompoundProcessor.js +0 -37
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/ERC4626Processor.js +0 -37
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EnzymeProcessor.js +0 -52
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EqualizerGaugeProcessor.js +0 -54
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EulerBorrowProcessor.js +0 -51
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EulerLendProcessor.js +0 -58
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/FluidProcessor.js +0 -37
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/FraxProcessor.js +0 -42
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/GammaALMProcessor.js +0 -52
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/GammaProcessor.js +0 -67
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/GearboxProcessor.js +0 -58
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/HanjiVaultProcessor.js +0 -63
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/HoldStationProcessor.js +0 -35
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/HourglassProcessor.js +0 -35
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/MaverickBPProcessor.js +0 -78
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/MetamorphoProcessor.js +0 -48
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.js +0 -82
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/PendleProcessor.js +0 -30
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/PendleYTProcessor.js +0 -30
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/RadiantProcessor.js +0 -59
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/RfxProcessor.js +0 -71
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/Satlayer.js +0 -28
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SpectraProcessor.js +0 -42
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SpectraYTProcessor.js +0 -40
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SpliceProcessor.js +0 -37
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/StabilityProcessor.js +0 -30
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SturdySiloProcessor.js +0 -38
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/TempestVaultProcessor.js +0 -83
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/TemplateProcessor.js +0 -40
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/TorosProcessor.js +0 -34
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/UniswapProcessor.js +0 -72
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/VicunaProcessor.js +0 -36
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/WoofiProcessor.js +0 -41
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/ZkSwapThreePoolProcessor.js +0 -60
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/curveNPoolProcessor.js +0 -102
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/curveProcessor.js +0 -85
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/processorMapping.js +0 -159
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/stakedCurveProcessor.js +0 -88
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/xU308Processor.js +0 -42
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesPrices.js +0 -28
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound1.js +0 -353
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound2.js +0 -22
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound3.js +0 -22
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound4.js +0 -22
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/tokenTypeStruct.js +0 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/tokenTypeToProtocolAndAction.js +0 -155
- package/dist/src/engine/implementations/Ajna/metadata.js +0 -59
- package/dist/src/engine/implementations/Ajna/tvl.js +0 -91
- package/dist/src/engine/implementations/Ambient/metadata.js +0 -36
- package/dist/src/engine/implementations/Ambient/tvl.js +0 -178
- package/dist/src/engine/implementations/Badger/metadata.js +0 -31
- package/dist/src/engine/implementations/Clamm/metadata.js +0 -176
- package/dist/src/engine/implementations/Compound/metadata.js +0 -23
- package/dist/src/engine/implementations/CompoundV3/metadata.js +0 -23
- package/dist/src/engine/implementations/Default/metadata.js +0 -12
- package/dist/src/engine/implementations/Dolomite/metadata.js +0 -20
- package/dist/src/engine/implementations/EigenLayer/metadata.js +0 -12
- package/dist/src/engine/implementations/EigenLayer/tvl.js +0 -60
- package/dist/src/engine/implementations/Encompassing/metadata.js +0 -43
- package/dist/src/engine/implementations/Erc20/metadata.js +0 -64
- package/dist/src/engine/implementations/Erc20/subTypes/detect.js +0 -170
- package/dist/src/engine/implementations/Erc20/subTypes/factories.js +0 -69
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/aave/metadata.js +0 -46
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/aave/tvl.js +0 -51
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/euler/metadata.js +0 -35
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/euler/tvl.js +0 -59
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/metadata.js +0 -21
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/tvl.js +0 -46
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/hypurrfiIsolatedMarket/metadata.js +0 -40
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/hypurrfiIsolatedMarket/tvl.js +0 -57
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/lendleVaults/metadata.js +0 -20
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/lendleVaults/tvl.js +0 -52
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/pino/metadata.js +0 -38
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/pino/tvl.js +0 -83
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/termmax/metadata.js +0 -24
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/termmax/tvl.js +0 -69
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/uniswapV2/metadata.js +0 -65
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/uniswapV2/tvl.js +0 -94
- package/dist/src/engine/implementations/Erc20/subTypes/index.js +0 -119
- package/dist/src/engine/implementations/Erc20/tvl.js +0 -99
- package/dist/src/engine/implementations/Erc20Snapshot/metadata.js +0 -11
- package/dist/src/engine/implementations/Erc721/metadata.js +0 -13
- package/dist/src/engine/implementations/ErcMultiToken/metadata.js +0 -63
- package/dist/src/engine/implementations/EventBased/metadata.js +0 -181
- package/dist/src/engine/implementations/Hyperdrive/metadata.js +0 -29
- package/dist/src/engine/implementations/Invalid/metadata.js +0 -10
- package/dist/src/engine/implementations/Ion/metadata.js +0 -16
- package/dist/src/engine/implementations/JsonAirdrop/metadata.js +0 -43
- package/dist/src/engine/implementations/Locker/metadata.js +0 -36
- package/dist/src/engine/implementations/Locker/tvl.js +0 -26
- package/dist/src/engine/implementations/Morpho/metadata.js +0 -63
- package/dist/src/engine/implementations/MultiLog/metadata.js +0 -36
- package/dist/src/engine/implementations/MultiLog/tvl.js +0 -59
- package/dist/src/engine/implementations/Radiant/metadata.js +0 -33
- package/dist/src/engine/implementations/Silo/metadata.js +0 -20
- package/dist/src/engine/implementations/UniswapV4/metadata.js +0 -36
- package/dist/src/engine/implementations/UniswapV4/tvl.js +0 -158
- package/dist/src/engine/implementations/Vest/metadata.js +0 -13
- package/dist/src/engine/metadata/factory.js +0 -76
- package/dist/src/engine/tvl/factory.js +0 -87
- package/dist/src/engine/tvl/logStates.js +0 -106
- package/dist/src/errors/BadRequest.error.js +0 -7
- package/dist/src/errors/Conflict.error.js +0 -7
- package/dist/src/errors/HttpError.js +0 -17
- package/dist/src/errors/InvalidParameter.error.js +0 -7
- package/dist/src/errors/NotFound.error.js +0 -12
- package/dist/src/errors/Opportunity.error.js +0 -11
- package/dist/src/errors/UnableToFindPrice.error.js +0 -7
- package/dist/src/errors/Unauthorized.error.js +0 -7
- package/dist/src/errors/VoidString.error.js +0 -7
- package/dist/src/errors/index.js +0 -6
- package/dist/src/guards/BackOffice.guard.js +0 -10
- package/dist/src/guards/Engine.guard.js +0 -9
- package/dist/src/guards/TokenAuth.guard.js +0 -10
- package/dist/src/guards/VerifyJwt.guard.js +0 -13
- package/dist/src/hooks/checkQueryAddressValidity.js +0 -7
- package/dist/src/hooks/checkQueryChainIdValidity.js +0 -7
- package/dist/src/index.js +0 -113
- package/dist/src/jobs/dynamic-data.js +0 -159
- package/dist/src/jobs/pendings.js +0 -238
- package/dist/src/jobs/prices.js +0 -10
- package/dist/src/jobs/reward-breakdowns.js +0 -163
- package/dist/src/jobs/rewards.js +0 -112
- package/dist/src/jobs/set-dungeon-keeper.js +0 -90
- package/dist/src/jobs/update-analytics.js +0 -548
- package/dist/src/jobs/update-dynamic-data.js +0 -57
- package/dist/src/jobs/update-euler-vaults.js +0 -18
- package/dist/src/jobs/update-rpc-calls-cache.js +0 -30
- package/dist/src/jobs/update-uniswap-v4-pools.js +0 -15
- package/dist/src/libs/computeFee.js +0 -34
- package/dist/src/libs/deprecated-merklv3/index.js +0 -183
- package/dist/src/libs/getTokensList.js +0 -19
- package/dist/src/libs/merklChainData.js +0 -116
- package/dist/src/libs/parse/marketsWithCache.js +0 -8
- package/dist/src/libs/positions/EigenLayer/index.js +0 -54
- package/dist/src/libs/positions/ajna/index.js +0 -107
- package/dist/src/libs/positions/badger/index.js +0 -80
- package/dist/src/libs/positions/clamm/index.js +0 -412
- package/dist/src/libs/positions/clamm/thegraph/fetchAlmPositions.js +0 -36
- package/dist/src/libs/positions/clamm/thegraph/fetchAmmPositions.js +0 -36
- package/dist/src/libs/positions/clamm/thegraph/fetchFarmedPositions.js +0 -42
- package/dist/src/libs/positions/clamm/thegraph/index.js +0 -163
- package/dist/src/libs/positions/compound/index.js +0 -91
- package/dist/src/libs/positions/dolomite/index.js +0 -51
- package/dist/src/libs/positions/erc20/index.js +0 -55
- package/dist/src/libs/positions/euler/index.js +0 -56
- package/dist/src/libs/positions/index.js +0 -56
- package/dist/src/libs/positions/morpho/index.js +0 -177
- package/dist/src/libs/positions/prepareFetch.js +0 -392
- package/dist/src/libs/positions/silo/index.js +0 -68
- package/dist/src/libs/positions/types.js +0 -1
- package/dist/src/libs/staticCampaigns.js +0 -15
- package/dist/src/libs/tokens/allowances.js +0 -18
- package/dist/src/libs/tokens/balances.js +0 -128
- package/dist/src/libs/tokens/tokenInfo.js +0 -22
- package/dist/src/modules/v4/accounting/accounting.controller.js +0 -61
- package/dist/src/modules/v4/accounting/accounting.model.js +0 -32
- package/dist/src/modules/v4/accounting/accounting.repository.js +0 -154
- package/dist/src/modules/v4/accounting/accounting.service.js +0 -107
- package/dist/src/modules/v4/airflow/airflow.service.js +0 -20
- package/dist/src/modules/v4/apr/apr.model.js +0 -13
- package/dist/src/modules/v4/apr/apr.service.js +0 -52
- package/dist/src/modules/v4/authentication/authentication.controller.js +0 -23
- package/dist/src/modules/v4/authentication/authentication.model.js +0 -6
- package/dist/src/modules/v4/authentication/authentication.service.js +0 -31
- package/dist/src/modules/v4/blacklist/blacklist.controller.js +0 -42
- package/dist/src/modules/v4/blacklist/blacklist.model.js +0 -13
- package/dist/src/modules/v4/blacklist/blacklist.repository.js +0 -50
- package/dist/src/modules/v4/blacklist/blacklist.service.js +0 -31
- package/dist/src/modules/v4/boost/boost.controller.js +0 -15
- package/dist/src/modules/v4/boost/boost.model.js +0 -14
- package/dist/src/modules/v4/boost/boost.service.js +0 -20
- package/dist/src/modules/v4/bucket/bucket.model.js +0 -85
- package/dist/src/modules/v4/bucket/bucket.service.js +0 -178
- package/dist/src/modules/v4/cache/cache.model.js +0 -14
- package/dist/src/modules/v4/cache/cache.repository.js +0 -22
- package/dist/src/modules/v4/cache/cache.service.js +0 -59
- package/dist/src/modules/v4/campaign/campaign.controller.js +0 -174
- package/dist/src/modules/v4/campaign/campaign.model.js +0 -140
- package/dist/src/modules/v4/campaign/campaign.repository.js +0 -535
- package/dist/src/modules/v4/campaign/campaign.service.js +0 -455
- package/dist/src/modules/v4/campaign/campaign.test.controller.js +0 -127
- package/dist/src/modules/v4/chain/chain.controller.js +0 -44
- package/dist/src/modules/v4/chain/chain.model.js +0 -36
- package/dist/src/modules/v4/chain/chain.repository.js +0 -79
- package/dist/src/modules/v4/chain/chain.service.js +0 -55
- package/dist/src/modules/v4/chainInteraction/chainInteraction.service.js +0 -4
- package/dist/src/modules/v4/claims/claims.controller.js +0 -19
- package/dist/src/modules/v4/claims/claims.model.js +0 -1
- package/dist/src/modules/v4/claims/claims.repository.js +0 -39
- package/dist/src/modules/v4/claims/claims.service.js +0 -40
- package/dist/src/modules/v4/coingecko/coingecko.model.js +0 -1
- package/dist/src/modules/v4/coingecko/coingecko.repository.js +0 -9
- package/dist/src/modules/v4/coingecko/coingecko.service.js +0 -65
- package/dist/src/modules/v4/computedValue/computedValue.controller.js +0 -46
- package/dist/src/modules/v4/computedValue/computedValue.model.js +0 -30
- package/dist/src/modules/v4/computedValue/computedValue.repository.js +0 -48
- package/dist/src/modules/v4/computedValue/computedValue.service.js +0 -23
- package/dist/src/modules/v4/creator/creator.controller.js +0 -43
- package/dist/src/modules/v4/creator/creator.model.js +0 -42
- package/dist/src/modules/v4/creator/creator.repository.js +0 -69
- package/dist/src/modules/v4/creator/creator.service.js +0 -92
- package/dist/src/modules/v4/dynamicData/dynamicData.model.js +0 -56
- package/dist/src/modules/v4/dynamicData/dynamicData.service.js +0 -263
- package/dist/src/modules/v4/enso/enso.model.js +0 -147
- package/dist/src/modules/v4/enso/enso.service.js +0 -116
- package/dist/src/modules/v4/explorer/explorer.controller.js +0 -13
- package/dist/src/modules/v4/explorer/explorer.model.js +0 -8
- package/dist/src/modules/v4/explorer/explorer.repository.js +0 -23
- package/dist/src/modules/v4/explorer/explorer.service.js +0 -24
- package/dist/src/modules/v4/icon/icon.model.js +0 -1
- package/dist/src/modules/v4/icon/icon.service.js +0 -16
- package/dist/src/modules/v4/interaction/interaction.controller.js +0 -45
- package/dist/src/modules/v4/interaction/interaction.model.js +0 -25
- package/dist/src/modules/v4/interaction/interaction.service.js +0 -95
- package/dist/src/modules/v4/kyberzap/kyberzap.model.js +0 -83
- package/dist/src/modules/v4/kyberzap/kyberzap.service.js +0 -176
- package/dist/src/modules/v4/liquidity/implementations/AjnaPositionFetcher.js +0 -90
- package/dist/src/modules/v4/liquidity/implementations/BadgerPositionFetcher.js +0 -69
- package/dist/src/modules/v4/liquidity/implementations/ClammPositionFetcher.js +0 -61
- package/dist/src/modules/v4/liquidity/implementations/DolomitePositionFetcher.js +0 -45
- package/dist/src/modules/v4/liquidity/implementations/ERC20PositionFetcher.js +0 -47
- package/dist/src/modules/v4/liquidity/implementations/EulerPositionFetcher.js +0 -40
- package/dist/src/modules/v4/liquidity/liquidity.controller.js +0 -16
- package/dist/src/modules/v4/liquidity/liquidity.model.js +0 -5
- package/dist/src/modules/v4/liquidity/liquidity.repository.js +0 -6
- package/dist/src/modules/v4/liquidity/liquidity.service.js +0 -34
- package/dist/src/modules/v4/merklRoot/merklRoot.controller.js +0 -31
- package/dist/src/modules/v4/merklRoot/merklRoot.model.js +0 -12
- package/dist/src/modules/v4/merklRoot/merklRoot.repository.js +0 -56
- package/dist/src/modules/v4/merklRoot/merklRoot.service.js +0 -48
- package/dist/src/modules/v4/opportunity/opportunity.controller.js +0 -189
- package/dist/src/modules/v4/opportunity/opportunity.converter.js +0 -174
- package/dist/src/modules/v4/opportunity/opportunity.model.js +0 -132
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +0 -515
- package/dist/src/modules/v4/opportunity/opportunity.service.js +0 -380
- package/dist/src/modules/v4/opportunity/transform-id.pipe.js +0 -6
- package/dist/src/modules/v4/opportunity/validate-id.pipe.js +0 -12
- package/dist/src/modules/v4/price/price.controller.js +0 -56
- package/dist/src/modules/v4/price/price.model.js +0 -12
- package/dist/src/modules/v4/price/price.repository.js +0 -22
- package/dist/src/modules/v4/price/price.service.js +0 -63
- package/dist/src/modules/v4/prisma/index.js +0 -1
- package/dist/src/modules/v4/programPayload/programPayload.controller.js +0 -85
- package/dist/src/modules/v4/programPayload/programPayload.model.js +0 -179
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +0 -7567
- package/dist/src/modules/v4/programPayload/programPayload.service.js +0 -240
- package/dist/src/modules/v4/protocol/protocol.controller.js +0 -42
- package/dist/src/modules/v4/protocol/protocol.model.js +0 -186
- package/dist/src/modules/v4/protocol/protocol.repository.js +0 -175
- package/dist/src/modules/v4/protocol/protocol.service.js +0 -73
- package/dist/src/modules/v4/referral/referral.controller.js +0 -25
- package/dist/src/modules/v4/referral/referral.model.js +0 -12
- package/dist/src/modules/v4/referral/referral.service.js +0 -171
- package/dist/src/modules/v4/reward/reward.controller.js +0 -140
- package/dist/src/modules/v4/reward/reward.converter.js +0 -124
- package/dist/src/modules/v4/reward/reward.model.js +0 -153
- package/dist/src/modules/v4/reward/reward.repository.js +0 -350
- package/dist/src/modules/v4/reward/reward.service.js +0 -406
- package/dist/src/modules/v4/router.js +0 -93
- package/dist/src/modules/v4/status/status.controller.js +0 -68
- package/dist/src/modules/v4/status/status.model.js +0 -34
- package/dist/src/modules/v4/status/status.repository.js +0 -146
- package/dist/src/modules/v4/status/status.service.js +0 -150
- package/dist/src/modules/v4/token/token.controller.js +0 -118
- package/dist/src/modules/v4/token/token.model.js +0 -87
- package/dist/src/modules/v4/token/token.repository.js +0 -192
- package/dist/src/modules/v4/token/token.service.js +0 -410
- package/dist/src/modules/v4/tracer/tracer.service.js +0 -30
- package/dist/src/modules/v4/turtle/turtle.controller.js +0 -20
- package/dist/src/modules/v4/turtle/turtle.repository.js +0 -40
- package/dist/src/modules/v4/turtle/turtle.service.js +0 -28
- package/dist/src/modules/v4/tvl/tvl.model.js +0 -13
- package/dist/src/modules/v4/tvl/tvl.service.js +0 -63
- package/dist/src/modules/v4/uniswap/uniswap.controller.js +0 -100
- package/dist/src/modules/v4/uniswap/uniswap.model.js +0 -46
- package/dist/src/modules/v4/uniswap/uniswap.repository.js +0 -12
- package/dist/src/modules/v4/uniswap/uniswap.service.js +0 -245
- package/dist/src/modules/v4/user/user.controller.js +0 -77
- package/dist/src/modules/v4/user/user.model.js +0 -66
- package/dist/src/modules/v4/user/user.repository.js +0 -41
- package/dist/src/modules/v4/user/user.service.js +0 -102
- package/dist/src/plugins/error-handling.plugin.js +0 -34
- package/dist/src/routes/v1/allowances.js +0 -115
- package/dist/src/routes/v1/balances.js +0 -25
- package/dist/src/routes/v1/prices.js +0 -9
- package/dist/src/routes/v1/router.js +0 -6
- package/dist/src/routes/v1/tokens.js +0 -17
- package/dist/src/routes/v2/merkl.js +0 -13
- package/dist/src/routes/v2/router.js +0 -3
- package/dist/src/routes/v3/app.js +0 -43
- package/dist/src/routes/v3/blacklist.js +0 -19
- package/dist/src/routes/v3/campaign/delay.js +0 -81
- package/dist/src/routes/v3/campaignClaims.js +0 -29
- package/dist/src/routes/v3/campaignUnclaimed.js +0 -28
- package/dist/src/routes/v3/campaigns.js +0 -136
- package/dist/src/routes/v3/campaignsForMainParameter.js +0 -33
- package/dist/src/routes/v3/campaignsRewardsReport.js +0 -48
- package/dist/src/routes/v3/claims.js +0 -16
- package/dist/src/routes/v3/compoundV2.js +0 -9
- package/dist/src/routes/v3/createCampaign.js +0 -66
- package/dist/src/routes/v3/dolomite.js +0 -12
- package/dist/src/routes/v3/euler.js +0 -52
- package/dist/src/routes/v3/fetch.js +0 -27
- package/dist/src/routes/v3/health.js +0 -13
- package/dist/src/routes/v3/lostyield.js +0 -101
- package/dist/src/routes/v3/merkl.js +0 -119
- package/dist/src/routes/v3/morphoMarkets.js +0 -27
- package/dist/src/routes/v3/morphoVaults.js +0 -22
- package/dist/src/routes/v3/multiChainPositions.js +0 -70
- package/dist/src/routes/v3/opportunity.js +0 -28
- package/dist/src/routes/v3/overview.js +0 -72
- package/dist/src/routes/v3/parse.js +0 -23
- package/dist/src/routes/v3/payload.js +0 -40
- package/dist/src/routes/v3/poolInfo.js +0 -88
- package/dist/src/routes/v3/positions.js +0 -62
- package/dist/src/routes/v3/radiant.js +0 -26
- package/dist/src/routes/v3/recipients.js +0 -29
- package/dist/src/routes/v3/rewards.js +0 -36
- package/dist/src/routes/v3/rewardsReport.js +0 -40
- package/dist/src/routes/v3/router.js +0 -70
- package/dist/src/routes/v3/silo.js +0 -20
- package/dist/src/routes/v3/token.js +0 -24
- package/dist/src/routes/v3/twt/participants.js +0 -63
- package/dist/src/routes/v3/uniswapv4.js +0 -29
- package/dist/src/routes/v3/updates.js +0 -47
- package/dist/src/routes/v3/userRewards.js +0 -63
- package/dist/src/scripts/fill-coingecko-data.js +0 -3
- package/dist/src/scripts/fill-descriptions.js +0 -101
- package/dist/src/scripts/fill-unknown-tokens.js +0 -58
- package/dist/src/scripts/reparse-opportunities.js +0 -75
- package/dist/src/types/external/spectraAPI.js +0 -1
- package/dist/src/types/index.js +0 -1
- package/dist/src/utils/TailSampler.js +0 -23
- package/dist/src/utils/bigintToString.js +0 -20
- package/dist/src/utils/caseChanges.js +0 -15
- package/dist/src/utils/decodeCalls.js +0 -340
- package/dist/src/utils/encodeCalls.js +0 -506
- package/dist/src/utils/error.js +0 -114
- package/dist/src/utils/execute.js +0 -117
- package/dist/src/utils/generateCardName.js +0 -209
- package/dist/src/utils/generic.js +0 -43
- package/dist/src/utils/hashArray.js +0 -7
- package/dist/src/utils/lastBlockBefore.js +0 -78
- package/dist/src/utils/logger.js +0 -52
- package/dist/src/utils/parseDistributionType.js +0 -16
- package/dist/src/utils/pricer.js +0 -189
- package/dist/src/utils/prices/chainlinkRead.js +0 -8
- package/dist/src/utils/prices/curveVirtualPrice.js +0 -7
- package/dist/src/utils/prices/getDQUICK.js +0 -8
- package/dist/src/utils/prices/priceFetcherFactory.js +0 -32
- package/dist/src/utils/prices/priceService.js +0 -274
- package/dist/src/utils/prices/services/OnChainCallService.js +0 -38
- package/dist/src/utils/prices/services/coinGeckoService.js +0 -63
- package/dist/src/utils/prices/services/defillamaService.js +0 -53
- package/dist/src/utils/prices/services/dexScreenerService.js +0 -62
- package/dist/src/utils/prices/services/erc4626Service.js +0 -38
- package/dist/src/utils/prices/services/getERC4626.js +0 -11
- package/dist/src/utils/prices/services/indexCoopService.js +0 -55
- package/dist/src/utils/prices/services/priceFetcher.js +0 -1
- package/dist/src/utils/prices/uniV2Price.js +0 -40
- package/dist/src/utils/providers.js +0 -37
- package/dist/src/utils/queries/allCampaigns.js +0 -12
- package/dist/src/utils/sanitizeChain.js +0 -6
- package/dist/src/utils/stryke.js +0 -4
- package/dist/src/utils/throw.js +0 -55
- package/dist/tsconfig.package.tsbuildinfo +0 -1
package/dist/src/cache/index.js
DELETED
@@ -1,161 +0,0 @@
|
|
1
|
-
import { InvalidCacheCall } from "@/utils/error";
|
2
|
-
import { log } from "@/utils/logger";
|
3
|
-
import { withRetry, withTimeout } from "@sdk";
|
4
|
-
import NodeCache from "node-cache";
|
5
|
-
import { CacheDeclaration } from "./declaration";
|
6
|
-
import { REDIS_CRON_WRITE_TIMEOUT, REDIS_READ_TIMEOUT, REDIS_RETRIES, redisClient } from "./redis";
|
7
|
-
export class Cache {
|
8
|
-
static decoder = new TextDecoder();
|
9
|
-
static encoder = new TextEncoder();
|
10
|
-
localCache = new NodeCache();
|
11
|
-
/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
12
|
-
UTILS
|
13
|
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
|
14
|
-
static baseKey(key) {
|
15
|
-
return key.split("_")[0];
|
16
|
-
}
|
17
|
-
/** @notice Uncompress (if enabled), parsed and typed data from the cache */
|
18
|
-
static uncompress(key, value) {
|
19
|
-
const { compressed } = CacheDeclaration[Cache.baseKey(key)];
|
20
|
-
if (!compressed)
|
21
|
-
return JSON.parse(value);
|
22
|
-
if (!value)
|
23
|
-
return {};
|
24
|
-
const encoded = Buffer.from(value, "base64");
|
25
|
-
const uncompressed = Bun.gunzipSync(encoded);
|
26
|
-
const decoded = Cache.decoder.decode(uncompressed);
|
27
|
-
return JSON.parse(decoded);
|
28
|
-
}
|
29
|
-
/** @notice Compress (if enabled), stringify and encoded data to be stored in the cache */
|
30
|
-
static compress(key, value) {
|
31
|
-
const { compressed } = CacheDeclaration[Cache.baseKey(key)];
|
32
|
-
if (!compressed)
|
33
|
-
return JSON.stringify(value);
|
34
|
-
const encoded = Cache.encoder.encode(JSON.stringify(value));
|
35
|
-
const compressedValue = Bun.gzipSync(encoded);
|
36
|
-
return Buffer.from(compressedValue).toString("base64");
|
37
|
-
}
|
38
|
-
/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
39
|
-
REDIS CACHE
|
40
|
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
|
41
|
-
async getRaw(key) {
|
42
|
-
if (!key || key === "")
|
43
|
-
throw new InvalidCacheCall("Trying to access cache with no key");
|
44
|
-
return await withRetry(withTimeout, [redisClient.get(key), REDIS_READ_TIMEOUT], REDIS_RETRIES);
|
45
|
-
}
|
46
|
-
async getManyRaw(keys) {
|
47
|
-
if (keys?.length === 0)
|
48
|
-
throw new InvalidCacheCall("Trying to access cache with no keys");
|
49
|
-
const strippedKeys = Array.from(keys.map(a => a.split("_")[0]).reduce((unique, key) => unique.add(key), new Set()));
|
50
|
-
const multipleCached = await withRetry(withTimeout, [redisClient.mGet(keys), REDIS_READ_TIMEOUT], REDIS_RETRIES);
|
51
|
-
log.local(`Redis: ${keys.length} data fetched with mGet`);
|
52
|
-
return multipleCached;
|
53
|
-
}
|
54
|
-
async setRaw(key, value) {
|
55
|
-
const { redisTTL } = CacheDeclaration[Cache.baseKey(key)];
|
56
|
-
await redisClient.set(key, value, { EX: redisTTL });
|
57
|
-
}
|
58
|
-
/** @notice Set value for a given key for both local and raw cache */
|
59
|
-
async set(key, value) {
|
60
|
-
this.setLocally(key, value);
|
61
|
-
this.setRaw(key, Cache.compress(key, value));
|
62
|
-
}
|
63
|
-
/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
64
|
-
LOCAL CACHE
|
65
|
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
|
66
|
-
/**
|
67
|
-
* @deprecated Local cache is not used anymore
|
68
|
-
*/
|
69
|
-
isLocallyCached(_key) {
|
70
|
-
return false;
|
71
|
-
// return this.localCache.has(key);
|
72
|
-
}
|
73
|
-
/**
|
74
|
-
* @deprecated Local cache is not used anymore
|
75
|
-
*/
|
76
|
-
setLocally(_key, _value) {
|
77
|
-
return true;
|
78
|
-
// const { localCacheTtl } = CacheDeclaration[Cache.baseKey<T, Key>(key)] as { localCacheTtl?: number };
|
79
|
-
// return this.localCache.set(key, value, localCacheTtl ?? DEFAULT_LOCAL_TTL);
|
80
|
-
}
|
81
|
-
/**
|
82
|
-
* @deprecated Local cache is not used anymore
|
83
|
-
*/
|
84
|
-
getLocally(_key) {
|
85
|
-
return undefined;
|
86
|
-
// return this.localCache.get(key);
|
87
|
-
}
|
88
|
-
/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
89
|
-
PUBLIC OPERATIONS
|
90
|
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
|
91
|
-
/**
|
92
|
-
* @returns the uncompressed (if enabled), parsed and typed data from the cache
|
93
|
-
*/
|
94
|
-
async get(key, args) {
|
95
|
-
const actualKey = (args ? `${key}_${args}` : key);
|
96
|
-
if (this.isLocallyCached(actualKey))
|
97
|
-
return this.getLocally(actualKey);
|
98
|
-
const rawCache = await this.getRaw(actualKey);
|
99
|
-
if (rawCache === null)
|
100
|
-
return null;
|
101
|
-
const value = Cache.uncompress(actualKey, rawCache);
|
102
|
-
this.setLocally(actualKey, value);
|
103
|
-
return value;
|
104
|
-
}
|
105
|
-
/**
|
106
|
-
* Get many data from cache
|
107
|
-
* @param key cache key
|
108
|
-
* @returns the uncompressed (if enabled), parsed and typed data from the cache for all keys
|
109
|
-
*/
|
110
|
-
async findMany(keys) {
|
111
|
-
const nonLocalKeys = keys.filter(key => !this.isLocallyCached(key)); // Keys not stored locally
|
112
|
-
const cached = !!nonLocalKeys.length ? await this.getManyRaw(nonLocalKeys) : [];
|
113
|
-
const res = keys.map(key => {
|
114
|
-
if (!nonLocalKeys.includes(key))
|
115
|
-
return this.localCache.get(key);
|
116
|
-
const cachedValue = cached[nonLocalKeys.indexOf(key)];
|
117
|
-
if (cachedValue !== null) {
|
118
|
-
const value = Cache.uncompress(key, cachedValue);
|
119
|
-
this.setLocally(key, value);
|
120
|
-
return value;
|
121
|
-
}
|
122
|
-
return null;
|
123
|
-
});
|
124
|
-
return res;
|
125
|
-
}
|
126
|
-
/**
|
127
|
-
* Get many data from cache with argument
|
128
|
-
* @param key cache key
|
129
|
-
* @param args arguments to append to cache keys
|
130
|
-
* @returns the uncompressed (if enabled), parsed and typed data from the cache for all keys
|
131
|
-
*/
|
132
|
-
async getManyWithArgs(key, args) {
|
133
|
-
const actualKeys = args.map(arg => `${key}_${arg}`);
|
134
|
-
return this.findMany(actualKeys);
|
135
|
-
}
|
136
|
-
/**
|
137
|
-
* Get data from cache or set it using the callback
|
138
|
-
* @param key cache key
|
139
|
-
* @returns the uncompressed (if enabled), parsed and typed data from the cache
|
140
|
-
*/
|
141
|
-
async getOrSet(key, callback, ...args) {
|
142
|
-
if (this.isLocallyCached(key))
|
143
|
-
return this.localCache.get(key);
|
144
|
-
let value;
|
145
|
-
const cachedValue = await this.getRaw(key);
|
146
|
-
if (cachedValue !== null) {
|
147
|
-
value = Cache.uncompress(key, cachedValue);
|
148
|
-
}
|
149
|
-
else {
|
150
|
-
value = await callback(...args);
|
151
|
-
await this.setRaw(key, Cache.compress(key, value));
|
152
|
-
}
|
153
|
-
this.setLocally(key, value);
|
154
|
-
return value;
|
155
|
-
}
|
156
|
-
/** @notice Set with retrials */
|
157
|
-
async safeSet(key, value) {
|
158
|
-
return await withRetry(withTimeout, [this.set(key, value), REDIS_CRON_WRITE_TIMEOUT], REDIS_RETRIES);
|
159
|
-
}
|
160
|
-
}
|
161
|
-
export const Redis = new Cache();
|
package/dist/src/cache/redis.js
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
import { log } from "@/utils/logger";
|
2
|
-
import { createClient, } from "redis";
|
3
|
-
const REDISHOST = process.env.REDISHOST || "redis";
|
4
|
-
const REDISPORT = !!process.env.REDISPORT ? Number(process.env.REDISPORT) : 6379;
|
5
|
-
const REDISPASSWORD = process.env.REDISPASSWORD || "";
|
6
|
-
export const REDIS_RETRIES = 0;
|
7
|
-
export const REDIS_READ_TIMEOUT = !!process.env.REDIS_READ_TIMEOUT
|
8
|
-
? Number.parseInt(process.env.REDIS_READ_TIMEOUT)
|
9
|
-
: Bun.env.NODE_ENV === "production"
|
10
|
-
? 4_000
|
11
|
-
: 10 * 2_000;
|
12
|
-
export const REDIS_WRITE_TIMEOUT = 4000;
|
13
|
-
export const REDIS_CRON_READ_TIMEOUT = 5000;
|
14
|
-
export const REDIS_CRON_WRITE_TIMEOUT = 10000;
|
15
|
-
export var TTLType;
|
16
|
-
(function (TTLType) {
|
17
|
-
TTLType[TTLType["HalfBlock"] = 4] = "HalfBlock";
|
18
|
-
TTLType[TTLType["Block"] = 11] = "Block";
|
19
|
-
TTLType[TTLType["Seconds30"] = 30] = "Seconds30";
|
20
|
-
TTLType[TTLType["Minutes2"] = 120] = "Minutes2";
|
21
|
-
TTLType[TTLType["Minutes3"] = 180] = "Minutes3";
|
22
|
-
TTLType[TTLType["Minutes5"] = 300] = "Minutes5";
|
23
|
-
TTLType[TTLType["Minutes10"] = 600] = "Minutes10";
|
24
|
-
TTLType[TTLType["Minutes25"] = 1500] = "Minutes25";
|
25
|
-
TTLType[TTLType["Minutes30"] = 1800] = "Minutes30";
|
26
|
-
TTLType[TTLType["Minutes35"] = 2100] = "Minutes35";
|
27
|
-
TTLType[TTLType["Hours3"] = 10800] = "Hours3";
|
28
|
-
TTLType[TTLType["Hours12"] = 43200] = "Hours12";
|
29
|
-
TTLType[TTLType["Day"] = 86400] = "Day";
|
30
|
-
TTLType[TTLType["Week"] = 604800] = "Week";
|
31
|
-
})(TTLType || (TTLType = {}));
|
32
|
-
/** Redis client
|
33
|
-
* @dev About how handling client connections -> https://stackoverflow.com/questions/22387187/node-js-express-redis-when-to-close-connection
|
34
|
-
* @dev Also -> https://github.com/redis/node-redis/issues/568
|
35
|
-
*/
|
36
|
-
const redisConfig = {
|
37
|
-
url: `redis://${REDISHOST}:${REDISPORT}`,
|
38
|
-
socket: REDISHOST === "redis"
|
39
|
-
? undefined
|
40
|
-
: {
|
41
|
-
tls: true,
|
42
|
-
reconnectStrategy: retries => Math.min(retries * 100, 5000),
|
43
|
-
keepAlive: 5_000,
|
44
|
-
},
|
45
|
-
password: REDISPASSWORD,
|
46
|
-
pingInterval: 10_000,
|
47
|
-
};
|
48
|
-
export const redisClient = createClient(redisConfig);
|
49
|
-
redisClient.on("error", error => {
|
50
|
-
log.error("[REDIS]", error);
|
51
|
-
redisClient.connect().catch(() => { }); // Auto-reconnect
|
52
|
-
});
|
53
|
-
redisClient.connect();
|
54
|
-
redisClient.on("end", () => log.debug("[REDIS]: disconnected"));
|
55
|
-
redisClient.on("ready", () => {
|
56
|
-
log.debug("[REDIS]: connected");
|
57
|
-
});
|
package/dist/src/constants.js
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
import { ChainId } from "@sdk";
|
2
|
-
export const DEFAULT_LOCAL_TTL = 120;
|
3
|
-
export const MAX_NUM_SUBCALLS = 100;
|
4
|
-
export const MERKL_USER_POSITION_FETCHING_TIMEOUT = 8000;
|
5
|
-
export const MERKL_USER_POSITION_FETCHING_GLOBAL_TIMEOUT = 10000;
|
6
|
-
export const MERKL_ALM_POSITION_FETCHING_TIMEOUT = 100000;
|
7
|
-
export const EBTC_ADDRESS = "0x661c70333AA1850CcDBAe82776Bb436A0fCfeEfB";
|
8
|
-
export const CDPMANAGER_ADDRESS = "0xc4cbaE499bb4Ca41E78f52F07f5d98c375711774";
|
9
|
-
export const SORTEDCDPS_ADDRESS = "0x591AcB5AE192c147948c12651a0a5f24f0529BE3";
|
10
|
-
export const RFX_DATASTORE = "0x895124783008C6c68eFcccac24c482Fdf30439B2";
|
11
|
-
const COMMON_PREFIX_STAKE = "https://lockers.stakedao.org/api/strategies/cache/curve";
|
12
|
-
const COMMON_PREFIX_CONVEX = "https://www.convexfinance.com/api/curve-apys";
|
13
|
-
export const constantChain = {
|
14
|
-
[ChainId.MAINNET]: {
|
15
|
-
apw: "0x4104b135dbc9609fc1a9490e61369036497660c8",
|
16
|
-
convexEndpoint: COMMON_PREFIX_CONVEX,
|
17
|
-
crv: "0xD533a949740bb3306d119CC777fa900bA034cd52",
|
18
|
-
crv3: "0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490",
|
19
|
-
crvANGLESDANGLE: "0x96AAE323E111A19b1E0e26F55e8De21F1dD01f26",
|
20
|
-
crvEURAEUROC: "0xBa3436Fd341F2C8A928452Db3C5A3670d1d5Cc73",
|
21
|
-
crvEURAEURe: "0x413928a25D6ea1A26F2625d633207755f67Bf97c",
|
22
|
-
crvEuropool: "0xe7A3b38c39F97E977723bd1239C3470702568e7B",
|
23
|
-
crvFRAX: "0x3175Df0976dFA876431C2E9eE6Bc45b65d3473CC",
|
24
|
-
crvFRAXEURA: "0x22e859Ee894c2068920858A60b51DC03ac5581c1",
|
25
|
-
crvLUSD3CRV: "0xEd279fDD11cA84bEef15AF5D39BB4d4bEE23F0cA",
|
26
|
-
cvx: "0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B",
|
27
|
-
dai: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
|
28
|
-
frax: "0x853d955aCEf822Db058eb8505911ED77F175b99e",
|
29
|
-
fxs: "0x3432B6A60D23Ca0dFCa7761B7ab56459D9C964D0",
|
30
|
-
morpho: "0x9994E35Db50125E0DF82e4c2dde62496CE330999",
|
31
|
-
rKP3R: "0x1ceb5cb57c4d4e2b2433641b95dd330a33185a44",
|
32
|
-
sdt: "0x73968b9a57c6e53d41345fd57a6e6ae27d6cdb2f",
|
33
|
-
stakeEndpoint: COMMON_PREFIX_STAKE,
|
34
|
-
sushi: "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
|
35
|
-
usdc: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
36
|
-
weth: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
37
|
-
wstETH: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
|
38
|
-
},
|
39
|
-
[ChainId.ARBITRUM]: {
|
40
|
-
arb: "0x912ce59144191c1204e64559fe8253a0e49e6548",
|
41
|
-
chr: "0x15b2fb8f08E4Ac1Ce019EADAe02eE92AeDF06851",
|
42
|
-
convexProxy: "0x989AEb4d175e16225E39E87d0D97A3360524AD80",
|
43
|
-
crv: "0x11cdb42b0eb46d95f990bedd4695a6e3fa034978",
|
44
|
-
crv2Pool: "0x7f90122BF0700F9E7e1F688fe926940E8839F353",
|
45
|
-
cvx: "0xb952A807345991BD529FDded05009F5e80Fe8F45",
|
46
|
-
frax: "0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F",
|
47
|
-
jeur: "0xAD435674417520aeeED6b504bBe654d4f556182F",
|
48
|
-
ram: "0xAAA6C1E32C55A7Bfa8066A6FAE9b42650F262418",
|
49
|
-
sdt: "0x7ba4a00d54a07461d9db2aef539e91409943adc9",
|
50
|
-
sliz: "0x463913D3a3D3D291667D53B8325c598Eb88D3B0e",
|
51
|
-
stakeEndpoint: `${COMMON_PREFIX_STAKE}-arbitrum`,
|
52
|
-
usdc: "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
|
53
|
-
},
|
54
|
-
[ChainId.OPTIMISM]: {
|
55
|
-
jeur: "0x79AF5dd14e855823FA3E9ECAcdF001D99647d043",
|
56
|
-
mai: "0xdFA46478F9e5EA86d57387849598dbFB2e964b02",
|
57
|
-
op: "0x4200000000000000000000000000000000000042",
|
58
|
-
usdc: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
59
|
-
usdce: "0x7F5c764cBc14f9669B88837ca1490cCa17c31607",
|
60
|
-
velo: "0x3c8b650257cfb5f272f799f5e2b4e65093a11a05",
|
61
|
-
veloV2: "0x9560e827aF36c94D2Ac33a39bCE1Fe78631088Db",
|
62
|
-
},
|
63
|
-
[ChainId.BASE]: {
|
64
|
-
aero: "0x940181a94A35A4569E4529A3CDfB74e38FD98631",
|
65
|
-
usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
66
|
-
},
|
67
|
-
[ChainId.POLYGON]: {
|
68
|
-
am3CRV: "0xE7a24EF0C5e95Ffb0f6684b813A78F2a3AD7D171",
|
69
|
-
amDAI: "0x27F8D03b3a2196956ED754baDc28D73be8830A6e",
|
70
|
-
amUSDC: "0x1a13F4Ca1d028320A707D99520AbFefca3998b7F",
|
71
|
-
amUSDT: "0x60D55F02A771d515e077c9C2403a1ef324885CeC",
|
72
|
-
jeur: "0x4e3Decbb3645551B8A19f0eA1678079FCB33fB4c",
|
73
|
-
jrt: "0x596ebe76e2db4470966ea395b0d063ac6197a8c5",
|
74
|
-
oretro: "0x3A29CAb2E124919d14a6F735b6033a3AaD2B260F",
|
75
|
-
usdc: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
76
|
-
},
|
77
|
-
[ChainId.AVALANCHE]: {
|
78
|
-
glcr: "0x3712871408a829C5cd4e86DA1f4CE727eFCD28F6",
|
79
|
-
usdc: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
|
80
|
-
},
|
81
|
-
[ChainId.BSC]: {
|
82
|
-
cake: "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",
|
83
|
-
},
|
84
|
-
};
|
85
|
-
export const MAVERICK_ZKSYNC_BP_LENS_ADDRESS = "0xd32CE31CaC98CAC0631764B8286358c0606D87F9";
|
86
|
-
export const SPECTRA_NETWORK_SLUGS = {
|
87
|
-
[ChainId.MAINNET]: "mainnet",
|
88
|
-
[ChainId.ARBITRUM]: "arbitrum",
|
89
|
-
[ChainId.OPTIMISM]: "optimism",
|
90
|
-
[ChainId.BASE]: "base",
|
91
|
-
[ChainId.POLYGON]: "polygon",
|
92
|
-
[ChainId.SONIC]: "sonic",
|
93
|
-
};
|
@@ -1,107 +0,0 @@
|
|
1
|
-
import { TokenService } from "@/modules/v4/token/token.service";
|
2
|
-
import { log } from "@/utils/logger";
|
3
|
-
import { providers } from "@/utils/providers";
|
4
|
-
import { AjnaSubCampaignType, BN2Number, ChainInteractionService, ERC20Pool__factory, NETWORK_LABELS, PoolInfoUtilsInterface, YEAR, } from "@sdk";
|
5
|
-
import { POOL_INFO_UTILS } from "@sdk";
|
6
|
-
import axios from "axios";
|
7
|
-
export class AjnaDynamicData {
|
8
|
-
async build(chainId, campaigns) {
|
9
|
-
const calls = [];
|
10
|
-
for (const campaign of campaigns) {
|
11
|
-
if (campaign.campaignParameters.subCampaignType === AjnaSubCampaignType.lend) {
|
12
|
-
calls.push({
|
13
|
-
allowFailure: true,
|
14
|
-
callData: PoolInfoUtilsInterface.encodeFunctionData("poolPricesInfo", [campaign.campaignParameters.poolId]),
|
15
|
-
target: POOL_INFO_UTILS[campaign.computeChainId],
|
16
|
-
});
|
17
|
-
}
|
18
|
-
}
|
19
|
-
const result = await ChainInteractionService(chainId).fetchState(calls);
|
20
|
-
const dynamicData = [];
|
21
|
-
let index = 0;
|
22
|
-
for (const campaign of campaigns) {
|
23
|
-
const res = await axios.get(`https://ajna-api.blockanalitica.com/v4/${NETWORK_LABELS[chainId].toLowerCase()}/pools/${campaign.campaignParameters.poolId.toLowerCase()}`);
|
24
|
-
try {
|
25
|
-
let totalSupplyTargetToken = 0;
|
26
|
-
let totalComputedTargetToken = 0;
|
27
|
-
let blacklistedSupply = 0;
|
28
|
-
let blacklistedPosition;
|
29
|
-
if (campaign.campaignParameters.subCampaignType === AjnaSubCampaignType.lend) {
|
30
|
-
totalSupplyTargetToken = res?.data.results?.quote_token_balance;
|
31
|
-
const htpIndex = PoolInfoUtilsInterface.decodeFunctionResult("poolPricesInfo", result[index].returnData)[3];
|
32
|
-
const lupIndex = PoolInfoUtilsInterface.decodeFunctionResult("poolPricesInfo", result[index].returnData)[5];
|
33
|
-
const threshold = BN2Number(lupIndex, 0) === 0 ? lupIndex : lupIndex.gt(htpIndex) ? lupIndex.add(22) : htpIndex.add(22);
|
34
|
-
const InterestEarningSupplyRes = await ERC20Pool__factory.connect(campaign.campaignParameters.poolId, providers[campaign.computeChainId]).depositUpToIndex(threshold);
|
35
|
-
totalComputedTargetToken = BN2Number(InterestEarningSupplyRes, 18);
|
36
|
-
index++;
|
37
|
-
}
|
38
|
-
else {
|
39
|
-
totalSupplyTargetToken = res?.data.results?.debt;
|
40
|
-
}
|
41
|
-
totalComputedTargetToken =
|
42
|
-
campaign.campaignSubType === AjnaSubCampaignType.lend ? totalComputedTargetToken : totalSupplyTargetToken;
|
43
|
-
if (campaign.campaignParameters.blacklist.length !== 0 && totalComputedTargetToken !== 0) {
|
44
|
-
for (const blacklisted of campaign.campaignParameters.blacklist) {
|
45
|
-
const res = await axios.get(`https://ajna-api.blockanalitica.com/v4/${NETWORK_LABELS[chainId].toLowerCase()}/wallets/${blacklisted}/pools/?days_ago=1&order=-debt&p_size=50`);
|
46
|
-
let nextRoute = null;
|
47
|
-
if (!!res.data.next) {
|
48
|
-
nextRoute = `https://${res.data.next.slice(res.data.next.indexOf(":") + 1)}`;
|
49
|
-
}
|
50
|
-
blacklistedPosition = res.data.results.find((position) => position.pool_address === campaign.campaignParameters.poolId);
|
51
|
-
blacklistedSupply = !blacklistedPosition
|
52
|
-
? 0
|
53
|
-
: campaign.campaignSubType === AjnaSubCampaignType.lend
|
54
|
-
? Number(blacklistedPosition.supply)
|
55
|
-
: Number(blacklistedPosition.debt);
|
56
|
-
while (nextRoute !== null && blacklistedSupply !== 0) {
|
57
|
-
const res = await axios.get(nextRoute);
|
58
|
-
blacklistedPosition = res.data.results.find((position) => position.pool_address === campaign.campaignParameters.poolId);
|
59
|
-
blacklistedSupply = !blacklistedPosition
|
60
|
-
? 0
|
61
|
-
: campaign.campaignSubType === AjnaSubCampaignType.lend
|
62
|
-
? Number(blacklistedPosition.supply)
|
63
|
-
: Number(blacklistedPosition.debt);
|
64
|
-
if (!!res.data.next) {
|
65
|
-
nextRoute = `https://${res.data.next.slice(res.data.next.indexOf(":") + 1)}`;
|
66
|
-
}
|
67
|
-
else {
|
68
|
-
nextRoute = null;
|
69
|
-
}
|
70
|
-
}
|
71
|
-
}
|
72
|
-
}
|
73
|
-
totalComputedTargetToken -= blacklistedSupply;
|
74
|
-
const priceRewardToken = await TokenService.getRewardTokenPrice(campaign);
|
75
|
-
// (await pricer.get({
|
76
|
-
// address: campaign.rewardToken,
|
77
|
-
// chainId,
|
78
|
-
// symbol: campaign.campaignParameters.symbolRewardToken,
|
79
|
-
// })) ?? 0;
|
80
|
-
let apr = (priceRewardToken *
|
81
|
-
BN2Number(campaign.amount, campaign.campaignParameters.decimalsRewardToken) *
|
82
|
-
YEAR *
|
83
|
-
100) /
|
84
|
-
campaign.campaignParameters.duration /
|
85
|
-
(totalComputedTargetToken * res?.data.results?.quote_token_underlying_price);
|
86
|
-
const rewardTokens = await TokenService.findManyOrCreate([
|
87
|
-
{ chainId: campaign.chainId, address: campaign.rewardToken },
|
88
|
-
]);
|
89
|
-
const rewardToken = rewardTokens[0];
|
90
|
-
apr = rewardToken.isPoint ? apr / 365 / 100 : apr;
|
91
|
-
dynamicData.push({
|
92
|
-
...campaign,
|
93
|
-
apr,
|
94
|
-
totalSupplyTargetToken,
|
95
|
-
tvl: res?.data.results?.tvl,
|
96
|
-
computedtotalSupply: totalComputedTargetToken,
|
97
|
-
});
|
98
|
-
}
|
99
|
-
catch (e) {
|
100
|
-
log.error("Failed to fetch Ajna data", e);
|
101
|
-
// In this case we return just the staticData
|
102
|
-
dynamicData.push({ ...campaign });
|
103
|
-
}
|
104
|
-
}
|
105
|
-
return dynamicData;
|
106
|
-
}
|
107
|
-
}
|
@@ -1,90 +0,0 @@
|
|
1
|
-
import { CDPMANAGER_ADDRESS, EBTC_ADDRESS, SORTEDCDPS_ADDRESS } from "@/constants";
|
2
|
-
import { TokenService } from "@/modules/v4/token/token.service";
|
3
|
-
import { log } from "@/utils/logger";
|
4
|
-
import { Pricer } from "@/utils/pricer";
|
5
|
-
import { BN2Number, CdpManagerInterface, ChainInteractionService, SortedCdpsInterface, YEAR, } from "@sdk";
|
6
|
-
export class BadgerDynamicData {
|
7
|
-
async build(chainId, campaigns) {
|
8
|
-
const pricer = await Pricer.load();
|
9
|
-
const calls = [];
|
10
|
-
calls.push({
|
11
|
-
allowFailure: false,
|
12
|
-
callData: CdpManagerInterface.encodeFunctionData("getSystemDebt"),
|
13
|
-
target: CDPMANAGER_ADDRESS,
|
14
|
-
});
|
15
|
-
const dynamicData = [];
|
16
|
-
const result = await ChainInteractionService(chainId).fetchState(calls);
|
17
|
-
for (const campaign of campaigns) {
|
18
|
-
try {
|
19
|
-
// Blacklist management
|
20
|
-
let blacklistSupply = 0;
|
21
|
-
let calls = [];
|
22
|
-
for (const blacklisted of [
|
23
|
-
"0xFBC472DdbE6DaE23fc0771518d1791D06a52cf4D",
|
24
|
-
"0x690C74AF48BE029e763E61b4aDeB10E06119D3ba",
|
25
|
-
"0xD0A7A8B98957b9CD3cFB9c0425AbE44551158e9e",
|
26
|
-
"0x68682e8857D24A5Bb71fCd5C6Dc5867731226B62",
|
27
|
-
]) {
|
28
|
-
calls.push({
|
29
|
-
allowFailure: false,
|
30
|
-
callData: SortedCdpsInterface.encodeFunctionData("getCdpsOf", [blacklisted]),
|
31
|
-
target: SORTEDCDPS_ADDRESS,
|
32
|
-
});
|
33
|
-
}
|
34
|
-
const resCdps = await ChainInteractionService(chainId).fetchState(calls);
|
35
|
-
calls = [];
|
36
|
-
for (const res of resCdps) {
|
37
|
-
const cdp = SortedCdpsInterface.decodeFunctionResult("getCdpsOf", res.returnData)[0];
|
38
|
-
if (cdp.length !== 0) {
|
39
|
-
calls.push({
|
40
|
-
allowFailure: false,
|
41
|
-
callData: CdpManagerInterface.encodeFunctionData("Cdps", cdp),
|
42
|
-
target: CDPMANAGER_ADDRESS,
|
43
|
-
});
|
44
|
-
}
|
45
|
-
}
|
46
|
-
const resBlacklist = await ChainInteractionService(chainId).fetchState(calls);
|
47
|
-
for (const res of resBlacklist) {
|
48
|
-
const cdpBlacklistedSupply = CdpManagerInterface.decodeFunctionResult("Cdps", res.returnData)[0];
|
49
|
-
blacklistSupply += BN2Number(cdpBlacklistedSupply, campaign.campaignParameters.decimalsTargetToken);
|
50
|
-
}
|
51
|
-
const totalSupplyTargetToken = BN2Number(CdpManagerInterface.decodeFunctionResult("getSystemDebt", result[0].returnData)[0], campaign.campaignParameters.decimalsTargetToken) - blacklistSupply;
|
52
|
-
// const priceRewardToken =
|
53
|
-
// (await pricer.get({
|
54
|
-
// address: campaign.rewardToken,
|
55
|
-
// chainId,
|
56
|
-
// symbol: campaign.campaignParameters.symbolRewardToken,
|
57
|
-
// })) ?? 0;
|
58
|
-
const priceRewardToken = await TokenService.getRewardTokenPrice(campaign);
|
59
|
-
const priceTargetToken = (await pricer.get({
|
60
|
-
address: EBTC_ADDRESS,
|
61
|
-
chainId,
|
62
|
-
symbol: campaign.campaignParameters.symbolTargetToken,
|
63
|
-
})) ?? 0;
|
64
|
-
let apr = (priceRewardToken *
|
65
|
-
BN2Number(campaign.amount, campaign.campaignParameters.decimalsRewardToken) *
|
66
|
-
YEAR *
|
67
|
-
100) /
|
68
|
-
campaign.campaignParameters.duration /
|
69
|
-
(totalSupplyTargetToken * priceTargetToken);
|
70
|
-
const rewardTokens = await TokenService.findManyOrCreate([
|
71
|
-
{ chainId: campaign.chainId, address: campaign.rewardToken },
|
72
|
-
]);
|
73
|
-
const rewardToken = rewardTokens[0];
|
74
|
-
apr = rewardToken.isPoint ? apr / 365 / 100 : apr;
|
75
|
-
dynamicData.push({
|
76
|
-
...campaign,
|
77
|
-
apr,
|
78
|
-
totalSupplyTargetToken,
|
79
|
-
tvl: totalSupplyTargetToken * priceTargetToken,
|
80
|
-
});
|
81
|
-
}
|
82
|
-
catch (e) {
|
83
|
-
log.error("Failed to fetch Dolomite data", e);
|
84
|
-
// In this case we return just the staticData
|
85
|
-
dynamicData.push({ ...campaign });
|
86
|
-
}
|
87
|
-
}
|
88
|
-
return dynamicData;
|
89
|
-
}
|
90
|
-
}
|