Skip to content

add/fees/indx/index.ts #3354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

mav-brewlabs
Copy link

adding fee revenue to defillama - thanks guys

adding fee revenue to defillama
@llamabutler
Copy link

The indx adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees indx

🦙 Running INDX adapter 🦙
---------------------------------------------------
Start Date:	Tue, 03 Jun 2025 04:46:51 GMT
End Date:	Wed, 04 Jun 2025 04:46:51 GMT
---------------------------------------------------

BASE 👇
Backfill start time: 17/5/2025
Daily fees: 0
Daily revenue: 0
End timestamp: 1749012410 (2025-06-04T04:46:50.000Z)

@noateden noateden self-assigned this Jun 4, 2025
Copy link
Contributor

@noateden noateden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR, can you pls add fees methodology, like this:
https://github.com/DefiLlama/dimension-adapters/blob/master/fees/bonk-bot/index.ts#L18

import { CHAIN } from "../../helpers/chains";

const FeeCollectedEvent = "event FeesCollected(address indexed token, address indexed integrator, uint256 integratorFee, uint256 indxFee)"
const indxFeeAddress = '0xD04086A2E18f4B1BB565A703EBeC56eaee2ACCA0';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a contract, wrong address?

Updated adapter
@llamabutler
Copy link

The indx adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees indx

🦙 Running INDX adapter 🦙
---------------------------------------------------
Start Date:	Tue, 03 Jun 2025 05:20:48 GMT
End Date:	Wed, 04 Jun 2025 05:20:48 GMT
---------------------------------------------------

TypeError: options.getFromAddresses is not a function
    at fetch (/home/runner/work/dimension-adapters/dimension-adapters/fees/indx/index.ts:10:19)
    at getChainResult (/home/runner/work/dimension-adapters/dimension-adapters/adapters/utils/runAdapter.ts:75:25)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
    at async runAdapter (/home/runner/work/dimension-adapters/dimension-adapters/adapters/utils/runAdapter.ts:47:20)
    at async /home/runner/work/dimension-adapters/dimension-adapters/cli/testAdapter.ts:84:21 {
  chain: 'base'
}

@mav-brewlabs
Copy link
Author

Should be fine now - all our index contracts send ETH to this address - is that okay?

@llamabutler
Copy link

The indx adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees indx

🦙 Running INDX adapter 🦙
---------------------------------------------------
Start Date:	Tue, 03 Jun 2025 05:32:00 GMT
End Date:	Wed, 04 Jun 2025 05:32:00 GMT
---------------------------------------------------

[Error: Failed to call: uint256:getBalance target: 0xD04086A2E18f4B1BB565A703EBeC56eaee2ACCA0 on chain: [base] rpc: https://base.publicnode.com, https://base.llamarpc.com, https://mainnet.base.org, https://developer-access-mainnet.base.org, https://base.blockpi.network/v1/rpc/public, https://1rpc.io/base, https://base-pokt.nodies.app, https://base.meowrpc.com, https://base-mainnet.public.blastapi.io, https://base.gateway.tenderly.co, https://gateway.tenderly.co/public/base, https://base-rpc.publicnode.com, https://base.drpc.org, https://base.api.onfinality.io/public, https://base.rpc.subquery.network/public, https://api.zan.top/base-mainnet, https://endpoints.omniatech.io/v1/base/mainnet/public, https://base.lava.build, https://0xrpc.io/base, https://rpc.therpc.io/base  call reverted, reason: fragment.format is not a function   ] {
  _underlyingError: 'TypeError: fragment.format is not a function',
  _isCustomError: true,
  chain: 'base'
}

@llamabutler
Copy link

The indx adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees indx

🦙 Running INDX adapter 🦙
---------------------------------------------------
Start Date:	Tue, 03 Jun 2025 05:33:53 GMT
End Date:	Wed, 04 Jun 2025 05:33:53 GMT
---------------------------------------------------

TypeError: ethReceived.gt is not a function
    at fetch (/home/runner/work/dimension-adapters/dimension-adapters/fees/indx/index.ts:17:21)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async getChainResult (/home/runner/work/dimension-adapters/dimension-adapters/adapters/utils/runAdapter.ts:75:18)
    at async Promise.all (index 0)
    at async runAdapter (/home/runner/work/dimension-adapters/dimension-adapters/adapters/utils/runAdapter.ts:47:20)
    at async /home/runner/work/dimension-adapters/dimension-adapters/cli/testAdapter.ts:84:21 {
  chain: 'base'
}

@llamabutler
Copy link

The indx adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees indx

🦙 Running INDX adapter 🦙
---------------------------------------------------
Start Date:	Tue, 03 Jun 2025 05:35:29 GMT
End Date:	Wed, 04 Jun 2025 05:35:29 GMT
---------------------------------------------------

BASE 👇
Backfill start time: 17/5/2025
Daily fees: 0
Daily revenue: 0
End timestamp: 1749015328 (2025-06-04T05:35:28.000Z)

@llamabutler
Copy link

The indx adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees indx

🦙 Running INDX adapter 🦙
---------------------------------------------------
Start Date:	Tue, 03 Jun 2025 05:37:30 GMT
End Date:	Wed, 04 Jun 2025 05:37:30 GMT
---------------------------------------------------

[Error: Failed to call: function balanceOf() view returns (uint256) target: 0xd04086a2e18f4b1bb565a703ebec56eaee2acca0 on chain: [base] rpc: https://base.publicnode.com, https://base.llamarpc.com, https://mainnet.base.org, https://developer-access-mainnet.base.org, https://base.blockpi.network/v1/rpc/public, https://1rpc.io/base, https://base-pokt.nodies.app, https://base.meowrpc.com, https://base-mainnet.public.blastapi.io, https://base.gateway.tenderly.co, https://gateway.tenderly.co/public/base, https://base-rpc.publicnode.com, https://base.drpc.org, https://base.api.onfinality.io/public, https://base.rpc.subquery.network/public, https://api.zan.top/base-mainnet, https://endpoints.omniatech.io/v1/base/mainnet/public, https://base.lava.build, https://0xrpc.io/base, https://rpc.therpc.io/base  call reverted, reason: fragment.format is not a function   ] {
  _underlyingError: 'TypeError: fragment.format is not a function',
  _isCustomError: true,
  chain: 'base'
}

@llamabutler
Copy link

The indx adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees indx

🦙 Running INDX adapter 🦙
---------------------------------------------------
Start Date:	Tue, 03 Jun 2025 05:47:17 GMT
End Date:	Wed, 04 Jun 2025 05:47:17 GMT
---------------------------------------------------

Error: Indexer not enabled for chain base
    at getIndexerVersionForBlock (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/indexer.js:183:19)
    at Object.getLogs (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/indexer.js:211:27)
    at addGasTokensReceived (/home/runner/work/dimension-adapters/dimension-adapters/helpers/token.ts:35:35)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async fetch (/home/runner/work/dimension-adapters/dimension-adapters/fees/indx/index.ts:8:21)
    at async getChainResult (/home/runner/work/dimension-adapters/dimension-adapters/adapters/utils/runAdapter.ts:75:18)
    at async Promise.all (index 0)
    at async runAdapter (/home/runner/work/dimension-adapters/dimension-adapters/adapters/utils/runAdapter.ts:47:20)
    at async /home/runner/work/dimension-adapters/dimension-adapters/cli/testAdapter.ts:84:21 {
  chain: 'base'
}

@llamabutler
Copy link

The indx adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees indx

🦙 Running INDX adapter 🦙
---------------------------------------------------
Start Date:	Tue, 03 Jun 2025 06:00:13 GMT
End Date:	Wed, 04 Jun 2025 06:00:13 GMT
---------------------------------------------------

[Warning] Invalid Fragment {"type":"function","constant":true,"inputs":[],"name":"0x","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view"}: invalid identifier (argument="name", value="0x", code=INVALID_ARGUMENT, version=6.13.2)
[Error: Failed to call: uint256:0x target: 0xD04086A2E18f4B1BB565A703EBeC56eaee2ACCA0 on chain: [base] rpc:   call reverted, reason: invalid identifier (argument="name", value="0x", code=INVALID_ARGUMENT, version=6.13.2)   ] {
  _underlyingError: 'TypeError: invalid identifier (argument="name", value="0x", code=INVALID_ARGUMENT, version=6.13.2)',
  _isCustomError: true,
  chain: 'base'
}

@llamabutler
Copy link

The indx adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees indx

🦙 Running INDX adapter 🦙
---------------------------------------------------
Start Date:	Tue, 03 Jun 2025 06:02:14 GMT
End Date:	Wed, 04 Jun 2025 06:02:14 GMT
---------------------------------------------------

[Warning] Invalid Fragment "eth:getBalance": unexpected token ":" at position 3
[Warning] Invalid Fragment undefined: unsupported frgament object (argument="obj", value=null, code=INVALID_ARGUMENT, version=6.13.2)
[Error: TypeError: Cannot read properties of undefined (reading 'stateMutability')] {
  _underlyingError: "TypeError: Cannot read properties of undefined (reading 'stateMutability')",
  _isCustomError: true,
  chain: 'base'
}

@llamabutler
Copy link

The indx adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees indx

🦙 Running INDX adapter 🦙
---------------------------------------------------
Start Date:	Tue, 03 Jun 2025 06:33:22 GMT
End Date:	Wed, 04 Jun 2025 06:33:22 GMT
---------------------------------------------------

TypeError: options.api.getBalance is not a function
    at fetch (/home/runner/work/dimension-adapters/dimension-adapters/fees/indx/index.ts:9:40)
    at getChainResult (/home/runner/work/dimension-adapters/dimension-adapters/adapters/utils/runAdapter.ts:75:25)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
    at async runAdapter (/home/runner/work/dimension-adapters/dimension-adapters/adapters/utils/runAdapter.ts:47:20)
    at async /home/runner/work/dimension-adapters/dimension-adapters/cli/testAdapter.ts:84:21 {
  chain: 'base'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants