Skip to content

Commit

Permalink
Merge pull request #1807 from brianbodollo/master
Browse files Browse the repository at this point in the history
Add Stride stBAND and stISLM fees
  • Loading branch information
dtmkeng committed Aug 22, 2024
2 parents 7f59c48 + ea85452 commit 3d4c321
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
19 changes: 16 additions & 3 deletions fees/stride.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ interface DailyFeeResponse {
}

const chainOverrides: { [key: string]: string } = {
"terra": "terra2",
terra: "terra2",
};

const fetch = (chain: string) => {
return async (timestamp: number): Promise<FetchResult> => {
const overriddenChain = chainOverrides[chain] || chain; // Override if exists, else use original
const response: DailyFeeResponse = await httpGet(`https://edge.stride.zone/api/${overriddenChain}/stats/fees`);
const response: DailyFeeResponse = await httpGet(
`https://edge.stride.zone/api/${overriddenChain}/stats/fees`
);

return {
timestamp: timestamp,
Expand All @@ -26,7 +28,6 @@ const fetch = (chain: string) => {
};
};


const meta = {
methodology: {
Fees: "Fees are staking rewards earned by tokens staked with Stride. They are measured across Stride's LSD tokens' yields and converted to USD terms.",
Expand Down Expand Up @@ -109,6 +110,18 @@ const adapter: Adapter = {
start: 0,
meta,
},
haqq: {
fetch: fetch("haqq"),
runAtCurrTime: true,
start: 0,
meta,
},
band: {
fetch: fetch("band"),
runAtCurrTime: true,
start: 0,
meta,
},
},
};

Expand Down
3 changes: 2 additions & 1 deletion helpers/getBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ const blacklistedChains: string[] = [
"persistence",
"sui",
"neutron",
"terra2"
"terra2",
"dymension"
];

async function getBlock(timestamp: number, chain: Chain, chainBlocks = {} as ChainBlocks) {
Expand Down

0 comments on commit 3d4c321

Please sign in to comment.