Skip to content
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

feat: add sonic market volume #2290

Closed
wants to merge 1 commit into from
Closed

Conversation

graykode
Copy link
Contributor

@graykode graykode commented Jan 8, 2025

Hello, This is a PR for integrating the Sonic Market volume feature.
Sonic Market consists of two main functionalities: the order book and CPMM (a Uniswap V2 fork).
Additionally, Sonic Market is a fork of the Clober DEX. Thank you!

@llamabutler
Copy link

The sonic-market-cpmm adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts dexs sonic-market-cpmm

🦙 Running SONIC-MARKET-CPMM adapter 🦙
---------------------------------------------------
Start Date:	Tue, 07 Jan 2025 00:00:00 GMT
End Date:	Wed, 08 Jan 2025 00:00:00 GMT
---------------------------------------------------

error fetching block TypeError: Cannot read properties of null (reading 'getBlock')
    at _getCurrentChainBlock (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/blocks.js:84:59)
    at getCurrentChainBlock (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/blocks.js:76:22)
    at _lookupBlock (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/blocks.js:204:44)
    at /home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/blocks.js:155:26
    at /home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:23:31
    at run (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:23:43)
    at /home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:45:20
Failed to get total volume on sonic https://subgraph.satsuma-prod.com/f6a8c4889b7b/clober/cpmm-v2-subgraph-sonic-mainnet/api: Type `Query` has no field `sonicmarketFactories`
error fetching block TypeError: Cannot read properties of null (reading 'getBlock')
    at _getCurrentChainBlock (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/blocks.js:84:59)
    at getCurrentChainBlock (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/blocks.js:76:22)
    at _lookupBlock (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/blocks.js:204:44)
    at /home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/blocks.js:155:26
    at /home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:23:31
    at run (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:23:43)
    at /home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:45:20
Failed to get daily volume via alternative query on https://subgraph.satsuma-prod.com/f6a8c4889b7b/clober/cpmm-v2-subgraph-sonic-mainnet/api sonic: Type `Query` has no field `sonicmarketFactories`
SONIC 👇
Backfill start time: 8/1/2025
NO METHODOLOGY SPECIFIED
End timestamp: 1736294400 (2025-01-08T00:00:00.000Z)
Block: 2.92 M

@llamabutler
Copy link

The sonic-market-orderbook adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts dexs sonic-market-orderbook

🦙 Running SONIC-MARKET-ORDERBOOK adapter 🦙
---------------------------------------------------
Start Date:	Tue, 07 Jan 2025 06:20:07 GMT
End Date:	Wed, 08 Jan 2025 06:20:07 GMT
---------------------------------------------------

error fetching block TypeError: Cannot read properties of null (reading 'getBlock')
    at _getCurrentChainBlock (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/blocks.js:84:59)
    at getCurrentChainBlock (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/blocks.js:76:22)
    at _lookupBlock (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/blocks.js:204:44)
    at /home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/blocks.js:155:26
    at /home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:23:31
    at run (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:23:43)
    at /home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:45:20
TypeError: Cannot read properties of null (reading 'getLogs')
    at _getLogs (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/index.js:84:45)
    at /home/runner/work/dimension-adapters/dimension-adapters/node_modules/@defillama/sdk/build/util/index.js:54:39
    at /home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:23:31
    at run (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:23:43)
    at /home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:45:20
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  chain: 'sonic'
}

@g1nt0ki
Copy link
Member

g1nt0ki commented Jan 10, 2025

thanks for the PR, refactored and merged here: #2298

@g1nt0ki g1nt0ki closed this Jan 10, 2025
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.

3 participants