Skip to content

Commit

Permalink
Merge pull request #1819 from CumpsD/chainflip
Browse files Browse the repository at this point in the history
feat: add chainflip dexs
  • Loading branch information
dtmkeng committed Aug 25, 2024
2 parents d20e21f + 33f2441 commit aaf8360
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions dexs/chainflip/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";
import { httpGet } from "../../utils/fetchURL";

const dimensionsEndpoint = "https://chainflip-broker.io/defillama/dexs"

const fetch = async (timestamp: number) => {
const dimensionsData = await httpGet(`${dimensionsEndpoint}?timestamp=${timestamp}`, { headers: {"x-client-id": "defillama"}});

return {
timestamp: dimensionsData.timestamp,
dailyVolume: dimensionsData.dailyVolume,
totalVolume: dimensionsData.totalVolume
};
};

const adapter: SimpleAdapter = {
adapter: {
[CHAIN.CHAINFLIP]: {
fetch,
start: 1700740800, // FLIP went live on 2023-11-23 12:00 UTC
runAtCurrTime: true,
meta: {
methodology: {
Volume: "Deposit value of a swap.",
}
}
},
},
};

export default adapter;

0 comments on commit aaf8360

Please sign in to comment.