@merkl/api 0.10.203 → 0.10.205
Sign up to get free protection for your applications and to get access to all the features.
@@ -311,7 +311,7 @@ export class RewardService {
|
|
311
311
|
for (const { amount, rewardToken: address, chainId, startTimestamp: start, endTimestamp: end, campaignId, } of dynamicData) {
|
312
312
|
const timespan = Math.abs(end - start);
|
313
313
|
const dayspan = Math.max(1, Math.floor(timespan / (60 * 60 * 24)));
|
314
|
-
const dailyAmount = moment.
|
314
|
+
const dailyAmount = moment().unix() <= end && moment().unix() >= start ? BigInt(amount) / BigInt(dayspan) : BigInt(0);
|
315
315
|
const campaignDailyValue = await TokenService.getValue([{ amount: dailyAmount, address, chainId }]);
|
316
316
|
breakdowns.push({
|
317
317
|
campaignId: CampaignService.hashId({ campaignId, distributionChain: chainId }),
|
@@ -9,7 +9,7 @@ const fetchPoolData = async (poolAddress, chainId) => {
|
|
9
9
|
const poolContract = UniswapV3Pool__factory.connect(poolAddress.toLowerCase(), providers[chainId]);
|
10
10
|
const izumiContract = IzumiPool__factory.connect(poolAddress.toLowerCase(), providers[chainId]);
|
11
11
|
try {
|
12
|
-
let poolName = "
|
12
|
+
let poolName = "";
|
13
13
|
const factory = await poolContract.factory();
|
14
14
|
let found = false;
|
15
15
|
for (const amm in AMM) {
|
@@ -80,7 +80,7 @@ export const query = t.Object({
|
|
80
80
|
chainId: t.Numeric(),
|
81
81
|
poolAddress: t.String(),
|
82
82
|
});
|
83
|
-
export default (app) => app.use(checkQueryChainIdValidity()).get("", async ({ query }) => {
|
83
|
+
export default (app) => app.use(checkQueryChainIdValidity()).get("/poolInfo", async ({ query }) => {
|
84
84
|
return await fetchPoolData(query.poolAddress, query.chainId);
|
85
85
|
}, {
|
86
86
|
query,
|