@@ -4,39 +4,30 @@ import { queryDuneSql } from "../../helpers/dune";
44import { FetchOptions } from "../../adapters/types" ;
55
66interface IData {
7- daily_volume_sol : number ;
7+ protocol_fees : number ;
88}
99
1010const fetch = async ( _a : any , _b : any , options : FetchOptions ) => {
1111 const data : IData [ ] = await queryDuneSql ( options , `
1212 WITH launchlab_trades AS (
1313 SELECT
14- block_time,
15- BYTEARRAY_TO_UINT256(REVERSE(SUBSTR(data, 105, 8))) as amount_in,
16- BYTEARRAY_TO_UINT256(REVERSE(SUBSTR(data, 113, 8))) as amount_out,
17- BYTEARRAY_TO_UINT256(REVERSE(SUBSTR(data, 121, 8))) as protocol_fee,
18- BYTEARRAY_TO_UINT256(REVERSE(SUBSTR(data, 129, 8))) as platform_fee,
19- BYTEARRAY_TO_UINT256(REVERSE(SUBSTR(data, 137, 8))) as share_fee,
20- BYTEARRAY_TO_UINT256(SUBSTR(data, 145, 1)) as trade_direction,
21- CASE
22- WHEN BYTEARRAY_TO_UINT256(SUBSTR(data, 145, 1)) = 0 THEN BYTEARRAY_TO_UINT256(REVERSE(SUBSTR(data, 105, 8)))
23- ELSE BYTEARRAY_TO_UINT256(REVERSE(SUBSTR(data, 113, 8)))
24- END as sol_amount
14+ evt_block_time,
15+ protocol_fee,
16+ platform_fee,
17+ share_fee
2518 FROM
26- solana.instruction_calls
19+ raydium_solana.raydium_launchpad_evt_tradeevent
2720 WHERE
28- executing_account = 'LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj'
29- AND block_time >= from_unixtime(${ options . startTimestamp } )
30- AND block_time <= from_unixtime(${ options . endTimestamp } )
31- AND VARBINARY_STARTS_WITH (data, 0xe445a52e51cb9a1dbddb7fd34ee661ee)
21+ evt_block_time >= from_unixtime(${ options . startTimestamp } )
22+ AND evt_block_time <= from_unixtime(${ options . endTimestamp } )
3223 )
3324 SELECT
34- SUM(sol_amount / 1e9 ) AS daily_volume_sol
25+ SUM(protocol_fee ) AS protocol_fees
3526 FROM
3627 launchlab_trades
3728 ` )
3829 const dailyFees = options . createBalances ( )
39- dailyFees . addCGToken ( 'solana' , Number ( data [ 0 ] . daily_volume_sol ) * 0.01 )
30+ dailyFees . addCGToken ( 'solana' , Number ( data [ 0 ] . protocol_fees / 1e9 ) )
4031 const dailyHoldersRevenue = dailyFees . clone ( 0.25 ) // 25% of is burned
4132 const dailyProtocolRevenue = dailyFees . clone ( 0.75 ) // 75% of fees go to the protocol
4233
@@ -55,10 +46,10 @@ const adapter: SimpleAdapter = {
5546 start : '2025-04-15' ,
5647 meta : {
5748 methodology : {
58- fees : '1% fee on all transactions.' ,
59- revenue : '0.25% burned + 0.75% to protocol of 1% tx fees' ,
60- holdersRevenue : '0.25 % of fees are burned .' ,
61- protocolRevenue : '0.75 % of fees go to the protocol.'
49+ Fees : '1% platform fee on all transactions.' ,
50+ Revenue : '0.25% burned + 0.75% to protocol of 1% platform fees' ,
51+ ProtocolRevenue : '0.75 % of platform fees go to the protocol .' ,
52+ HoldersRevenue : '0.25 % of platform fees are burned.' ,
6253 }
6354 }
6455 }
0 commit comments