Skip to content

Commit

Permalink
Merge pull request #1853 from Levana-Protocol/master
Browse files Browse the repository at this point in the history
[levana] - Add neutron stats
  • Loading branch information
dtmkeng committed Sep 3, 2024
2 parents 4ff6a9f + 05e9272 commit 44dc4f1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dexs/levana/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ import { httpGet } from "../../utils/fetchURL";
const INDEXER_URL = "https://indexer-mainnet.levana.finance";
const QUERIER_URL = "https://querier-mainnet.levana.finance";

type Chain = "osmosis" | "injective" | "sei"
type Chain = "osmosis" | "injective" | "sei" | "neutron"

const factoryAddr:Record<Chain, string> = {
osmosis: "osmo1ssw6x553kzqher0earlkwlxasfm2stnl3ms3ma2zz4tnajxyyaaqlucd45",
sei: "sei18rdj3asllguwr6lnyu2sw8p8nut0shuj3sme27ndvvw4gakjnjqqper95h",
injective: "inj1vdu3s39dl8t5l88tyqwuhzklsx9587adv8cnn9"
injective: "inj1vdu3s39dl8t5l88tyqwuhzklsx9587adv8cnn9",
neutron: "neutron1an8ls6d57c4qcvjq0jmm27jtrpk65twewfjqzdn7annefv7gadqsjs7uc3",
}

const networkName:Record<Chain, string> = {
osmosis: "osmosis-mainnet",
sei: "sei-mainnet",
injective: "injective-mainnet"
injective: "injective-mainnet",
neutron: "neutron-mainnet"
}

export interface MarketInfo {
Expand Down
13 changes: 13 additions & 0 deletions dexs/levana/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ const adapter: SimpleAdapter = {
return { timestamp, dailyVolume, totalVolume, }
},
start: 1695738685
},
neutron: {
fetch: async (timestamp: number): Promise<FetchResultVolume> => {
const marketInfos = await fetchMarketInfos("neutron");

const [dailyVolume, totalVolume] = await Promise.all([
fetchVolume("daily", marketInfos, timestamp),
fetchVolume("total", marketInfos, timestamp)
]);

return { timestamp, dailyVolume, totalVolume, }
},
start: 1715168042
}
}
}
Expand Down

0 comments on commit 44dc4f1

Please sign in to comment.