Skip to content

Commit ac1faae

Browse files
kinsyudevvrtnd
authored andcommitted
Fix Mayan volume (#422)
* set up mayan adapter * Add Mayan adapter and integrate event fetching and volume calculation * Refactor Mayan event fetching to use API key and improve error handling; streamline volume calculation logic * deleted pnpm lock yaml * removed old comment * Refactor Mayan event fetching to use secure API endpoint and improve error handling; update handler export for scheduled execution * added missing filters to process batch * fixed double counting txs, removed pricing from mayan's API and added correct chain assignments * Fixed mayan volume amounts
1 parent 6b5e47c commit ac1faae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/aggregate.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,10 @@ export const aggregateData = async (
355355
if (priceData && (priceData.confidence === undefined || priceData.confidence >= defaultConfidenceThreshold)) {
356356
const { price, decimals } = priceData;
357357
let bnAmount = null;
358-
if (transformedDecimals) {
358+
// mayan adapter stores amount already formatted as decimals
359+
if (bridgeDbName === "mayan") {
360+
bnAmount = rawBnAmount;
361+
} else if (transformedDecimals) {
359362
bnAmount = rawBnAmount.dividedBy(10 ** Number(transformedDecimals));
360363
} else {
361364
bnAmount = rawBnAmount.dividedBy(10 ** Number(decimals));

0 commit comments

Comments
 (0)