@merkl/api 0.20.106 → 0.20.109
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/constants.d.ts +1 -23
- package/dist/src/constants.js +1 -36
- package/dist/src/eden/index.d.ts +347 -226
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Ajna.js +1 -1
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Clamm.js +4 -4
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Compound.js +2 -2
- package/dist/src/engine/deprecated/dynamicData/implementations/CompoundV3.js +101 -0
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Dolomite.js +1 -1
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/ERC721.js +2 -2
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/ERCMultiToken.js +2 -2
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/EigenLayer.js +1 -1
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Erc20.d.ts +1 -1
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Erc20.js +10 -10
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Erc20Snapshot.js +1 -1
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/EventBased.js +2 -2
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Morpho.js +1 -1
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Radiant.js +3 -3
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Silo.js +2 -2
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/UniswapV4.js +2 -2
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Vest.js +2 -2
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/fetchA51Strategies.js +2 -2
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/getDolomiteMarkets.js +2 -2
- package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/getEulerV2Vaults.js +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/GenericProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/helpers/factoryFinder.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/helpers/factoryFinder.js +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/helpers/hardcoded.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/helpers/hardcoded.js +1 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/ownerFinder.d.ts +2 -0
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/helpers/ownerFinder.js +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/AaveProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/AnglesLiquid.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/AssetProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/AssetProcessor.js +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/AuraProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/BEXRewardGaugeProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/BalancerGaugeProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/BalancerPoolProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/BalancerV3PoolProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/BeefyProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/BunniV2Processor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/CompoundProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/ERC4626Processor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/EnzymeProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/EqualizerGaugeProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/EulerBorrowProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/EulerLendProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/FluidProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/FraxProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/FraxProcessor.js +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/GammaALMProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/GammaProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/GearboxProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/HanjiVaultProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/HoldStationProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/HourglassProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/MaverickBPProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/MetamorphoProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/NoLinkVaultProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/NoLinkVaultProcessor.js +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/PendleProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/PendleYTProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/RadiantProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/RfxProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/Satlayer.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/SpectraProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/SpectraProcessor.js +3 -3
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/SpectraYTProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/SpectraYTProcessor.js +3 -3
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/SpliceProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/SturdySiloProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/TempestVaultProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/TempestVaultProcessor.js +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/TemplateProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/TorosProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/UniswapProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/VicunaProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/WoofiProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/ZkSwapThreePoolProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/curveNPoolProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/curveProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/curveProcessor.js +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/processorMapping.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/processorMapping.js +3 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/stakedCurveProcessor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/stakedCurveProcessor.js +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/xU308Processor.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/subtypesPrices.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/subtypesPrices.js +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/subtypesRound1.js +5 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/subtypesRound2.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/subtypesRound3.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/subtypesRound4.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/tokenTypeStruct.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/tokenTypeToProtocolAndAction.d.ts +1 -1
- package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/tokenTypeToProtocolAndAction.js +3 -1
- package/dist/src/engine/{opportunityMetadata/implementations/Ajna.d.ts → implementations/Ajna/metadata.d.ts} +4 -3
- package/dist/src/engine/{opportunityMetadata/implementations/Ajna.js → implementations/Ajna/metadata.js} +4 -3
- package/dist/src/engine/implementations/Ajna/tvl.d.ts +7 -0
- package/dist/src/engine/{campaignTVL/implementations/Ajna.js → implementations/Ajna/tvl.js} +9 -9
- package/dist/src/engine/{opportunityMetadata/implementations/Ambient.d.ts → implementations/Ambient/metadata.d.ts} +4 -3
- package/dist/src/engine/{opportunityMetadata/implementations/Ambient.js → implementations/Ambient/metadata.js} +2 -1
- package/dist/src/engine/{campaignTVL/implementations/Ambiant.d.ts → implementations/Ambient/tvl.d.ts} +3 -3
- package/dist/src/engine/{campaignTVL/implementations/Ambiant.js → implementations/Ambient/tvl.js} +2 -2
- package/dist/src/engine/{opportunityMetadata/implementations/Badger.d.ts → implementations/Badger/metadata.d.ts} +4 -3
- package/dist/src/engine/{opportunityMetadata/implementations/Badger.js → implementations/Badger/metadata.js} +2 -1
- package/dist/src/engine/{opportunityMetadata/implementations/Clamm.d.ts → implementations/Clamm/metadata.d.ts} +4 -3
- package/dist/src/engine/{opportunityMetadata/implementations/Clamm.js → implementations/Clamm/metadata.js} +2 -1
- package/dist/src/engine/{opportunityMetadata/implementations/Compound.d.ts → implementations/Compound/metadata.d.ts} +5 -4
- package/dist/src/engine/{opportunityMetadata/implementations/Compound.js → implementations/Compound/metadata.js} +3 -2
- package/dist/src/engine/{opportunityMetadata/implementations/CompoundV3.d.ts → implementations/CompoundV3/metadata.d.ts} +5 -4
- package/dist/src/engine/{opportunityMetadata/implementations/CompoundV3.js → implementations/CompoundV3/metadata.js} +4 -3
- package/dist/src/engine/implementations/Default/metadata.d.ts +13 -0
- package/dist/src/engine/{opportunityMetadata/implementations/Default.js → implementations/Default/metadata.js} +3 -2
- package/dist/src/engine/{opportunityMetadata/implementations/Dolomite.d.ts → implementations/Dolomite/metadata.d.ts} +5 -4
- package/dist/src/engine/{opportunityMetadata/implementations/Dolomite.js → implementations/Dolomite/metadata.js} +3 -2
- package/dist/src/engine/{opportunityMetadata/implementations/EigenLayer.d.ts → implementations/EigenLayer/metadata.d.ts} +5 -4
- package/dist/src/engine/{opportunityMetadata/implementations/EigenLayer.js → implementations/EigenLayer/metadata.js} +2 -1
- package/dist/src/engine/implementations/Encompassing/metadata.d.ts +16 -0
- package/dist/src/engine/{opportunityMetadata/implementations/Encompassing.js → implementations/Encompassing/metadata.js} +4 -3
- package/dist/src/engine/implementations/Erc20/metadata.d.ts +29 -0
- package/dist/src/engine/{opportunityMetadata/implementations/Erc20/index.js → implementations/Erc20/metadata.js} +19 -14
- package/dist/src/engine/{campaignTVL/implementations/Erc20/computeSubTypes.d.ts → implementations/Erc20/subTypes/detect.d.ts} +2 -2
- package/dist/src/engine/{campaignTVL/implementations/Erc20/computeSubTypes.js → implementations/Erc20/subTypes/detect.js} +6 -6
- package/dist/src/engine/implementations/Erc20/subTypes/factories.d.ts +5 -0
- package/dist/src/engine/implementations/Erc20/subTypes/factories.js +33 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/metadata.d.ts +17 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/metadata.js +21 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/tvl.d.ts +6 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/tvl.js +43 -0
- package/dist/src/engine/{campaignTVL/implementations/Erc20/Erc20SubType.d.ts → implementations/Erc20/subTypes/index.d.ts} +2 -0
- package/dist/src/engine/{campaignTVL/implementations/Erc20/Erc20SubType.js → implementations/Erc20/subTypes/index.js} +2 -0
- package/dist/src/engine/implementations/Erc20/tvl.d.ts +6 -0
- package/dist/src/engine/implementations/Erc20/tvl.js +98 -0
- package/dist/src/engine/implementations/Erc20Snapshot/metadata.d.ts +15 -0
- package/dist/src/engine/{opportunityMetadata/implementations/Erc20Snapshot.js → implementations/Erc20Snapshot/metadata.js} +2 -1
- package/dist/src/engine/implementations/Erc721/metadata.d.ts +17 -0
- package/dist/src/engine/{opportunityMetadata/implementations/ERC721.js → implementations/Erc721/metadata.js} +3 -2
- package/dist/src/engine/implementations/ErcMultiToken/metadata.d.ts +29 -0
- package/dist/src/engine/{opportunityMetadata/implementations/ERCMultiToken.js → implementations/ErcMultiToken/metadata.js} +5 -4
- package/dist/src/engine/{opportunityMetadata/implementations/Euler.d.ts → implementations/Euler/metadata.d.ts} +4 -3
- package/dist/src/engine/{opportunityMetadata/implementations/Euler.js → implementations/Euler/metadata.js} +5 -4
- package/dist/src/engine/{opportunityMetadata/implementations/EventBased.d.ts → implementations/EventBased/metadata.d.ts} +4 -3
- package/dist/src/engine/{opportunityMetadata/implementations/EventBased.js → implementations/EventBased/metadata.js} +2 -1
- package/dist/src/engine/{opportunityMetadata/implementations/Hyperdrive.d.ts → implementations/Hyperdrive/metadata.d.ts} +4 -3
- package/dist/src/engine/{opportunityMetadata/implementations/Hyperdrive.js → implementations/Hyperdrive/metadata.js} +3 -2
- package/dist/src/engine/{opportunityMetadata/implementations/Invalid.d.ts → implementations/Invalid/metadata.d.ts} +1 -1
- package/dist/src/engine/{opportunityMetadata/implementations/Ion.d.ts → implementations/Ion/metadata.d.ts} +4 -4
- package/dist/src/engine/{opportunityMetadata/implementations/Ion.js → implementations/Ion/metadata.js} +2 -1
- package/dist/src/engine/implementations/JsonAirdrop/metadata.d.ts +24 -0
- package/dist/src/engine/{opportunityMetadata/implementations/JsonAirdrop.js → implementations/JsonAirdrop/metadata.js} +4 -3
- package/dist/src/engine/{opportunityMetadata/implementations/Morpho.d.ts → implementations/Morpho/metadata.d.ts} +4 -3
- package/dist/src/engine/{opportunityMetadata/implementations/Morpho.js → implementations/Morpho/metadata.js} +4 -1
- package/dist/src/engine/{opportunityMetadata/implementations/Radiant.d.ts → implementations/Radiant/metadata.d.ts} +5 -4
- package/dist/src/engine/{opportunityMetadata/implementations/Radiant.js → implementations/Radiant/metadata.js} +4 -1
- package/dist/src/engine/{opportunityMetadata/implementations/Silo.d.ts → implementations/Silo/metadata.d.ts} +5 -4
- package/dist/src/engine/{opportunityMetadata/implementations/Silo.js → implementations/Silo/metadata.js} +4 -1
- package/dist/src/engine/{opportunityMetadata/implementations/UniswapV4.d.ts → implementations/UniswapV4/metadata.d.ts} +4 -3
- package/dist/src/engine/{opportunityMetadata/implementations/UniswapV4.js → implementations/UniswapV4/metadata.js} +2 -1
- package/dist/src/engine/implementations/UniswapV4/tvl.d.ts +7 -0
- package/dist/src/engine/{campaignTVL/implementations/UniswapV4.js → implementations/UniswapV4/tvl.js} +11 -11
- package/dist/src/engine/{opportunityMetadata/implementations/Vest.d.ts → implementations/Vest/metadata.d.ts} +5 -4
- package/dist/src/engine/{opportunityMetadata/implementations/Vest.js → implementations/Vest/metadata.js} +3 -2
- package/dist/src/engine/metadata/factory.js +71 -0
- package/dist/src/engine/tvl/factory.d.ts +3 -0
- package/dist/src/engine/tvl/factory.js +23 -0
- package/dist/src/hooks/checkQueryAddressValidity.js +1 -1
- package/dist/src/hooks/checkQueryChainIdValidity.js +1 -1
- package/dist/src/index.d.ts +123 -80
- package/dist/src/jobs/dynamic-data.js +1 -1
- package/dist/src/jobs/update-analytics.js +290 -34
- package/dist/src/jobs/update-euler-vaults.js +1 -1
- package/dist/src/libs/computeFee.js +1 -1
- package/dist/src/libs/deprecated-merklv3/index.js +1 -1
- package/dist/src/libs/getTokensList.js +1 -1
- package/dist/src/libs/merklChainData.js +1 -1
- package/dist/src/libs/positions/EigenLayer/index.d.ts +1 -1
- package/dist/src/libs/positions/ajna/index.d.ts +1 -1
- package/dist/src/libs/positions/badger/index.d.ts +1 -1
- package/dist/src/libs/positions/clamm/index.js +3 -3
- package/dist/src/libs/positions/clamm/thegraph/fetchAlmPositions.js +1 -1
- package/dist/src/libs/positions/clamm/thegraph/fetchAmmPositions.js +1 -1
- package/dist/src/libs/positions/clamm/thegraph/fetchFarmedPositions.js +1 -1
- package/dist/src/libs/positions/compound/index.d.ts +1 -1
- package/dist/src/libs/positions/dolomite/index.d.ts +1 -1
- package/dist/src/libs/positions/erc20/index.d.ts +1 -1
- package/dist/src/libs/positions/erc20/index.js +0 -1
- package/dist/src/libs/positions/euler/index.d.ts +1 -1
- package/dist/src/libs/positions/euler/index.js +0 -1
- package/dist/src/libs/positions/index.js +1 -1
- package/dist/src/libs/positions/morpho/index.d.ts +1 -1
- package/dist/src/libs/positions/prepareFetch.js +1 -1
- package/dist/src/libs/positions/silo/index.d.ts +1 -1
- package/dist/src/libs/tokens/balances.d.ts +1 -1
- package/dist/src/libs/tokens/balances.js +1 -1
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +42 -15
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +7 -9
- package/dist/src/modules/v4/campaign/campaign.repository.js +20 -27
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +47 -17
- package/dist/src/modules/v4/campaign/campaign.service.js +51 -38
- package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +67 -22
- package/dist/src/modules/v4/campaign/campaign.test.controller.js +32 -9
- package/dist/src/modules/v4/chain/chain.controller.d.ts +3 -1
- package/dist/src/modules/v4/chain/chain.repository.d.ts +8 -2
- package/dist/src/modules/v4/chain/chain.repository.js +1 -2
- package/dist/src/modules/v4/chain/chain.service.d.ts +16 -2
- package/dist/src/modules/v4/chain/chain.service.js +3 -3
- package/dist/src/modules/v4/dynamicData/dynamicData.service.js +49 -13
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +4 -4
- package/dist/src/modules/v4/opportunity/opportunity.converter.d.ts +2 -1
- package/dist/src/modules/v4/opportunity/opportunity.converter.js +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +8 -8
- package/dist/src/modules/v4/opportunity/opportunity.service.js +16 -32
- package/dist/src/modules/v4/programPayload/programPayload.controller.d.ts +7 -7
- package/dist/src/modules/v4/programPayload/programPayload.model.d.ts +3 -3
- package/dist/src/modules/v4/programPayload/programPayload.model.js +2 -2
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +279 -4
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +295 -3
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +1 -1
- package/dist/src/modules/v4/protocol/protocol.model.js +1 -0
- package/dist/src/modules/v4/router.d.ts +123 -80
- package/dist/src/modules/v4/router.js +0 -2
- package/dist/src/modules/v4/uniswap/uniswap.service.js +1 -1
- package/dist/src/routes/v3/campaigns.js +3 -3
- package/dist/src/routes/v3/compoundV2.js +1 -1
- package/dist/src/routes/v3/createCampaign.js +1 -1
- package/dist/src/routes/v3/dolomite.js +1 -1
- package/dist/src/routes/v3/euler.js +1 -1
- package/dist/src/routes/v3/fetch.js +1 -1
- package/dist/src/routes/v3/lostyield.js +3 -3
- package/dist/src/routes/v3/merkl.js +2 -2
- package/dist/src/routes/v3/multiChainPositions.js +1 -1
- package/dist/src/routes/v3/overview.js +1 -1
- package/dist/src/routes/v3/poolInfo.js +2 -2
- package/dist/src/routes/v3/rewardsReport.js +1 -1
- package/dist/src/scripts/reparse-opportunities.js +5 -3
- package/dist/src/utils/decodeCalls.d.ts +1 -1
- package/dist/src/utils/decodeCalls.js +3 -1
- package/dist/src/utils/encodeCalls.d.ts +1 -1
- package/dist/src/utils/encodeCalls.js +3 -1
- package/dist/src/utils/error.d.ts +6 -6
- package/dist/src/utils/generateCardName.d.ts +1 -1
- package/dist/src/utils/generateCardName.js +3 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/engine/campaignTVL/factory.d.ts +0 -3
- package/dist/src/engine/campaignTVL/factory.js +0 -23
- package/dist/src/engine/campaignTVL/implementations/Ajna.d.ts +0 -7
- package/dist/src/engine/campaignTVL/implementations/Erc20/factory.d.ts +0 -3
- package/dist/src/engine/campaignTVL/implementations/Erc20/factory.js +0 -13
- package/dist/src/engine/campaignTVL/implementations/Erc20/index.d.ts +0 -6
- package/dist/src/engine/campaignTVL/implementations/Erc20/index.js +0 -34
- package/dist/src/engine/campaignTVL/implementations/UniswapV4.d.ts +0 -7
- package/dist/src/engine/dynamicData/implementations/CompoundV3.js +0 -69
- package/dist/src/engine/erc20SubTypeProcessors/helpers/ownerFinder.d.ts +0 -2
- package/dist/src/engine/opportunityMetadata/factory.js +0 -71
- package/dist/src/engine/opportunityMetadata/implementations/Default.d.ts +0 -13
- package/dist/src/engine/opportunityMetadata/implementations/ERC721.d.ts +0 -16
- package/dist/src/engine/opportunityMetadata/implementations/ERCMultiToken.d.ts +0 -28
- package/dist/src/engine/opportunityMetadata/implementations/Encompassing.d.ts +0 -15
- package/dist/src/engine/opportunityMetadata/implementations/Erc20/index.d.ts +0 -18
- package/dist/src/engine/opportunityMetadata/implementations/Erc20Snapshot.d.ts +0 -14
- package/dist/src/engine/opportunityMetadata/implementations/JsonAirdrop.d.ts +0 -23
- package/dist/src/entities/campaign.d.ts +0 -58
- package/dist/src/entities/campaign.js +0 -136
- package/dist/src/modules/v4/dynamicData/dynamicData.controller.d.ts +0 -51
- package/dist/src/modules/v4/dynamicData/dynamicData.controller.js +0 -19
- package/dist/src/modules/v4/dynamicData/dynamicData.repository.d.ts +0 -0
- package/dist/src/modules/v4/dynamicData/dynamicData.repository.js +0 -1
- package/dist/src/types/returnTypes.d.ts +0 -19
- package/dist/src/types/returnTypes.js +0 -1
- package/dist/src/types/utils.d.ts +0 -5
- package/dist/src/types/utils.js +0 -1
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/factory.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/factory.js +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Ajna.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Badger.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Badger.js +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Clamm.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Compound.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/CompoundV3.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Dolomite.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/ERC721.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/ERCMultiToken.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/EigenLayer.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Encompassing.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Encompassing.js +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Erc20Snapshot.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/EventBased.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Hyperdrive.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Hyperdrive.js +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Morpho.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Radiant.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Silo.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/UniswapV4.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/Vest.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/default.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/implementations/default.js +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/fetchA51Strategies.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/fetchClamInfo.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/fetchClamInfo.js +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/fetchLogs.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/fetchLogs.js +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/getCompV2ForksVaults.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/getCompV2ForksVaults.js +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/getContractCreationBlock.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/getContractCreationBlock.js +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/getDolomiteMarkets.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/getEulerV2Vaults.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/getFixedApr.d.ts +0 -0
- /package/dist/src/engine/{dynamicData → deprecated/dynamicData}/utils/getFixedApr.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/GenericProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/helpers/eulerVaultNames.d.ts +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/helpers/eulerVaultNames.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/helpers/getBlacklistedSupply.d.ts +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/helpers/getBlacklistedSupply.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/helpers/metamorphoTvl.d.ts +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/helpers/metamorphoTvl.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/helpers/spliceTVL.d.ts +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/helpers/spliceTVL.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/AaveProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/AnglesLiquid.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/AuraProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/BEXRewardGaugeProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/BalancerGaugeProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/BalancerPoolProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/BalancerV3PoolProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/BeefyProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/BunniV2Processor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/CompoundProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/ERC4626Processor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/EnzymeProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/EqualizerGaugeProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/EulerBorrowProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/EulerLendProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/FluidProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/GammaALMProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/GammaProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/GearboxProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/HanjiVaultProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/HoldStationProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/HourglassProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/MaverickBPProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/MetamorphoProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/PendleProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/PendleYTProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/RadiantProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/RfxProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/Satlayer.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/SpliceProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/SturdySiloProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/TemplateProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/TorosProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/UniswapProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/VicunaProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/WoofiProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/ZkSwapThreePoolProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/curveNPoolProcessor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/implementations/xU308Processor.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/subtypesRound1.d.ts +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/subtypesRound2.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/subtypesRound3.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/subtypesRound4.js +0 -0
- /package/dist/src/engine/{erc20SubTypeProcessors → deprecated/erc20SubTypeProcessors}/tokenTypeStruct.js +0 -0
- /package/dist/src/engine/{opportunityMetadata/implementations/Invalid.js → implementations/Invalid/metadata.js} +0 -0
- /package/dist/src/engine/{opportunityMetadata → metadata}/factory.d.ts +0 -0
@@ -6,30 +6,58 @@ import { RewardService } from "@/modules/v4/reward";
|
|
6
6
|
import { log } from "@/utils/logger";
|
7
7
|
import { Client } from "@notionhq/client";
|
8
8
|
const notion = new Client({ auth: process.env.NOTION_TOKEN });
|
9
|
-
const
|
10
|
-
const
|
11
|
-
const
|
12
|
-
const
|
13
|
-
const
|
14
|
-
const
|
15
|
-
const
|
9
|
+
const MONTHLY_REWARDS_BY_PROTOCOLS_DATABASE_ID = "1cacfed0d48c80c288acc906291a91c8";
|
10
|
+
const MONTHLY_REWARDS_BY_CHAINS_DATABASE_ID = "1cacfed0d48c805bb300fa8ae5633a2d";
|
11
|
+
const MONTHLY_REWARDS_BY_TYPES_DATABASE_ID = "1cbcfed0d48c80d7bdedf45c133cbf63";
|
12
|
+
const DAILY_REWARDS_BY_PROTOCOLS_DATABASE_ID = "1d2cfed0d48c80609835d8f54c891079";
|
13
|
+
const DAILY_REWARDS_BY_CHAINS_DATABASE_ID = "1d2cfed0d48c80689f09ea40757272f4";
|
14
|
+
const DAILY_REWARDS_BY_TYPES_DATABASE_ID = "1d2cfed0d48c801cb856db7083a9081a";
|
15
|
+
const MONTHLY_CAMPAIGNS_BY_CHAINS_DATABASE_ID = "1cbcfed0d48c8001b1ccf5c0900669ea";
|
16
|
+
const MONTHLY_CAMPAIGNS_BY_PROTOCOLS_DATABASE_ID = "1cecfed0d48c8066b016f580e54a6b33";
|
17
|
+
const MONTHLY_CAMPAIGNS_BY_TYPES_DATABASE_ID = "1cecfed0d48c80dcb6bccf3ac3889b5b";
|
18
|
+
const DAILY_CAMPAIGNS_BY_CHAINS_DATABASE_ID = "1d2cfed0d48c800fbfbee7dcf9e1e817";
|
19
|
+
const DAILY_CAMPAIGNS_BY_PROTOCOLS_DATABASE_ID = "1d2cfed0d48c802c9cccdd0cbe43e37e";
|
20
|
+
const DAILY_CAMPAIGNS_BY_TYPES_DATABASE_ID = "1d2cfed0d48c809dbb34e5a4605b8868";
|
21
|
+
const getPagesOfTheMonth = async (databaseId) => {
|
22
|
+
const now = new Date();
|
23
|
+
const firstDayOfMonth = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1, // Day 1 of the month
|
24
|
+
0, // 0 hours
|
25
|
+
0, // 0 minutes
|
26
|
+
0, // 0 seconds
|
27
|
+
0 // 0 milliseconds
|
28
|
+
));
|
16
29
|
const currentMonthPages = await notion.databases.query({
|
17
30
|
database_id: databaseId,
|
18
31
|
filter: {
|
19
32
|
property: "From",
|
20
33
|
date: {
|
21
|
-
equals:
|
34
|
+
equals: firstDayOfMonth.toISOString().split("T")[0],
|
22
35
|
},
|
23
36
|
},
|
24
37
|
});
|
25
38
|
return currentMonthPages.results;
|
26
39
|
};
|
40
|
+
const getPagesOfTheDay = async (databaseId) => {
|
41
|
+
const now = new Date();
|
42
|
+
const today = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), 0, 0, 0, 0));
|
43
|
+
const pagesOfTheDay = await notion.databases.query({
|
44
|
+
database_id: databaseId,
|
45
|
+
filter: {
|
46
|
+
property: "Date",
|
47
|
+
date: {
|
48
|
+
equals: today.toISOString().split("T")[0],
|
49
|
+
},
|
50
|
+
},
|
51
|
+
});
|
52
|
+
return pagesOfTheDay.results;
|
53
|
+
};
|
27
54
|
const main = async () => {
|
28
55
|
const chains = (await ChainService.findMany({})).reduce((prev, curr) => {
|
29
56
|
return Object.assign(prev, { [curr.id]: curr.name });
|
30
57
|
}, {});
|
31
|
-
const
|
32
|
-
const
|
58
|
+
const now = new Date();
|
59
|
+
const today = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), 0, 0, 0, 0)).getTime() / 1000;
|
60
|
+
const firstDayOfMonth = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1, // Day 1 of the month
|
33
61
|
0, // 0 hours
|
34
62
|
0, // 0 minutes
|
35
63
|
0, // 0 seconds
|
@@ -38,7 +66,7 @@ const main = async () => {
|
|
38
66
|
const promises = [
|
39
67
|
// ─── Rewards By Types ────────────────────────────────────────
|
40
68
|
CacheService.set(TTLPresets.DAY_1, RewardService.getTotalDistributedByType, firstDayOfMonth).then(async (result) => {
|
41
|
-
const currentMonthPages = await
|
69
|
+
const currentMonthPages = await getPagesOfTheMonth(MONTHLY_REWARDS_BY_TYPES_DATABASE_ID);
|
42
70
|
const promises = [];
|
43
71
|
// ─── Check If Page Already Exists ────────────────────
|
44
72
|
for (const type of Object.keys(result)) {
|
@@ -53,14 +81,14 @@ const main = async () => {
|
|
53
81
|
type: "number",
|
54
82
|
number: result[type],
|
55
83
|
},
|
56
|
-
To: { type: "date", date: { start:
|
84
|
+
To: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
57
85
|
},
|
58
86
|
}));
|
59
87
|
// ─── Else, Create It ─────────────────
|
60
88
|
}
|
61
89
|
else {
|
62
90
|
promises.push(notion.pages.create({
|
63
|
-
parent: { type: "database_id", database_id:
|
91
|
+
parent: { type: "database_id", database_id: MONTHLY_REWARDS_BY_TYPES_DATABASE_ID },
|
64
92
|
properties: {
|
65
93
|
Types: {
|
66
94
|
type: "title",
|
@@ -68,7 +96,7 @@ const main = async () => {
|
|
68
96
|
},
|
69
97
|
Rewards: { type: "number", number: result[type] },
|
70
98
|
From: { type: "date", date: { start: new Date(firstDayOfMonth * 1000).toISOString().split("T")[0] } },
|
71
|
-
To: { type: "date", date: { start:
|
99
|
+
To: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
72
100
|
},
|
73
101
|
}));
|
74
102
|
}
|
@@ -79,7 +107,7 @@ const main = async () => {
|
|
79
107
|
}),
|
80
108
|
// ─── Rewards By Chains ───────────────────────────────────────
|
81
109
|
CacheService.set(TTLPresets.DAY_1, RewardService.getTotalDistributedByChains, firstDayOfMonth).then(async (result) => {
|
82
|
-
const currentMonthPages = await
|
110
|
+
const currentMonthPages = await getPagesOfTheMonth(MONTHLY_REWARDS_BY_CHAINS_DATABASE_ID);
|
83
111
|
const promises = [];
|
84
112
|
for (const chain of Object.keys(result)) {
|
85
113
|
const page = currentMonthPages.find(page => "properties" in page &&
|
@@ -93,13 +121,13 @@ const main = async () => {
|
|
93
121
|
type: "number",
|
94
122
|
number: result[chain],
|
95
123
|
},
|
96
|
-
To: { type: "date", date: { start:
|
124
|
+
To: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
97
125
|
},
|
98
126
|
}));
|
99
127
|
}
|
100
128
|
else {
|
101
129
|
promises.push(notion.pages.create({
|
102
|
-
parent: { type: "database_id", database_id:
|
130
|
+
parent: { type: "database_id", database_id: MONTHLY_REWARDS_BY_CHAINS_DATABASE_ID },
|
103
131
|
properties: {
|
104
132
|
Chains: {
|
105
133
|
type: "title",
|
@@ -107,7 +135,7 @@ const main = async () => {
|
|
107
135
|
},
|
108
136
|
Rewards: { type: "number", number: result[chain] },
|
109
137
|
From: { type: "date", date: { start: new Date(firstDayOfMonth * 1000).toISOString().split("T")[0] } },
|
110
|
-
To: { type: "date", date: { start:
|
138
|
+
To: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
111
139
|
},
|
112
140
|
}));
|
113
141
|
}
|
@@ -117,7 +145,7 @@ const main = async () => {
|
|
117
145
|
}),
|
118
146
|
// ─── Rewards By Protocols ────────────────────────────────────
|
119
147
|
CacheService.set(TTLPresets.DAY_1, RewardService.getTotalDistributedByProtocol, firstDayOfMonth).then(async (result) => {
|
120
|
-
const currentMonthPages = await
|
148
|
+
const currentMonthPages = await getPagesOfTheMonth(MONTHLY_REWARDS_BY_PROTOCOLS_DATABASE_ID);
|
121
149
|
const promises = [];
|
122
150
|
for (const protocol of Object.keys(result)) {
|
123
151
|
const page = currentMonthPages.find(page => "properties" in page &&
|
@@ -131,13 +159,13 @@ const main = async () => {
|
|
131
159
|
type: "number",
|
132
160
|
number: result[page.properties.Protocols.title[0].text.content],
|
133
161
|
},
|
134
|
-
To: { type: "date", date: { start:
|
162
|
+
To: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
135
163
|
},
|
136
164
|
}));
|
137
165
|
}
|
138
166
|
else {
|
139
167
|
promises.push(notion.pages.create({
|
140
|
-
parent: { type: "database_id", database_id:
|
168
|
+
parent: { type: "database_id", database_id: MONTHLY_REWARDS_BY_PROTOCOLS_DATABASE_ID },
|
141
169
|
properties: {
|
142
170
|
Protocols: { type: "title", title: [{ type: "text", text: { content: protocol } }] },
|
143
171
|
Rewards: { type: "number", number: result[protocol] },
|
@@ -145,7 +173,43 @@ const main = async () => {
|
|
145
173
|
type: "date",
|
146
174
|
date: { start: new Date(firstDayOfMonth * 1000).toISOString().split("T")[0] },
|
147
175
|
},
|
148
|
-
To: { type: "date", date: { start:
|
176
|
+
To: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
177
|
+
},
|
178
|
+
}));
|
179
|
+
}
|
180
|
+
}
|
181
|
+
await Promise.all(promises);
|
182
|
+
log.info("Total Distributed by Protocols data pushed to Notion successfully");
|
183
|
+
}),
|
184
|
+
// ─── Daily Rewards ───────────────────────────────────────────
|
185
|
+
CacheService.set(TTLPresets.DAY_1, RewardService.getTotalDistributedByProtocol, today).then(async (result) => {
|
186
|
+
const pagesOfTheDay = await getPagesOfTheDay(DAILY_REWARDS_BY_PROTOCOLS_DATABASE_ID);
|
187
|
+
const promises = [];
|
188
|
+
for (const protocol of Object.keys(result)) {
|
189
|
+
const page = pagesOfTheDay.find(page => "properties" in page &&
|
190
|
+
page.properties.Protocols.title[0].text.content === protocol);
|
191
|
+
if (page) {
|
192
|
+
promises.push(notion.pages.update({
|
193
|
+
page_id: page.id,
|
194
|
+
properties: {
|
195
|
+
Rewards: {
|
196
|
+
type: "number",
|
197
|
+
number: result[page.properties.Protocols.title[0].text.content],
|
198
|
+
},
|
199
|
+
Date: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
200
|
+
},
|
201
|
+
}));
|
202
|
+
}
|
203
|
+
else {
|
204
|
+
promises.push(notion.pages.create({
|
205
|
+
parent: { type: "database_id", database_id: DAILY_REWARDS_BY_PROTOCOLS_DATABASE_ID },
|
206
|
+
properties: {
|
207
|
+
Protocols: { type: "title", title: [{ type: "text", text: { content: protocol } }] },
|
208
|
+
Rewards: { type: "number", number: result[protocol] },
|
209
|
+
Date: {
|
210
|
+
type: "date",
|
211
|
+
date: { start: now.toISOString().split("T")[0] },
|
212
|
+
},
|
149
213
|
},
|
150
214
|
}));
|
151
215
|
}
|
@@ -153,11 +217,88 @@ const main = async () => {
|
|
153
217
|
await Promise.all(promises);
|
154
218
|
log.info("Total Distributed by Protocols data pushed to Notion successfully");
|
155
219
|
}),
|
220
|
+
// ─── By Chains ───────────────────────────────────────────────
|
221
|
+
CacheService.set(TTLPresets.DAY_1, RewardService.getTotalDistributedByChains, today).then(async (result) => {
|
222
|
+
const pagesOfTheDay = await getPagesOfTheDay(DAILY_REWARDS_BY_CHAINS_DATABASE_ID);
|
223
|
+
const promises = [];
|
224
|
+
for (const chain of Object.keys(result)) {
|
225
|
+
const page = pagesOfTheDay.find(page => "properties" in page &&
|
226
|
+
page.properties.Chains.title[0].text.content ===
|
227
|
+
chains[chain]);
|
228
|
+
if (page) {
|
229
|
+
promises.push(notion.pages.update({
|
230
|
+
page_id: page.id,
|
231
|
+
properties: {
|
232
|
+
Rewards: {
|
233
|
+
type: "number",
|
234
|
+
number: result[chain],
|
235
|
+
},
|
236
|
+
Date: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
237
|
+
},
|
238
|
+
}));
|
239
|
+
}
|
240
|
+
else {
|
241
|
+
promises.push(notion.pages.create({
|
242
|
+
parent: { type: "database_id", database_id: DAILY_REWARDS_BY_CHAINS_DATABASE_ID },
|
243
|
+
properties: {
|
244
|
+
Chains: {
|
245
|
+
type: "title",
|
246
|
+
title: [{ type: "text", text: { content: chains[chain] } }],
|
247
|
+
},
|
248
|
+
Rewards: { type: "number", number: result[chain] },
|
249
|
+
Date: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
250
|
+
},
|
251
|
+
}));
|
252
|
+
}
|
253
|
+
}
|
254
|
+
await Promise.all(promises);
|
255
|
+
log.info("Total Distributed by Chains data pushed to Notion successfully");
|
256
|
+
}),
|
257
|
+
// ─── Daily Rewards By Types ──────────────────────────────────
|
258
|
+
CacheService.set(TTLPresets.DAY_1, RewardService.getTotalDistributedByType, today).then(async (result) => {
|
259
|
+
const currentMonthPages = await getPagesOfTheDay(DAILY_REWARDS_BY_TYPES_DATABASE_ID);
|
260
|
+
const promises = [];
|
261
|
+
// ─── Check If Page Already Exists ────────────────────
|
262
|
+
for (const type of Object.keys(result)) {
|
263
|
+
const page = currentMonthPages.find(page => "properties" in page &&
|
264
|
+
page.properties.Types.title[0].text.content === type);
|
265
|
+
// ─── If Page Exists, Update It ───────────────
|
266
|
+
if (page) {
|
267
|
+
promises.push(notion.pages.update({
|
268
|
+
page_id: page.id,
|
269
|
+
properties: {
|
270
|
+
Rewards: {
|
271
|
+
type: "number",
|
272
|
+
number: result[type],
|
273
|
+
},
|
274
|
+
Date: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
275
|
+
},
|
276
|
+
}));
|
277
|
+
// ─── Else, Create It ─────────────────
|
278
|
+
}
|
279
|
+
else {
|
280
|
+
promises.push(notion.pages.create({
|
281
|
+
parent: { type: "database_id", database_id: DAILY_REWARDS_BY_TYPES_DATABASE_ID },
|
282
|
+
properties: {
|
283
|
+
Types: {
|
284
|
+
type: "title",
|
285
|
+
title: [{ type: "text", text: { content: type } }],
|
286
|
+
},
|
287
|
+
Rewards: { type: "number", number: result[type] },
|
288
|
+
Date: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
289
|
+
},
|
290
|
+
}));
|
291
|
+
}
|
292
|
+
}
|
293
|
+
// ─── Run All The Promises In Parallel ────────────────
|
294
|
+
await Promise.all(promises);
|
295
|
+
log.info("Total Distributed by Types data pushed to Notion successfully");
|
296
|
+
}),
|
156
297
|
// ─── Campaigns ───────────────────────────────────────────────
|
157
298
|
CacheService.set(TTLPresets.DAY_1, CampaignService.countByChains, {
|
158
299
|
createdAfter: new Date(firstDayOfMonth * 1000),
|
159
300
|
}).then(async (result) => {
|
160
|
-
const currentMonthPages = await
|
301
|
+
const currentMonthPages = await getPagesOfTheMonth(MONTHLY_CAMPAIGNS_BY_CHAINS_DATABASE_ID);
|
161
302
|
const promises = [];
|
162
303
|
for (const chain of Object.keys(result)) {
|
163
304
|
const page = currentMonthPages.find(page => "properties" in page &&
|
@@ -171,13 +312,13 @@ const main = async () => {
|
|
171
312
|
type: "number",
|
172
313
|
number: result[Object.keys(chains).find(key => page.properties.Chains.title[0].text.content === chains[key])],
|
173
314
|
},
|
174
|
-
To: { type: "date", date: { start:
|
315
|
+
To: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
175
316
|
},
|
176
317
|
}));
|
177
318
|
}
|
178
319
|
else {
|
179
320
|
promises.push(notion.pages.create({
|
180
|
-
parent: { type: "database_id", database_id:
|
321
|
+
parent: { type: "database_id", database_id: MONTHLY_CAMPAIGNS_BY_CHAINS_DATABASE_ID },
|
181
322
|
properties: {
|
182
323
|
Chains: {
|
183
324
|
type: "title",
|
@@ -188,7 +329,7 @@ const main = async () => {
|
|
188
329
|
type: "date",
|
189
330
|
date: { start: new Date(firstDayOfMonth * 1000).toISOString().split("T")[0] },
|
190
331
|
},
|
191
|
-
To: { type: "date", date: { start:
|
332
|
+
To: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
192
333
|
},
|
193
334
|
}));
|
194
335
|
}
|
@@ -200,7 +341,7 @@ const main = async () => {
|
|
200
341
|
CacheService.set(TTLPresets.DAY_1, CampaignService.countByProtocols, {
|
201
342
|
createdAfter: new Date(firstDayOfMonth * 1000),
|
202
343
|
}).then(async (result) => {
|
203
|
-
const currentMonthPages = await
|
344
|
+
const currentMonthPages = await getPagesOfTheMonth(MONTHLY_CAMPAIGNS_BY_PROTOCOLS_DATABASE_ID);
|
204
345
|
const promises = [];
|
205
346
|
for (const protocol of Object.keys(result)) {
|
206
347
|
const page = currentMonthPages.find(page => "properties" in page &&
|
@@ -213,13 +354,13 @@ const main = async () => {
|
|
213
354
|
type: "number",
|
214
355
|
number: result[page.properties.Protocols.title[0].text.content],
|
215
356
|
},
|
216
|
-
To: { type: "date", date: { start:
|
357
|
+
To: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
217
358
|
},
|
218
359
|
}));
|
219
360
|
}
|
220
361
|
else {
|
221
362
|
promises.push(notion.pages.create({
|
222
|
-
parent: { type: "database_id", database_id:
|
363
|
+
parent: { type: "database_id", database_id: MONTHLY_CAMPAIGNS_BY_PROTOCOLS_DATABASE_ID },
|
223
364
|
properties: {
|
224
365
|
Protocols: {
|
225
366
|
type: "title",
|
@@ -227,7 +368,7 @@ const main = async () => {
|
|
227
368
|
},
|
228
369
|
Campaigns: { type: "number", number: result[protocol] },
|
229
370
|
From: { type: "date", date: { start: new Date(firstDayOfMonth * 1000).toISOString().split("T")[0] } },
|
230
|
-
To: { type: "date", date: { start:
|
371
|
+
To: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
231
372
|
},
|
232
373
|
}));
|
233
374
|
}
|
@@ -239,7 +380,7 @@ const main = async () => {
|
|
239
380
|
CacheService.set(TTLPresets.DAY_1, CampaignService.countByTypes, {
|
240
381
|
createdAfter: new Date(firstDayOfMonth * 1000),
|
241
382
|
}).then(async (result) => {
|
242
|
-
const currentMonthPages = await
|
383
|
+
const currentMonthPages = await getPagesOfTheMonth(MONTHLY_CAMPAIGNS_BY_TYPES_DATABASE_ID);
|
243
384
|
const promises = [];
|
244
385
|
for (const type of Object.keys(result)) {
|
245
386
|
const page = currentMonthPages.find(page => "properties" in page &&
|
@@ -252,13 +393,13 @@ const main = async () => {
|
|
252
393
|
type: "number",
|
253
394
|
number: result[page.properties.Types.title[0].text.content],
|
254
395
|
},
|
255
|
-
To: { type: "date", date: { start:
|
396
|
+
To: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
256
397
|
},
|
257
398
|
}));
|
258
399
|
}
|
259
400
|
else {
|
260
401
|
promises.push(notion.pages.create({
|
261
|
-
parent: { type: "database_id", database_id:
|
402
|
+
parent: { type: "database_id", database_id: MONTHLY_CAMPAIGNS_BY_TYPES_DATABASE_ID },
|
262
403
|
properties: {
|
263
404
|
Types: {
|
264
405
|
type: "title",
|
@@ -269,7 +410,122 @@ const main = async () => {
|
|
269
410
|
type: "date",
|
270
411
|
date: { start: new Date(firstDayOfMonth * 1000).toISOString().split("T")[0] },
|
271
412
|
},
|
272
|
-
To: { type: "date", date: { start:
|
413
|
+
To: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
414
|
+
},
|
415
|
+
}));
|
416
|
+
}
|
417
|
+
}
|
418
|
+
await Promise.all(promises);
|
419
|
+
log.info("Campaigns by Types data pushed to Notion successfully");
|
420
|
+
}),
|
421
|
+
// ─── Daily Campaigns ─────────────────────────────────────────
|
422
|
+
CacheService.set(TTLPresets.DAY_1, CampaignService.countByChains, {
|
423
|
+
createdAfter: new Date(today * 1000),
|
424
|
+
}).then(async (result) => {
|
425
|
+
const currentMonthPages = await getPagesOfTheDay(DAILY_CAMPAIGNS_BY_CHAINS_DATABASE_ID);
|
426
|
+
const promises = [];
|
427
|
+
for (const chain of Object.keys(result)) {
|
428
|
+
const page = currentMonthPages.find(page => "properties" in page &&
|
429
|
+
page.properties.Chains.title[0].text.content ===
|
430
|
+
chains[chain]);
|
431
|
+
if (page) {
|
432
|
+
promises.push(notion.pages.update({
|
433
|
+
page_id: page.id,
|
434
|
+
properties: {
|
435
|
+
Campaigns: {
|
436
|
+
type: "number",
|
437
|
+
number: result[Object.keys(chains).find(key => page.properties.Chains.title[0].text.content === chains[key])],
|
438
|
+
},
|
439
|
+
Date: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
440
|
+
},
|
441
|
+
}));
|
442
|
+
}
|
443
|
+
else {
|
444
|
+
promises.push(notion.pages.create({
|
445
|
+
parent: { type: "database_id", database_id: DAILY_CAMPAIGNS_BY_CHAINS_DATABASE_ID },
|
446
|
+
properties: {
|
447
|
+
Chains: {
|
448
|
+
type: "title",
|
449
|
+
title: [{ type: "text", text: { content: chains[chain] } }],
|
450
|
+
},
|
451
|
+
Campaigns: { type: "number", number: result[chain] },
|
452
|
+
Date: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
453
|
+
},
|
454
|
+
}));
|
455
|
+
}
|
456
|
+
}
|
457
|
+
await Promise.all(promises);
|
458
|
+
log.info("Campaigns by Chains data pushed to Notion successfully");
|
459
|
+
}),
|
460
|
+
// ─── Daily New Campaigns By Protocols ────────────────────────
|
461
|
+
CacheService.set(TTLPresets.DAY_1, CampaignService.countByProtocols, {
|
462
|
+
createdAfter: new Date(today * 1000),
|
463
|
+
}).then(async (result) => {
|
464
|
+
const currentMonthPages = await getPagesOfTheDay(DAILY_CAMPAIGNS_BY_PROTOCOLS_DATABASE_ID);
|
465
|
+
const promises = [];
|
466
|
+
for (const protocol of Object.keys(result)) {
|
467
|
+
const page = currentMonthPages.find(page => "properties" in page &&
|
468
|
+
page.properties.Protocols.title[0].text.content === protocol);
|
469
|
+
if (page) {
|
470
|
+
promises.push(notion.pages.update({
|
471
|
+
page_id: page.id,
|
472
|
+
properties: {
|
473
|
+
Campaigns: {
|
474
|
+
type: "number",
|
475
|
+
number: result[page.properties.Protocols.title[0].text.content],
|
476
|
+
},
|
477
|
+
Date: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
478
|
+
},
|
479
|
+
}));
|
480
|
+
}
|
481
|
+
else {
|
482
|
+
promises.push(notion.pages.create({
|
483
|
+
parent: { type: "database_id", database_id: DAILY_CAMPAIGNS_BY_PROTOCOLS_DATABASE_ID },
|
484
|
+
properties: {
|
485
|
+
Protocols: {
|
486
|
+
type: "title",
|
487
|
+
title: [{ type: "text", text: { content: protocol } }],
|
488
|
+
},
|
489
|
+
Campaigns: { type: "number", number: result[protocol] },
|
490
|
+
Date: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
491
|
+
},
|
492
|
+
}));
|
493
|
+
}
|
494
|
+
}
|
495
|
+
await Promise.all(promises);
|
496
|
+
log.info("Campaigns by Protocols data pushed to Notion successfully");
|
497
|
+
}),
|
498
|
+
// ─── Daily Campaigns By Types ────────────────────────────────
|
499
|
+
CacheService.set(TTLPresets.DAY_1, CampaignService.countByTypes, {
|
500
|
+
createdAfter: new Date(today * 1000),
|
501
|
+
}).then(async (result) => {
|
502
|
+
const currentMonthPages = await getPagesOfTheDay(DAILY_CAMPAIGNS_BY_TYPES_DATABASE_ID);
|
503
|
+
const promises = [];
|
504
|
+
for (const type of Object.keys(result)) {
|
505
|
+
const page = currentMonthPages.find(page => "properties" in page &&
|
506
|
+
page.properties.Types.title[0].text.content === type);
|
507
|
+
if (page) {
|
508
|
+
promises.push(notion.pages.update({
|
509
|
+
page_id: page.id,
|
510
|
+
properties: {
|
511
|
+
Campaigns: {
|
512
|
+
type: "number",
|
513
|
+
number: result[page.properties.Types.title[0].text.content],
|
514
|
+
},
|
515
|
+
Date: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
516
|
+
},
|
517
|
+
}));
|
518
|
+
}
|
519
|
+
else {
|
520
|
+
promises.push(notion.pages.create({
|
521
|
+
parent: { type: "database_id", database_id: DAILY_CAMPAIGNS_BY_TYPES_DATABASE_ID },
|
522
|
+
properties: {
|
523
|
+
Types: {
|
524
|
+
type: "title",
|
525
|
+
title: [{ type: "text", text: { content: type } }],
|
526
|
+
},
|
527
|
+
Campaigns: { type: "number", number: result[type] },
|
528
|
+
Date: { type: "date", date: { start: now.toISOString().split("T")[0] } },
|
273
529
|
},
|
274
530
|
}));
|
275
531
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { getEulerV2Vaults, updateEulerVaultsCollatInDatabase } from "@/engine/dynamicData/utils/getEulerV2Vaults";
|
1
|
+
import { getEulerV2Vaults, updateEulerVaultsCollatInDatabase, } from "@/engine/deprecated/dynamicData/utils/getEulerV2Vaults";
|
2
2
|
import { CacheService } from "@/modules/v4/cache";
|
3
3
|
import { TTLPresets } from "@/modules/v4/cache/cache.model";
|
4
4
|
import { logger } from "@/utils/logger";
|
@@ -1,6 +1,6 @@
|
|
1
|
+
import { batchMulticallCallWithRetry } from "@/utils/generic";
|
1
2
|
import { BASE_9, DistributionCreatorInterface, registry, } from "@sdk";
|
2
3
|
import { BigNumber } from "ethers";
|
3
|
-
import { batchMulticallCallWithRetry } from "../utils/generic";
|
4
4
|
export const computeFee = async (chainId, config) => {
|
5
5
|
if (!config.creator) {
|
6
6
|
throw new Error("Creator is required");
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { Redis } from "@/cache";
|
2
2
|
import { RewardConvertorService } from "@/modules/v4/reward/reward.converter";
|
3
|
+
import { log } from "@/utils/logger";
|
3
4
|
import { AMM, ANGLE_NETWORKS, Campaign, NETWORK_LABELS, } from "@sdk";
|
4
5
|
import Big from "big.js";
|
5
6
|
import { utils } from "ethers";
|
6
|
-
import { log } from "../../utils/logger";
|
7
7
|
const fetchCachedData = async (chainIds, onlyLive) => {
|
8
8
|
if (onlyLive === undefined) {
|
9
9
|
onlyLive = false;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { Redis } from "@/cache";
|
2
2
|
import { TokenService } from "@/modules/v4/token/token.service";
|
3
|
+
import { batchMulticallCallWithRetry } from "@/utils/generic";
|
3
4
|
import { Interface } from "@ethersproject/abi";
|
4
5
|
import { BN2Number, DistributionCreator__factory, Distributor__factory, NETWORK_LABELS, NULL_ADDRESS, registry, } from "@sdk";
|
5
|
-
import { batchMulticallCallWithRetry } from "../utils/generic";
|
6
6
|
const DistributorInterface = Distributor__factory.createInterface();
|
7
7
|
const DistributorCreatorInterface = DistributionCreator__factory.createInterface();
|
8
8
|
const MTW_INTERFACE = new Interface([
|
@@ -1,5 +1,5 @@
|
|
1
|
+
import type { UncachedResult } from "@/utils/execute";
|
1
2
|
import { type MerklChainId } from "@sdk";
|
2
|
-
import type { UncachedResult } from "../../../utils/execute";
|
3
3
|
import type { EigenLayerFetchedCampaign, PositionType } from "../types";
|
4
4
|
export declare function getEigenLayerUserPositions(user: string, _chainId: MerklChainId, campaigns: {
|
5
5
|
[mainparameter: string]: EigenLayerFetchedCampaign;
|
@@ -1,5 +1,5 @@
|
|
1
|
+
import type { UncachedResult } from "@/utils/execute";
|
1
2
|
import { type MerklChainId } from "@sdk";
|
2
|
-
import type { UncachedResult } from "../../../utils/execute";
|
3
3
|
import type { AjnaFetchedCampaign, PositionType } from "../types";
|
4
4
|
export declare function getAjnaUserPositions(user: string, _chainId: MerklChainId, campaigns: {
|
5
5
|
[mainparameter: string]: AjnaFetchedCampaign;
|
@@ -1,5 +1,5 @@
|
|
1
|
+
import type { UncachedResult } from "@/utils/execute";
|
1
2
|
import { type MerklChainId } from "@sdk";
|
2
|
-
import type { UncachedResult } from "../../../utils/execute";
|
3
3
|
import type { BadgerFetchedCampaign, PositionType } from "../types";
|
4
4
|
export declare function getBadgerUserPositions(user: string, _chainId: MerklChainId, campaigns: {
|
5
5
|
[mainparameter: string]: BadgerFetchedCampaign;
|
@@ -2,12 +2,12 @@
|
|
2
2
|
import { CacheService } from "@/modules/v4/cache";
|
3
3
|
import { TTLPresets } from "@/modules/v4/cache/cache.model";
|
4
4
|
import { ChainInteractionService } from "@/modules/v4/chainInteraction/chainInteraction.service";
|
5
|
+
import { log } from "@/utils/logger";
|
6
|
+
import { Pricer } from "@/utils/pricer";
|
7
|
+
import { providers } from "@/utils/providers";
|
5
8
|
import { ALM, AMMAlgorithmMapping, BN2Number, NETWORK_LABELS, NFTManagerAddress, NonFungiblePositionManagerInterface, PoolInterface, PoolState, SqrtPrice, YEAR, getAmountsForLiquidity, getSupportedNFPWrapperMapping, getTickAtSqrtRatio, spNFTInterface, } from "@sdk";
|
6
9
|
import { BigNumber, Contract, utils } from "ethers";
|
7
10
|
import JSBI from "jsbi";
|
8
|
-
import { log } from "../../../utils/logger";
|
9
|
-
import { Pricer } from "../../../utils/pricer";
|
10
|
-
import { providers } from "../../../utils/providers";
|
11
11
|
import { fetchAlmPositions } from "./thegraph/fetchAlmPositions";
|
12
12
|
import { fetchAmmPositions } from "./thegraph/fetchAmmPositions";
|
13
13
|
import { fetchFarmedPositions } from "./thegraph/fetchFarmedPositions";
|
@@ -1,10 +1,10 @@
|
|
1
|
+
import { log } from "@/utils/logger";
|
1
2
|
// @ts-nocheck
|
2
3
|
import { ALM, NETWORK_LABELS, merklSubgraphALMEndpoints, withTimeout } from "@sdk";
|
3
4
|
import { BigNumber } from "ethers";
|
4
5
|
import { request } from "graphql-request";
|
5
6
|
import { almBalancesQuery, almNFTBalancesQuery } from ".";
|
6
7
|
import { MERKL_USER_POSITION_FETCHING_TIMEOUT } from "../../../../constants";
|
7
|
-
import { log } from "../../../../utils/logger";
|
8
8
|
export async function fetchAlmPositions(chainId, user) {
|
9
9
|
const res = {};
|
10
10
|
const availableALMEndpoints = merklSubgraphALMEndpoints[chainId];
|
@@ -1,9 +1,9 @@
|
|
1
|
+
import { log } from "@/utils/logger";
|
1
2
|
// @ts-nocheck
|
2
3
|
import { AMM, NETWORK_LABELS, merklSubgraphAMMEndpoints, withTimeout } from "@sdk";
|
3
4
|
import { request } from "graphql-request";
|
4
5
|
import { positionsQuery } from ".";
|
5
6
|
import { MERKL_USER_POSITION_FETCHING_TIMEOUT } from "../../../../constants";
|
6
|
-
import { log } from "../../../../utils/logger";
|
7
7
|
export async function fetchAmmPositions(chainId, user, amms) {
|
8
8
|
const res = {};
|
9
9
|
const promises = amms.map(async (amm) => {
|
@@ -1,9 +1,9 @@
|
|
1
1
|
// @ts-nocheck
|
2
2
|
import { MERKL_USER_POSITION_FETCHING_TIMEOUT } from "@/constants";
|
3
|
+
import { log } from "@/utils/logger";
|
3
4
|
import { AMM, NETWORK_LABELS, getSupportedNFPWrapperMapping, merklSubgraphNFPWrapperEndpoints, withTimeout, } from "@sdk";
|
4
5
|
import { request } from "graphql-request";
|
5
6
|
import { nftWrapperPositionsQuery } from ".";
|
6
|
-
import { log } from "../../../../utils/logger";
|
7
7
|
export async function fetchFarmedPositions(chainId, owners, amm) {
|
8
8
|
const res = {};
|
9
9
|
const promises = getSupportedNFPWrapperMapping(chainId, amm).map(async (wrapper) => {
|
@@ -1,5 +1,5 @@
|
|
1
|
+
import type { UncachedResult } from "@/utils/execute";
|
1
2
|
import { type Forwarder, type ForwarderParameters, type MerklChainId } from "@sdk";
|
2
|
-
import type { UncachedResult } from "../../../utils/execute";
|
3
3
|
type FetchedCampaign = {
|
4
4
|
rewardToken: string;
|
5
5
|
symbolRewardToken: string;
|
@@ -1,5 +1,5 @@
|
|
1
|
+
import type { UncachedResult } from "@/utils/execute";
|
1
2
|
import type { MerklChainId } from "@sdk";
|
2
|
-
import type { UncachedResult } from "../../../utils/execute";
|
3
3
|
import type { DolomitePositionFetchingDataType } from "../prepareFetch";
|
4
4
|
export type DolomitePositionType = {
|
5
5
|
[mainParameter: string]: {
|