Selaa lähdekoodia

完善 zks主网数据请求方式更改

million 1 vuosi sitten
vanhempi
commit
c982f4621b
28 muutettua tiedostoa jossa 1390 lisäystä ja 29 poistoa
  1. 80 0
      src/utils/getZksyncData/getActivity.js
  2. 30 0
      src/utils/getZksyncData/getBridge.js
  3. 29 0
      src/utils/getZksyncData/getEthBalance.js
  4. 9 0
      src/utils/getZksyncData/getFee.js
  5. 53 0
      src/utils/getZksyncData/getProtocol.js
  6. 136 0
      src/utils/getZksyncData/getTransactionList.js
  7. 29 0
      src/utils/getZksyncData/getTxCount.js
  8. 15 0
      src/utils/getZksyncData/getVolume.js
  9. 26 0
      src/utils/getZksyncData/getZksEra.js
  10. 69 0
      src/utils/getZksyncData/getZksLite.js
  11. 37 0
      src/utils/getZksyncData/index.js
  12. 52 0
      src/utils/getZksyncData/procotols/countTransactionPeriods.js
  13. 53 0
      src/utils/getZksyncData/procotols/goal3.js
  14. 49 0
      src/utils/getZksyncData/procotols/holdstation.js
  15. 59 0
      src/utils/getZksyncData/procotols/izumi.js
  16. 51 0
      src/utils/getZksyncData/procotols/maverick.js
  17. 51 0
      src/utils/getZksyncData/procotols/muteio.js
  18. 53 0
      src/utils/getZksyncData/procotols/onchaintrade.js
  19. 54 0
      src/utils/getZksyncData/procotols/orbiter.js
  20. 71 0
      src/utils/getZksyncData/procotols/rollup.js
  21. 57 0
      src/utils/getZksyncData/procotols/spacefi.js
  22. 46 0
      src/utils/getZksyncData/procotols/starmaker.js
  23. 56 0
      src/utils/getZksyncData/procotols/syncswap.js
  24. 51 0
      src/utils/getZksyncData/procotols/velocore.js
  25. 45 0
      src/utils/getZksyncData/procotols/zksynceraportal.js
  26. 44 0
      src/utils/getZksyncData/procotols/zksyncid.js
  27. 46 0
      src/utils/getZksyncData/procotols/zksyncnameservices.js
  28. 39 29
      src/views/HomeView.vue

+ 80 - 0
src/utils/getZksyncData/getActivity.js

@@ -0,0 +1,80 @@
+const getTimeAgo = (date) => {
+    const seconds = (new Date().getTime() - new Date(date).getTime()) / 1000;
+
+    if (seconds < 60) {
+        return Math.round(seconds)
+    }
+
+    const minutes = seconds / 60;
+    if (minutes < 60) {
+        return Math.round(minutes)
+    }
+
+    const hours = minutes / 60;
+    if (hours < 24) {
+        return Math.round(hours)
+    }
+
+    const days = hours / 24;
+    return Math.round(days)
+};
+const getWeekNumber = (date) => {
+    const year = date.getFullYear();
+    const oneJan = new Date(year, 0, 1);
+    const dayIndex = (date.getDay() + 6) % 7;
+    const daysSinceFirstDay = Math.floor((date.getTime() - oneJan.getTime()) / 86400000);
+    const weekIndex = Math.floor((daysSinceFirstDay + oneJan.getDay() - dayIndex) / 7);
+
+    return `${year}-${weekIndex}`;
+};
+const countAllTransactionPeriods = (address, transactions) => {
+    const uniqueDays = new Set();
+    const uniqueWeeks = new Set();
+    const uniqueMonths = new Set();
+    const uniqueContracts = new Set();
+    console.log('transactions',transactions);
+    transactions.forEach((transaction) => {
+        if (transaction.from.toLowerCase() !== address.toLowerCase()) return;
+        const timestamp = new Date(transaction.receivedAt);
+        const year = timestamp.getFullYear();
+        const month = timestamp.getMonth();
+        const day = timestamp.getDate();
+        const week = getWeekNumber(timestamp);
+
+        uniqueDays.add(`${year}-${month}-${day}`);
+        uniqueWeeks.add(`${year}-${week}`);
+        uniqueMonths.add(`${year}-${month}`);
+        uniqueContracts.add(transaction.to);
+    });
+    return {
+        dayActivity: uniqueDays.size,
+        weekActivity: uniqueWeeks.size,
+        monthActivity: uniqueMonths.size,
+        contractActivity: uniqueContracts.size,
+    };
+};
+
+export const getActivities = async (address, transactions) => {
+    if (transactions.length === 0) return ({
+        dayActivity: 0,
+        weekActivity: 0,
+        monthActivity: 0,
+        contractActivity: 0,
+        zks2_last_tx: '无交易',
+    })
+    const {
+        dayActivity,
+        weekActivity,
+        monthActivity,
+        contractActivity
+    } = countAllTransactionPeriods(address, transactions);
+    const lastTransaction = transactions[0];
+    const zks2_last_tx = getTimeAgo(lastTransaction.receivedAt) || '无交易';
+    return {
+        dayActivity,
+        weekActivity,
+        monthActivity,
+        contractActivity,
+        zks2_last_tx,
+    }
+}

+ 30 - 0
src/utils/getZksyncData/getBridge.js

@@ -0,0 +1,30 @@
+import {ethers} from "ethers";
+
+export const getBridge = (transaction, address) => {
+    let l1Tol2Times = 0;
+    let l1Tol2Amount = 0;
+    let l2Tol1Times = 0;
+    let l2Tol1Amount = 0;
+    transaction.forEach((transaction) => {
+        const fromAddress = transaction.from;
+        const toAddress = transaction.to;
+        const isL1Originated = transaction.isL1Originated;
+        if (fromAddress.toLowerCase() !== address.toLowerCase()) return;
+        if (isL1Originated) {
+            l1Tol2Times++;
+            const value = ethers.formatEther(transaction.value);
+            l1Tol2Amount += parseFloat(value);
+        }
+        if (toAddress.toLowerCase() === "0x000000000000000000000000000000000000800A".toLowerCase()) {
+            l2Tol1Times++;
+            const value = ethers.formatEther(transaction.value);
+            l2Tol1Amount += parseFloat(value);
+        }
+    })
+    return {
+        l1Tol2Times,
+        l1Tol2Amount: l1Tol2Amount.toFixed(3),
+        l2Tol1Times,
+        l2Tol1Amount: l2Tol1Amount.toFixed(3),
+    }
+}

+ 29 - 0
src/utils/getZksyncData/getEthBalance.js

@@ -0,0 +1,29 @@
+import axios from 'axios';
+
+const RPC_MAP = {
+    "ethereum": "https://cloudflare-eth.com",
+    "optimism": "https://optimism-mainnet.public.blastapi.io",
+    "arbitrum": "https://rpc.ankr.com/arbitrum",
+    "polygon": "https://polygon-bor.publicnode.com",
+    "bsc": "https://bscrpc.com"
+};
+
+export async function getEthBalance(walletAddress, network) {
+    try {
+        let rpcLink = RPC_MAP[network];
+        if (!rpcLink) {
+            return "Error: Invalid Network Name";
+        }
+        const response = await axios.post(rpcLink, {
+            jsonrpc: "2.0",
+            method: "eth_getBalance",
+            params: [walletAddress, "latest"],
+            id: 1
+        });
+        let balance = response.data.result;
+        return (parseInt(balance, 16) / 10 ** 18).toFixed(3);
+    } catch (error) {
+        console.error(error);
+        return "Error";
+    }
+}

+ 9 - 0
src/utils/getZksyncData/getFee.js

@@ -0,0 +1,9 @@
+export const getFee = async (transactions) => {
+    let fee = 0;
+    transactions.forEach((transaction) => {
+        const tmpFees = parseInt(transaction.fee, 16) * 10 ** -18 * transaction.ethValue;
+        fee += tmpFees;
+    });
+    return fee.toFixed(2);
+}
+

+ 53 - 0
src/utils/getZksyncData/getProtocol.js

@@ -0,0 +1,53 @@
+import {SyncSwap} from "@/utils/getZksyncData/procotols/syncswap.js";
+import {Goal3} from "@/utils/getZksyncData/procotols/goal3.js";
+import {Holdstation} from "@/utils/getZksyncData/procotols/holdstation.js";
+import {IzumiFinance} from "@/utils/getZksyncData/procotols/izumi.js";
+import {Maverick} from "@/utils/getZksyncData/procotols/maverick.js";
+import {Mute} from "@/utils/getZksyncData/procotols/muteio.js";
+import {OnchainTrade} from "@/utils/getZksyncData/procotols/onchaintrade.js";
+import {Orbiter} from "@/utils/getZksyncData/procotols/orbiter.js";
+import {Rollup} from "@/utils/getZksyncData/procotols/rollup.js";
+import {SpaceFi} from "@/utils/getZksyncData/procotols/spacefi.js";
+import {Starmaker} from "@/utils/getZksyncData/procotols/starmaker.js";
+import {Velocore} from "@/utils/getZksyncData/procotols/velocore.js";
+import {ZkSyncEraPortal} from "@/utils/getZksyncData/procotols/zksynceraportal.js";
+import {ZkSyncId} from "@/utils/getZksyncData/procotols/zksyncid.js";
+import {ZkSyncNameService} from "@/utils/getZksyncData/procotols/zksyncnameservices.js";
+
+export const getPrtocol = async (transactions, address) => {
+    const syncSwap = SyncSwap.getProtocolsState(transactions, address);
+    const goal3 = Goal3.getProtocolsState(transactions, address);
+    const holdstation = Holdstation.getProtocolsState(transactions, address);
+    const iIzumiFinance = IzumiFinance.getProtocolsState(transactions, address);
+    const maverick = Maverick.getProtocolsState(transactions, address);
+    const mute = Mute.getProtocolsState(transactions, address);
+    const onchainTrade = OnchainTrade.getProtocolsState(transactions, address);
+    const orbiter = Orbiter.getProtocolsState(transactions, address);
+    const rollup = Rollup.getProtocolsState(transactions, address);
+    const spaceFi = SpaceFi.getProtocolsState(transactions, address);
+    const starmaker = Starmaker.getProtocolsState(transactions, address);
+    const velocore = Velocore.getProtocolsState(transactions, address);
+    const zksyncportal = ZkSyncEraPortal.getProtocolsState(transactions, address);
+    const zksyncid = ZkSyncId.getProtocolsState(transactions, address);
+    const zksyncnameservices = ZkSyncNameService.getProtocolsState(transactions, address);
+
+    // 使用 Promise.all 并行执行所有的异步操作
+    return await Promise.all([
+        syncSwap,
+        goal3,
+        holdstation,
+        iIzumiFinance,
+        maverick,
+        mute,
+        onchainTrade,
+        orbiter,
+        rollup,
+        spaceFi,
+        starmaker,
+        velocore,
+        zksyncportal,
+        zksyncid,
+        zksyncnameservices
+    ]);
+}
+

+ 136 - 0
src/utils/getZksyncData/getTransactionList.js

@@ -0,0 +1,136 @@
+import axios from 'axios';
+// import {getEthPrice} from "@/utils";
+// export const getTokenList = async (address) => {
+//     try {
+//         const response = await axios.get(`https://zksync2-mainnet.zkscan.io/api?module=account&action=tokenlist&address=${address}`);
+//         return response.data.result;
+//     } catch (err) {
+//         console.log(err);
+//         return [];
+//     }
+// };
+const getEthPrice = async () => {
+    try {
+        const options = {
+            method: 'GET',
+            url: 'https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd',
+        }
+        let response = await axios.request(options)
+        return response.data['ethereum']['usd']
+    } catch (e) {
+        console.log(e)
+        return 0
+    }
+
+}
+
+const getAllTransfers = async (address) => {
+    let url = `https://block-explorer-api.mainnet.zksync.io/address/${address}/transfers?limit=100&page=1`;
+    const transfers = [];
+
+    while (true) {
+        try {
+            const response = await axios.get(url);
+            if (response.status === 200) {
+                const data = response.data.items;
+                transfers.push(...data);
+                if (response.data.links.next === '') break;
+                url = 'https://block-explorer-api.mainnet.zksync.io/' + response.data.links.next;
+            } else {
+                console.error('Error occurred while retrieving transactions.');
+                break;
+            }
+        } catch (error) {
+            console.error('Error occurred while making the request:', error);
+            break;
+        }
+    }
+
+    return transfers;
+};
+
+const assignTransferValues = async (transactions) => {
+    const ethResponse = await axios.post('https://mainnet.era.zksync.io/', {
+        id: 42,
+        jsonrpc: '2.0',
+        method: 'zks_getTokenPrice',
+        params: ['0x0000000000000000000000000000000000000000'],
+    });
+    // const ethResponse = await getEthPrice();
+    const tokensPrice = {
+        USDC: 1,
+        USDT: 1,
+        ZKUSD: 1,
+        CEBUSD: 1,
+        LUSD: 1,
+        ETH: parseInt(ethResponse.data.result),
+    };
+
+    transactions.forEach((transaction) => {
+        transaction.transfers.forEach((transfer) => {
+            transfer.token.price = tokensPrice[transfer.token.symbol.toUpperCase()];
+        });
+        transaction.transfers = transaction.transfers.filter((transfer) => transfer.token.price !== undefined);
+    });
+};
+
+export const getTransactionsList = async (address) => {
+    let url = `https://block-explorer-api.mainnet.zksync.io/transactions?address=${address}&limit=100&page=1`;
+    const transactions = [];
+
+    // const ethResponse = await axios.post('https://mainnet.era.zksync.io/', {
+    //     id: 42,
+    //     jsonrpc: '2.0',
+    //     method: 'zks_getTokenPrice',
+    //     params: ['0x0000000000000000000000000000000000000000'],
+    // });
+    const ethResponse = await getEthPrice();
+    while (true) {
+        try {
+            const response = await axios.get(url);
+            if (response.status === 200) {
+                const data = response.data.items;
+                data.forEach((transaction) => {
+                    const {hash, to, from, data, isL1Originated, fee, receivedAt, value} = transaction;
+                    transactions.push({
+                        hash: hash,
+                        to: to,
+                        from: from,
+                        data: data,
+                        isL1Originated: isL1Originated,
+                        fee: fee,
+                        receivedAt: receivedAt,
+                        transfers: [],
+                        ethValue: parseInt(ethResponse),
+                        value: value,
+                    });
+                });
+
+                if (response.data.links.next === '') break;
+                url = 'https://block-explorer-api.mainnet.zksync.io/' + response.data.links.next;
+            } else {
+                console.error('Error occurred while retrieving transactions.');
+                break;
+            }
+        } catch (error) {
+            console.error('Error occurred while making the request:', error);
+            break;
+        }
+    }
+
+    const transfers = await getAllTransfers(address);
+
+    transfers.forEach((transfer) => {
+        if (transfer.token === null) return;
+        transactions.forEach((transaction) => {
+            if (transaction.hash === transfer.transactionHash) {
+                transaction.transfers.push(transfer);
+            }
+        });
+    });
+
+    await assignTransferValues(transactions);
+
+    return transactions;
+};
+

+ 29 - 0
src/utils/getZksyncData/getTxCount.js

@@ -0,0 +1,29 @@
+import axios from 'axios';
+
+const RPC_MAP = {
+    "ethereum": "https://cloudflare-eth.com",
+    "optimism": "https://optimism-mainnet.public.blastapi.io",
+    "arbitrum": "https://rpc.ankr.com/arbitrum",
+    "polygon": "https://polygon-bor.publicnode.com",
+    "bsc": "https://bscrpc.com"
+};
+
+export async function getTxCount(address, network) {
+    try {
+        let rpcLink = RPC_MAP[network];
+        if (!rpcLink) {
+            return "Error: Invalid Network Name";
+        }
+        const response = await axios.post(rpcLink, {
+            jsonrpc: "2.0",
+            method: "eth_getTransactionCount",
+            params: [address, "latest"],
+            id: 1
+        });
+        const transactionCountHex = response.data.result;
+        return parseInt(transactionCountHex, 16);
+    } catch (error) {
+        console.error(error);
+        return "Error";
+    }
+}

+ 15 - 0
src/utils/getZksyncData/getVolume.js

@@ -0,0 +1,15 @@
+export const getVolume = (transactions) => {
+    let volume = 0;
+    transactions.forEach((transaction) => {
+        const transfers = transaction.transfers.sort(
+            (a, b) =>
+                parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price,
+        );
+        if (transfers.length === 0) return;
+        const tmpVolume = parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+        volume += tmpVolume;
+    });
+    return volume.toFixed(2);
+}
+

+ 26 - 0
src/utils/getZksyncData/getZksEra.js

@@ -0,0 +1,26 @@
+import axios from "axios";
+
+export async function getZksEra(address) {
+    try {
+        let url = "https://block-explorer-api.mainnet.zksync.io/address/" + address;
+        const response = await axios.get(url);
+        let zks2_tx_amount, zks2_balance, zks2_usdcBalance;
+        if ("0x000000000000000000000000000000000000800A" in response.data.balances) {
+            zks2_balance = response.data.balances["0x000000000000000000000000000000000000800A"].balance;
+            zks2_balance = (Number(zks2_balance) / 10 ** 18).toFixed(3);
+        } else {
+            zks2_balance = 0;
+        }
+        if ("0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4" in response.data.balances) {
+            zks2_usdcBalance = response.data.balances["0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4"].balance;
+            zks2_usdcBalance = (Number(zks2_usdcBalance) / 10 ** 6).toFixed(2);
+        } else {
+            zks2_usdcBalance = 0;
+        }
+        zks2_tx_amount = response.data.sealedNonce;
+        return {zks2_balance, zks2_tx_amount, zks2_usdcBalance};
+    } catch (error) {
+        console.error(error);
+        return {zks2_balance: "-", zks2_tx_amount: "-", zks2_usdcBalance: "-"};
+    }
+}

+ 69 - 0
src/utils/getZksyncData/getZksLite.js

@@ -0,0 +1,69 @@
+import axios from "axios";
+
+const getTimeAgo = (date) => {
+    const seconds = (new Date().getTime() - new Date(date).getTime()) / 1000;
+
+    if (seconds < 60) {
+        return Math.round(seconds)
+    }
+
+    const minutes = seconds / 60;
+    if (minutes < 60) {
+        return Math.round(minutes)
+    }
+
+    const hours = minutes / 60;
+    if (hours < 24) {
+        return Math.round(hours)
+    }
+
+    const days = hours / 24;
+    return Math.round(days)
+};
+
+async function getLatestTx(address) {
+    try {
+        const response = await axios.get(`https://api.zksync.io/api/v0.2/accounts/${address}/transactions`, {
+            params: {
+                'from': 'latest',
+                'limit': '25',
+                'direction': 'older'
+            },
+        });
+        const txs = response.data;
+        if (txs.result.list.length === 0) {
+            return '无交易'
+        } else {
+            return getTimeAgo(txs.result.list[0]['createdAt']);
+        }
+    } catch (error) {
+        console.log(error)
+        return '-';
+    }
+}
+
+export async function getZksLite(address) {
+    try {
+        let url = "https://api.zksync.io/jsrpc"
+        const response = await axios.post(url, {
+            'id': 1,
+            'jsonrpc': '2.0',
+            'method': 'account_info',
+            'params': [
+                address
+            ]
+        });
+        let zks1_balance
+        if ("ETH" in response.data.result.committed.balances) {
+            zks1_balance = (response.data.result.committed.balances.ETH / 10 ** 18).toFixed(3)
+        } else {
+            zks1_balance = 0;
+        }
+        let zks1_tx_amount = response.data.result.committed.nonce;
+        let zks1_latest_tx = await getLatestTx(address);
+        return {zks1_balance, zks1_tx_amount, zks1_latest_tx};
+    } catch (error) {
+        console.error(error);
+        return {zks1_balance: "-", zks1_tx_amount: "-", zks1_latest_tx: "-"};
+    }
+}

+ 37 - 0
src/utils/getZksyncData/index.js

@@ -0,0 +1,37 @@
+import {getTransactionsList} from "@/utils/getZksyncData/getTransactionList.js";
+import {getFee} from "@/utils/getZksyncData/getFee.js";
+import {getVolume} from "@/utils/getZksyncData/getVolume.js";
+import {getActivities} from "@/utils/getZksyncData/getActivity.js";
+import {getPrtocol} from "@/utils/getZksyncData/getProtocol.js";
+import {getZksEra} from "@/utils/getZksyncData/getZksEra.js";
+// import {getZksLite} from "@/utils/getZksyncData/getZksLite.js";
+import {getEthBalance} from "@/utils/getZksyncData/getEthBalance.js";
+import {getTxCount} from "@/utils/getZksyncData/getTxCount.js";
+import {getBridge} from "@/utils/getZksyncData/getBridge.js";
+
+export const getAllZksSyncData = async (address) => {
+    const transactions = await getTransactionsList(address);
+    const fee = await getFee(transactions);
+    const volume = getVolume(transactions);
+    const activity = await getActivities(address, transactions);
+    const protocol = await getPrtocol(transactions, address);
+    const zksEraBalance = await getZksEra(address);
+    // const zksLiteBalance = await getZksLite(address);
+    const ethBalance = await getEthBalance(address, "ethereum");
+    const tx = await getTxCount(address, "ethereum");
+    const bridge = getBridge(transactions, address);
+    const result = {
+        totalFee: fee,
+        totalExchangeAmount: volume,
+        ...activity,
+        protocol: [...protocol],
+        ...zksEraBalance,
+        // ...zksLiteBalance,
+        eth_balance: ethBalance,
+        eth_tx_amount: tx,
+        ...bridge,
+        overTimeArr:transactions
+    }
+    // console.log("result", result)
+    return result;
+}

+ 52 - 0
src/utils/getZksyncData/procotols/countTransactionPeriods.js

@@ -0,0 +1,52 @@
+const getWeekNumber = (date) => {
+    const year = date.getFullYear();
+    const oneJan = new Date(year, 0, 1);
+    const dayIndex = (date.getDay() + 6) % 7;
+    const daysSinceFirstDay = Math.floor((date.getTime() - oneJan.getTime()) / 86400000);
+    const weekIndex = Math.floor((daysSinceFirstDay + oneJan.getDay() - dayIndex) / 7);
+
+    return `${year}-${weekIndex}`;
+};
+export const countTransactionPeriods = (
+    address,
+    transactions,
+    protocol,
+    addresses = [],
+) => {
+    address;
+    protocol;
+    const uniqueDays = new Set();
+    const uniqueWeeks = new Set();
+    const uniqueMonths = new Set();
+    transactions.forEach((transaction) => {
+        if (
+            protocol !== 'zksynceraportal' &&
+            !addresses.includes(transaction.to.toLowerCase()) &&
+            !addresses.includes(transaction.from.toLowerCase())
+        )
+            return;
+
+        if (protocol === 'zksynceraportal') {
+            if (
+                !transaction.data.startsWith('0x51cff8d9') &&
+                !(transaction.to.toLowerCase() === address.toLowerCase() && transaction.isL1Originated)
+            )
+                return;
+        }
+        const timestamp = new Date(transaction.receivedAt);
+        const year = timestamp.getFullYear();
+        const month = timestamp.getMonth();
+        const day = timestamp.getDate();
+        const week = getWeekNumber(timestamp);
+
+        uniqueDays.add(`${year}-${month}-${day}`);
+        uniqueWeeks.add(`${year}-${week}`);
+        uniqueMonths.add(`${year}-${month}`);
+    });
+
+    return {
+        days: uniqueDays.size,
+        weeks: uniqueWeeks.size,
+        months: uniqueMonths.size,
+    };
+};

+ 53 - 0
src/utils/getZksyncData/procotols/goal3.js

@@ -0,0 +1,53 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+const goal3Addresses = [
+    '0xd2ca21df45479824f954a6e1759d436a57d63faf',
+    '0x1f090f91ee09768ca36dcd52640f4a5eae146555',
+    '0xc523df658dbec88dc03fb23a703bcbd7ffb5ea01',
+    '0x116a4a5ed4c7d5712e109d4188e17616d8e5784a',
+    '0x8d123a2a0a7c98555931ceda6917b865b7345164',
+];
+
+export const Goal3 = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'Goal3',
+            id: 'goal3',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://beta.goal3.xyz/',
+            tag: 'Gasless',
+        };
+
+        transactions.forEach((transaction) => {
+            if (goal3Addresses.includes(transaction.to.toLowerCase())) {
+                if (transaction.data.startsWith('0xbd95e4f1')) {
+                    const zkUsdValue = parseInt(transaction.data.slice(-64), 16) * 10 ** -6;
+                    protocolState.volume += zkUsdValue;
+                } else {
+                    const transfers = transaction.transfers.sort(
+                        (a, b) =>
+                            parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                            parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price
+                    );
+
+                    if (transfers.length === 0) return;
+                    protocolState.volume +=
+                        parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+                }
+                protocolState.interactions += 1;
+
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(address, transactions, protocolState.id, goal3Addresses).days;
+
+        return protocolState;
+    },
+};

+ 49 - 0
src/utils/getZksyncData/procotols/holdstation.js

@@ -0,0 +1,49 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+const holdstationAddresses = [
+    '0x7b4872e2096ec9410b6b8c8b7d039589e6ee8022',
+    '0xaf08a9d918f16332f22cf8dc9abe9d9e14ddcbc2',
+];
+
+export const Holdstation = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'Holdstation',
+            id: 'holdstation',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://holdstation.exchange/',
+        };
+
+        transactions.forEach((transaction) => {
+            if (holdstationAddresses.includes(transaction.to.toLowerCase())) {
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+                protocolState.interactions += 1;
+
+                const transfers = transaction.transfers.sort(
+                    (a, b) =>
+                        parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                        parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price
+                );
+
+                if (transfers.length === 0) return;
+                protocolState.volume +=
+                    parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(
+            address,
+            transactions,
+            protocolState.id,
+            holdstationAddresses
+        ).days;
+
+        return protocolState;
+    },
+};

+ 59 - 0
src/utils/getZksyncData/procotols/izumi.js

@@ -0,0 +1,59 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+const izumiFinanceAddresses = [
+    '0x33d9936b7b7bc155493446b5e6ddc0350eb83aec',
+    '0x7499ce9c8f4ff47be5dd5308ab54cc710de751e1',
+    '0xbc94aedd2a0a986476b89e072b05e0df117a3f8b',
+    '0xc319755dff1601b3d0520b421a281b11bf22e80f',
+    '0x8df80089b7ab1646db211d43949ecdfc94582011',
+    '0x0066f3791bd9d5a25d88f978dd8e1006445fe0d6',
+    '0x377ec7c9ae5a0787f384668788a1654249059dd6',
+    '0x3ec82c07981d6d213da9bd35a0ba4cd324fea438',
+    '0x9606ec131eec0f84c95d82c9a63959f2331cf2ac',
+    '0x936c9a1b8f88bfdbd5066ad08e5d773bc82eb15f',
+    '0x8b9d7d609a83b2f69d2135786a7d230043af7283',
+    '0x7dee7de9814ed6c1e20b3e4e2fa9b1b96e15fde1',
+];
+
+export const IzumiFinance = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'iZUMi finance',
+            id: 'izumi',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://izumi.finance/home',
+        };
+
+        transactions.forEach((transaction) => {
+            if (izumiFinanceAddresses.includes(transaction.to.toLowerCase())) {
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+                protocolState.interactions += 1;
+
+                const transfers = transaction.transfers.sort(
+                    (a, b) =>
+                        parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                        parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price
+                );
+
+                if (transfers.length === 0) return;
+                protocolState.volume +=
+                    parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(
+            address,
+            transactions,
+            protocolState.id,
+            izumiFinanceAddresses
+        ).days;
+
+        return protocolState;
+    },
+};

+ 51 - 0
src/utils/getZksyncData/procotols/maverick.js

@@ -0,0 +1,51 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+const maverickAddresses = [
+    '0xfd54762d435a490405dda0fbc92b7168934e8525',
+    '0x852639ee9dd090d30271832332501e87d287106c',
+    '0x77ee88b1c9cce741ec35553730eb1f19cd45a379',
+    '0x39e098a153ad69834a9dac32f0fca92066ad03f4',
+];
+
+export const Maverick = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'Maverick',
+            id: 'maverick',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://app.mav.xyz/',
+        };
+
+        transactions.forEach((transaction) => {
+            if (maverickAddresses.includes(transaction.to.toLowerCase())) {
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+                protocolState.interactions += 1;
+
+                const transfers = transaction.transfers.sort(
+                    (a, b) =>
+                        parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                        parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price
+                );
+
+                if (transfers.length === 0) return;
+                protocolState.volume +=
+                    parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(
+            address,
+            transactions,
+            protocolState.id,
+            maverickAddresses
+        ).days;
+
+        return protocolState;
+    },
+};

+ 51 - 0
src/utils/getZksyncData/procotols/muteio.js

@@ -0,0 +1,51 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+const muteRouter = '0x8b791913eb07c32779a16750e3868aa8495f5964';
+
+const mutePools = [
+    '0xdfaab828f5f515e104baaba4d8d554da9096f0e4',
+    '0xb85feb6af3412d690dfda280b73eaed73a2315bc',
+];
+
+export const Mute = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'Mute.io',
+            id: 'muteio',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://mute.io/',
+        };
+
+        transactions.forEach((transaction) => {
+            if (muteRouter.includes(transaction.to.toLowerCase()) || mutePools.includes(transaction.to.toLowerCase())) {
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+                protocolState.interactions += 1;
+
+                const transfers = transaction.transfers.sort(
+                    (a, b) =>
+                        parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                        parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price
+                );
+
+                if (transfers.length === 0) return;
+                protocolState.volume +=
+                    parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(
+            address,
+            transactions,
+            protocolState.id,
+            mutePools.concat([muteRouter])
+        ).days;
+
+        return protocolState;
+    },
+};

+ 53 - 0
src/utils/getZksyncData/procotols/onchaintrade.js

@@ -0,0 +1,53 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+const onchainTradeAddresses = [
+    '0x84c18204c30da662562b7a2c79397c9e05f942f0',
+    '0xca806b267fc0c1c12edbf77a2e5bca5939c7d953',
+    '0xaa08a6d7b10724d03b8f4857d4fa14e7f92814e3',
+    '0x10c8044ae3f2b1c7decb439ff2dc1164d750c39d',
+    '0xe676b11421d68a28ba50920f2841183af93067a2',
+    '0x6219f06135b79705d34f5261852e9f6b98821e1f',
+];
+
+export const OnchainTrade = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'Onchain Trade',
+            id: 'onchaintrade',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://onchain.trade/',
+        };
+
+        transactions.forEach((transaction) => {
+            if (onchainTradeAddresses.includes(transaction.to.toLowerCase())) {
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+                protocolState.interactions += 1;
+
+                const transfers = transaction.transfers.sort(
+                    (a, b) =>
+                        parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                        parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price
+                );
+
+                if (transfers.length === 0) return;
+                protocolState.volume +=
+                    parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(
+            address,
+            transactions,
+            protocolState.id,
+            onchainTradeAddresses
+        ).days;
+
+        return protocolState;
+    },
+};

+ 54 - 0
src/utils/getZksyncData/procotols/orbiter.js

@@ -0,0 +1,54 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+const orbiterRouters = [
+    '0xe4edb277e41dc89ab076a1f049f4a3efa700bce8',
+    '0x80c67432656d59144ceff962e8faf8926599bcf8',
+    '0xee73323912a4e3772b74ed0ca1595a152b0ef282',
+    '0x0a88BC5c32b684D467b43C06D9e0899EfEAF59Df',
+];
+
+export const Orbiter = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'Orbiter Finance',
+            id: 'orbiter',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://orbiter.finance/',
+        };
+
+        transactions.forEach((transaction) => {
+            if (
+                orbiterRouters.includes(transaction.to.toLowerCase()) ||
+                orbiterRouters.includes(transaction.from.toLowerCase())
+            ) {
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+                protocolState.interactions += 1;
+
+                const transfers = transaction.transfers.sort(
+                    (a, b) =>
+                        parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                        parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price,
+                );
+
+                if (transfers.length === 0) return;
+                protocolState.volume +=
+                    parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(
+            address,
+            transactions,
+            protocolState.id,
+            orbiterRouters,
+        ).days;
+
+        return protocolState;
+    },
+};

+ 71 - 0
src/utils/getZksyncData/procotols/rollup.js

@@ -0,0 +1,71 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+const rollupAddresses = [
+    '0xefde2aefe307a7362c7e0e3be019d1491dc7e163',
+    '0xba5f1898f3af43e30b552cac559f11f5d5a2fd1e',
+    '0xf9895dcb26c60743fce3ae54f506c47b763693bb',
+    '0xbbca935fb05d8671b8875293c2d82df73105ac60',
+    '0xc8db02c5900de3ed03139e9ec62a84b2f5e06d7f',
+    '0xc2e9dfb2fded2139b0b60c6781b4c648f1385c16',
+    '0x0ed4a1c66fcdf17341177422e73ca919284e040c',
+    '0x015d01187a77055fadb96c63a9de9f8981e3d0f5',
+    '0x9eb48ce91a77ff37f2edd032c90d7ec6a953b4fd',
+    '0x1f79cce5b8876a07541900e681b31a8e51766b5a',
+    '0xf77ded0ae91c41c432555beb25da2a6658338e5a',
+    '0xcc8b6c37fb97bdc774f0ea7f8b047e8ee057458c',
+    '0xc05c6a229c6ed34b9d31c88421d70ef71fbaabcf',
+    '0xf35eb225803ccf6ffb64be531bb91132a9229196',
+    '0x277e57e33c92c7f145832274384eeef35828db3d',
+    '0x2dddd703578d1f5bd1fad113c9e12f0c416305d5',
+    '0xd23432901c0754e28999661f31ab4aa3633ec2ed',
+    '0x747cc81b6c2b4afe13be59d31591d4229854b826',
+    '0xa0c13b5eca719be98ef27d0c4111cb5abbe97731',
+    '0x824422bd3ba030ca9ca5bcad26dfd4b45409849d',
+    '0xd2589f416c9412572df8d94fa1d58073c9f8f3bf',
+    '0x7bd375b95a1dbcbddb1e8219a01c550b21ed6ea2',
+    '0x5b91962f5eca75e6558e4d32df69b30f75cc6fe5',
+    '0x901b51b9a4214990ac6f0fd50a45df1573b7a51a',
+];
+
+export const Rollup = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'Rollup Finance',
+            id: 'rollup',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://rollup.finance/',
+        };
+
+        transactions.forEach((transaction) => {
+            if (rollupAddresses.includes(transaction.to.toLowerCase())) {
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+                protocolState.interactions += 1;
+
+                const transfers = transaction.transfers.sort(
+                    (a, b) =>
+                        parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                        parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price,
+                );
+
+                if (transfers.length === 0) return;
+                protocolState.volume +=
+                    parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(
+            address,
+            transactions,
+            protocolState.id,
+            rollupAddresses,
+        ).days;
+
+        return protocolState;
+    },
+};

+ 57 - 0
src/utils/getZksyncData/procotols/spacefi.js

@@ -0,0 +1,57 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+const spaceFiAddresses = [
+    '0x0700fb51560cfc8f896b2c812499d17c5b0bf6a7',
+    '0xe8826fc3ce6e74932144dbc2b369e7b52e88193a',
+    '0x7cf85f98c0339559eab22deea1e018721e800add',
+    '0xb376fceacd9fef24a342645cbf72a4c439ea0614',
+    '0xacf5a67f2fcfeda3946ccb1ad9d16d2eb65c3c96',
+    '0x4ad9ee1698b6d521ebb2883dd9fc3655c7553561',
+    '0x00f093ff2bca9da894396336286c7c5bd2310ca5',
+    '0x307baa142ba2bfa4a3059efb631899c992a193ee',
+    '0x77d807b74d54b81a87a5769176bc7719f676c8ce',
+    '0xbe7d1fd1f6748bbdefc4fbacafbb11c6fc506d1d',
+];
+
+export const SpaceFi = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'SpaceFi',
+            id: 'spacefi',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://spacefi.io/',
+        };
+
+        transactions.forEach((transaction) => {
+            if (spaceFiAddresses.includes(transaction.to.toLowerCase())) {
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+                protocolState.interactions += 1;
+
+                const transfers = transaction.transfers.sort(
+                    (a, b) =>
+                        parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                        parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price,
+                );
+
+                if (transfers.length === 0) return;
+                protocolState.volume +=
+                    parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(
+            address,
+            transactions,
+            protocolState.id,
+            spaceFiAddresses,
+        ).days;
+
+        return protocolState;
+    },
+};

+ 46 - 0
src/utils/getZksyncData/procotols/starmaker.js

@@ -0,0 +1,46 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+const starmarkerAddresses = ['0x1bdb8250eaf3c596441e6c3417c9d5195d6c85b9'];
+
+export const Starmaker = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'Starmaker',
+            id: 'starmaker',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://starmaker.exchange/',
+        };
+
+        transactions.forEach((transaction) => {
+            if (starmarkerAddresses.includes(transaction.to.toLowerCase())) {
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+                protocolState.interactions += 1;
+
+                const transfers = transaction.transfers.sort(
+                    (a, b) =>
+                        parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                        parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price,
+                );
+
+                if (transfers.length === 0) return;
+                protocolState.volume +=
+                    parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(
+            address,
+            transactions,
+            protocolState.id,
+            starmarkerAddresses,
+        ).days;
+
+        return protocolState;
+    },
+};

+ 56 - 0
src/utils/getZksyncData/procotols/syncswap.js

@@ -0,0 +1,56 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+const syncSwapRouter = '0x2da10a1e27bf85cedd8ffb1abbe97e53391c0295';
+
+const syncSwapPools = [
+    '0x80115c708e12edd42e504c1cd52aea96c547c05c',
+    '0x176b23f1ddfeedd10fc250b8f769362492ef810b',
+    '0x4e7d2e3f40998daeb59a316148bfbf8efd1f7f3c',
+    '0xae092fcec5fd04836b12e87da0d7ed3a707b38b0',
+];
+
+export const SyncSwap = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'SyncSwap',
+            id: 'syncswap',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://syncswap.xyz/',
+        };
+
+        transactions.forEach((transaction) => {
+            if (
+                syncSwapRouter.includes(transaction.to.toLowerCase()) ||
+                syncSwapPools.includes(transaction.to.toLowerCase())
+            ) {
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+                protocolState.interactions += 1;
+
+                const transfers = transaction.transfers.sort(
+                    (a, b) =>
+                        parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                        parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price
+                );
+
+                if (transfers.length === 0) return;
+                protocolState.volume +=
+                    parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(
+            address,
+            transactions,
+            protocolState.id,
+            syncSwapPools.concat([syncSwapRouter])
+        ).days;
+
+        return protocolState;
+    },
+};

+ 51 - 0
src/utils/getZksyncData/procotols/velocore.js

@@ -0,0 +1,51 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+const velocoreRouter = '0xd999e16e68476bc749a28fc14a0c3b6d7073f50c';
+
+const velocorePools = ['0xcd52cbc975fbb802f82a1f92112b1250b5a997df'];
+
+export const Velocore = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'Velocore',
+            id: 'velocore',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://velocore.xyz/',
+        };
+
+        transactions.forEach((transaction) => {
+            if (
+                velocoreRouter.includes(transaction.to.toLowerCase()) ||
+                velocorePools.includes(transaction.to.toLowerCase())
+            ) {
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+                protocolState.interactions += 1;
+
+                const transfers = transaction.transfers.sort(
+                    (a, b) =>
+                        parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                        parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price,
+                );
+
+                if (transfers.length === 0) return;
+                protocolState.volume +=
+                    parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(
+            address,
+            transactions,
+            protocolState.id,
+            velocorePools.concat([velocoreRouter]),
+        ).days;
+
+        return protocolState;
+    },
+};

+ 45 - 0
src/utils/getZksyncData/procotols/zksynceraportal.js

@@ -0,0 +1,45 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+export const ZkSyncEraPortal = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'zkSync Era Portal',
+            id: 'zksynceraportal',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://portal.zksync.io/bridge',
+        };
+
+        transactions.forEach((transaction) => {
+            if (
+                (transaction.to.toLowerCase() === '0x000000000000000000000000000000000000800a' &&
+                    transaction.data.startsWith('0x51cff8d9')) ||
+                (transaction.to.toLowerCase() === address.toLowerCase() && transaction.isL1Originated)
+            ) {
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+                protocolState.interactions += 1;
+
+                const transfers = transaction.transfers.sort(
+                    (a, b) =>
+                        parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                        parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price,
+                );
+
+                if (transfers.length === 0) return;
+                protocolState.volume +=
+                    parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(address, transactions, protocolState.id, [
+            '0x000000000000000000000000000000000000800a',
+        ]).days;
+
+        return protocolState;
+    },
+};

+ 44 - 0
src/utils/getZksyncData/procotols/zksyncid.js

@@ -0,0 +1,44 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+const zkSyncIdAddresses = ['0xa531ece441138d8ce52642ad497059f2a79fd96f'];
+
+export const ZkSyncId = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'zkSync ID',
+            id: 'zksyncid',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://www.zksyncid.xyz/',
+        };
+
+        transactions.forEach((transaction) => {
+            if (
+                zkSyncIdAddresses.includes(transaction.to.toLowerCase()) ||
+                zkSyncIdAddresses.includes(transaction.to.toLowerCase())
+            ) {
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+                protocolState.interactions += 1;
+
+                const transfers = transaction.transfers.sort(
+                    (a, b) =>
+                        parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                        parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price,
+                );
+
+                if (transfers.length === 0) return;
+                protocolState.volume +=
+                    parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(address, transactions, protocolState.id, zkSyncIdAddresses).days;
+
+        return protocolState;
+    },
+};

+ 46 - 0
src/utils/getZksyncData/procotols/zksyncnameservices.js

@@ -0,0 +1,46 @@
+import {countTransactionPeriods} from "@/utils/getZksyncData/procotols/countTransactionPeriods.js";
+
+const zkSyncNameServiceAddresses = ['0xae23b6e7f91ddebd3b70d74d20583e3e674bd94f'];
+
+export const ZkSyncNameService = {
+    getProtocolsState: (transactions, address) => {
+        const protocolState = {
+            name: 'zkSync Name Service',
+            id: 'zksyncnameservice',
+            lastActivity: '',
+            volume: 0,
+            interactions: 0,
+            activeDays: 0,
+            approves: 0,
+            url: 'https://app.zkns.domains/',
+        };
+
+        transactions.forEach((transaction) => {
+            if (zkSyncNameServiceAddresses.includes(transaction.to.toLowerCase())) {
+                if (protocolState.lastActivity === '') protocolState.lastActivity = transaction.receivedAt;
+                if (new Date(protocolState.lastActivity) < new Date(transaction.receivedAt))
+                    protocolState.lastActivity = transaction.receivedAt;
+                protocolState.interactions += 1;
+
+                const transfers = transaction.transfers.sort(
+                    (a, b) =>
+                        parseInt(b.amount) * 10 ** -b.token.decimals * b.token.price -
+                        parseInt(a.amount) * 10 ** -a.token.decimals * a.token.price,
+                );
+
+                if (transfers.length === 0) return;
+                protocolState.volume +=
+                    parseInt(transfers[0].amount) * 10 ** -transfers[0].token.decimals * transfers[0].token.price;
+            }
+        });
+
+        protocolState.activeDays = countTransactionPeriods(
+            address,
+            transactions,
+            protocolState.id,
+            zkSyncNameServiceAddresses,
+        ).days;
+
+        return protocolState;
+    },
+};

+ 39 - 29
src/views/HomeView.vue

@@ -29,7 +29,8 @@ import syncswapBg from '../project/syncswap/syncswapBg.png'
 import syncswapAv from '../project/syncswap/syncswapAv.png'
 import getcoinBg from '../project/getcoin/getcoinBg.png'
 import getcoinAv from '../project/getcoin/getcoinAv.png'
-
+//@ts-ignore
+import {getAllZksSyncData} from "@/utils/getZksyncData/index.js";
 
 
 
@@ -159,47 +160,56 @@ const connectWallet = async () => {
   await switchEthereumChain()
 }
 //获取主网交易次数
-let mainTx = ref(0)
+let mainTx = ref('-')
 const getMainTx = () => {
   getZksEra(address.value).then(({tx2}:{tx2:number}) => {
     mainTx.value = tx2
   })
 }
 //获取lite网交易次数
-let liteTx = ref(0)
+let liteTx = ref('-')
 const getLiteTx = () => {
   getZksLite(address.value).then(({tx1}:{tx1:number}) => {
     liteTx.value = tx1
   })
 }
 //获取更多信息
-let amount = ref(0)
-let contract = ref(0)
+let amount = ref('-')
+let contract = ref('-')
 let tradingTimeArr = ref()
-let l1Tol2Tx = ref(0)
-let l2Tol1Tx = ref(0)
+let l1Tol2Tx = ref('-')
+let l2Tol1Tx = ref('-')
 const getMoreInfo = () => {
-  getZkSyncBridge(address.value).then((
-      {
-          totalExchangeAmount,
-          contractActivity,
-          overTimeArr,
-          l1Tol2Times,
-          l2Tol1Times
-      }:{
-        totalExchangeAmount:number
-        contractActivity:number
-        overTimeArr:any
-        l1Tol2Times:number
-        l2Tol1Times:number
-      }) => {
-    amount.value = totalExchangeAmount
-    contract.value = contractActivity
-    tradingTimeArr.value = overTimeArr
-    l1Tol2Tx.value = l1Tol2Times
-    l2Tol1Tx.value = l2Tol1Times
-    processTime()
+  // getZkSyncBridge('0x555b07470647Cd159FF6595771054Aee7343e853').then((
+  //     {
+  //         totalExchangeAmount,
+  //         contractActivity,
+  //         overTimeArr,
+  //         l1Tol2Times,
+  //         l2Tol1Times
+  //     }:{
+  //       totalExchangeAmount:number
+  //       contractActivity:number
+  //       overTimeArr:any
+  //       l1Tol2Times:number
+  //       l2Tol1Times:number
+  //     }) => {
+  //   amount.value = totalExchangeAmount
+  //   contract.value = contractActivity
+  //   tradingTimeArr.value = overTimeArr
+  //   l1Tol2Tx.value = l1Tol2Times
+  //   l2Tol1Tx.value = l2Tol1Times
+  //   processTime()
+  // })
+  getAllZksSyncData(address.value).then(res=>{
+      amount.value = res.totalExchangeAmount
+      contract.value = res.contractActivity
+      tradingTimeArr.value = res.overTimeArr
+      l1Tol2Tx.value = res.l1Tol2Times
+      l2Tol1Tx.value = res.l2Tol1Times
+      processTime()
   })
+
 }
 //处理时间数据
 const monthArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
@@ -225,13 +235,13 @@ const processTime = () => {
   }
   if (tradingTimeArr.value){
     tradingTimeArr.value.forEach((item:any) => {
-      if(item.balanceChanges[0].from && item.balanceChanges[0].from.toLowerCase() === address.value.toLowerCase()){
+      // if(item.balanceChanges[0].from && item.balanceChanges[0].from.toLowerCase() === address.value.toLowerCase()){
         let receivedAt = new Date(Date.parse(item.receivedAt)).toString();
         let strArr = receivedAt.split(' ')
         let month = strArr[1]
         let index = showMonthArr.value.indexOf(month)
         showMonthNumberArr.value[index]++
-      }
+      // }
     })
   }