Skip to content

Commit

Permalink
add new stakewise address
Browse files Browse the repository at this point in the history
  • Loading branch information
gmbronco committed Jun 11, 2024
1 parent 9dfc5fb commit af9d162
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/sources/stakewise.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const url = 'https://mainnet-graph.stakewise.io/subgraphs/name/stakewise/stakewise'
const url =
'https://mainnet-graph.stakewise.io/subgraphs/name/stakewise/stakewise'

const query = `
{
Expand All @@ -9,7 +10,7 @@ const query = `
`

const requestQuery = {
query
query,
}

interface Response {
Expand All @@ -24,16 +25,21 @@ export const stakewise = async () => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
},
body: JSON.stringify(requestQuery)
body: JSON.stringify(requestQuery),
})

const {
data: { osTokens: [{ apy }] },
} = await response.json() as Response
data: {
osTokens: [{ apy }],
},
} = (await response.json()) as Response

const apr = Math.round(Number(apy) * 100)

return {
'0xf1c9acdc66974dfb6decb12aa385b9cd01190e38': Math.round(Number(apy) * 100),
'0xf1c9acdc66974dfb6decb12aa385b9cd01190e38': apr,
'0xf7d4e7273e5015c96728a6b02f31c505ee184603': apr,
}
}

0 comments on commit af9d162

Please sign in to comment.