-
Notifications
You must be signed in to change notification settings - Fork 950
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1819 from CumpsD/chainflip
feat: add chainflip dexs
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |