Skip to content

Commit

Permalink
feat: Add meteora adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
quangkeu95 committed May 1, 2024
1 parent 6e0095b commit 26c0b35
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions dexs/meteora/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { CHAIN } from '../../helpers/chains';
import { httpGet } from '../../utils/fetchURL';

const meteoraStatsEndpoint = "https://met-stats.meteora.ag/defillama/stats";

interface Stats24H {
dailyVolume: number
timestamp: number
};

async function fetch(timestamp: number): Promise<Stats24H> {
let response: Stats24H = await httpGet(meteoraStatsEndpoint);
return {
dailyVolume: response.dailyVolume,
timestamp: timestamp
};
}

export default {
adapter: {
[CHAIN.SOLANA]: {
fetch: fetch,
runAtCurrTime: true,
start: 1714435200, // Apr 30 2024 - 00:00:00 UTC
}
}
}

0 comments on commit 26c0b35

Please sign in to comment.