File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ import fetchURL from "../utils/fetchURL"
2+ import { FetchResultFees , SimpleAdapter , FetchOptions } from "../adapters/types" ;
3+ import { CHAIN } from "../helpers/chains" ;
4+
5+ const ember_fees_url = "https://vaults.api.sui-prod.bluefin.io/api/v1/vaults/fees"
6+
7+ const fetch = async ( _a : any , _b : any , options : FetchOptions ) : Promise < FetchResultFees > => {
8+ const result = await fetchURL ( `${ ember_fees_url } ?startTimestampInMs=${ options . startTimestamp * 1000 } &endTimestampInMs=${ options . endTimestamp * 1000 } ` ) ;
9+ const feesUsdE9 = result . feesUsdE9 ;
10+ const revenueUsdE9 = result . revenueUsdE9 ;
11+
12+ const fees = Number ( feesUsdE9 ) / 1e9 ;
13+ const revenue = Number ( revenueUsdE9 ) / 1e9 ;
14+
15+ return {
16+ dailyFees : fees ,
17+ dailyRevenue : revenue ,
18+ dailyProtocolRevenue : revenue ,
19+ dailySupplySideRevenue : fees - revenue ,
20+ } ;
21+ } ;
22+
23+ const adapter : SimpleAdapter = {
24+ adapter : {
25+ [ CHAIN . SUI ] : {
26+ fetch,
27+ start : '2025-09-01' ,
28+ } ,
29+ } ,
30+ methodology : {
31+ Fees : 'Total yields collected from Ember protocol vaults.' ,
32+ Revenue : 'Share of yields to Ember protocol.' ,
33+ ProtocolRevenue : 'Share of yields to Ember protocol.' ,
34+ SupplySideRevenue : 'Share of yields to vaults depositors.' ,
35+ }
36+ } ;
37+
38+ export default adapter ;
You can’t perform that action at this time.
0 commit comments