1- import axios from "axios" ;
21import { Adapter , FetchOptions , FetchResult } from "../../adapters/types" ;
32import { CHAIN } from "../../helpers/chains" ;
3+ import fetchURL from "../../utils/fetchURL" ;
44
55const fetch = async ( options : FetchOptions ) : Promise < FetchResult > => {
6- const {
7- data : { dailyRevenue } ,
8- } = await axios . get (
9- `https://tidelabs.io:2121/defillama/strike-finance/fees?from=${ options . startTimestamp } &to=${ options . endTimestamp } ` ,
6+ const dailyFees = options . createBalances ( ) ;
7+ const dailyRevenue = options . createBalances ( ) ;
8+
9+ const { totalFees, totalRevenue } = await fetchURL (
10+ `https://beta.strikefinance.org/api/analytics/fees?from=${ options . startTimestamp } &to=${ options . endTimestamp } `
1011 ) ;
11- const dailyRevenueUSD = options . createBalances ( ) ;
12- dailyRevenueUSD . addCGToken ( 'cardano' , Number ( dailyRevenue ) ) ;
13- const dailyFeesUSD = dailyRevenueUSD . clone ( ) ;
12+
13+ dailyFees . addCGToken ( "cardano" , Number ( totalFees ) ) ;
14+ dailyRevenue . addCGToken ( "cardano" , Number ( totalRevenue ) ) ;
15+
1416 return {
15- timestamp : options . startOfDay ,
16- dailyFees : dailyFeesUSD ,
17- dailyRevenue : dailyRevenueUSD ,
17+ dailyFees ,
18+ dailyRevenue ,
19+ dailyProtocolRevenue : dailyRevenue ,
1820 } ;
1921} ;
2022
@@ -23,11 +25,13 @@ const adapter: Adapter = {
2325 adapter : {
2426 [ CHAIN . CARDANO ] : {
2527 fetch,
26- start : '2024-05-16' ,
28+ start : "2024-05-16" ,
29+ runAtCurrTime : true ,
2730 meta : {
2831 methodology : {
2932 Fees : "All trading fees associated with opening a perpetual position." ,
30- Revenue : "All trading fees associated with opening a perpetual position." ,
33+ Revenue : "All open fees plus liquidation and trading revenue" ,
34+ ProtocolRevenue : "All open fees plus liquidation and trading revenue" ,
3135 }
3236 }
3337 } ,
0 commit comments