File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Program: goonERTdGsjnkZqWuVjs73BZ3Pb9qoCUdBUL17BnS5j
2+
3+ import { FetchOptions , SimpleAdapter } from "../../adapters/types"
4+ import { CHAIN } from "../../helpers/chains"
5+ import { queryDuneSql } from "../../helpers/dune"
6+
7+ const fetch = async ( _a :any , _b :any , options : FetchOptions ) => {
8+ const query = `
9+ with swaps as (
10+ select
11+ tx_id
12+ , outer_instruction_index
13+ , inner_instruction_index
14+ from solana.instruction_calls
15+ where executing_account = 'goonERTdGsjnkZqWuVjs73BZ3Pb9qoCUdBUL17BnS5j'
16+ and TIME_RANGE
17+ and tx_success = true
18+ )
19+ select
20+ SUM(amount_usd) as daily_volume
21+ from tokens_solana.transfers t
22+ inner join swaps s on t.tx_id = s.tx_id
23+ and t.outer_instruction_index = s.outer_instruction_index
24+ and t.inner_instruction_index = s.inner_instruction_index + 1
25+ where t.block_time >= from_unixtime(${ options . startTimestamp } )
26+ and t.block_time <= from_unixtime(${ options . endTimestamp } )
27+ `
28+ const data = await queryDuneSql ( options , query )
29+
30+ return {
31+ dailyVolume : data [ 0 ] ?. daily_volume ?? 0
32+ }
33+ }
34+
35+ const adapter : SimpleAdapter = {
36+ fetch,
37+ chains : [ CHAIN . SOLANA ] ,
38+ start : '2025-05-22' ,
39+ }
40+
41+ export default adapter
Original file line number Diff line number Diff line change 1+ // Program: TessVdML9pBGgG9yGks7o4HewRaXVAMuoVj4x83GLQH
2+
3+ import { FetchOptions , SimpleAdapter } from "../../adapters/types"
4+ import { CHAIN } from "../../helpers/chains"
5+ import { queryDuneSql } from "../../helpers/dune"
6+
7+ const fetch = async ( _a :any , _b :any , options : FetchOptions ) => {
8+ const query = `
9+ with swaps as (
10+ select
11+ tx_id
12+ , outer_instruction_index
13+ , inner_instruction_index
14+ from solana.instruction_calls
15+ where executing_account = 'TessVdML9pBGgG9yGks7o4HewRaXVAMuoVj4x83GLQH'
16+ and TIME_RANGE
17+ and tx_success = true
18+ )
19+ select
20+ SUM(amount_usd) as daily_volume
21+ from tokens_solana.transfers t
22+ inner join swaps s on t.tx_id = s.tx_id
23+ and t.outer_instruction_index = s.outer_instruction_index
24+ and t.inner_instruction_index = s.inner_instruction_index + 1
25+ where t.block_time >= from_unixtime(${ options . startTimestamp } )
26+ and t.block_time <= from_unixtime(${ options . endTimestamp } )
27+ `
28+ const data = await queryDuneSql ( options , query )
29+
30+ return {
31+ dailyVolume : data [ 0 ] ?. daily_volume ?? 0
32+ }
33+ }
34+
35+ const adapter : SimpleAdapter = {
36+ fetch,
37+ chains : [ CHAIN . SOLANA ] ,
38+ start : '2025-06-11' ,
39+ }
40+
41+ export default adapter
You can’t perform that action at this time.
0 commit comments