-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use updated templeCirculatingSupply #919
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ import { RAMOSMetrics } from './RAMOSMetrics'; | |
import { Button } from 'components/Button/Button'; | ||
import { useEffect, useState } from 'react'; | ||
import { fetchGenericSubgraph } from 'utils/subgraph'; | ||
import env from 'constants/env'; | ||
|
||
interface Metrics { | ||
price: number; | ||
|
@@ -92,33 +93,33 @@ const Home = ({ tlc }: { tlc?: boolean }) => { | |
useEffect(() => { | ||
const fetchMetrics = async () => { | ||
const { data: treasuryData } = await fetchGenericSubgraph<any>( | ||
'https://api.thegraph.com/subgraphs/name/medariox/temple-metrics', | ||
env.subgraph.protocolMetrics, | ||
`{ | ||
metrics { | ||
treasuryValueUSD | ||
} | ||
}` | ||
); | ||
const { data: arbitrumTreasuryData } = await fetchGenericSubgraph<any>( | ||
'https://api.thegraph.com/subgraphs/name/medariox/temple-metrics-arbitrum', | ||
env.subgraph.protocolMetricsArbitrum, | ||
`{ | ||
metrics { | ||
treasuryValueUSD | ||
} | ||
}` | ||
); | ||
const { data: ramosData } = await fetchGenericSubgraph<any>( | ||
'https://api.thegraph.com/subgraphs/name/templedao/templedao-ramos', | ||
env.subgraph.protocolMetrics, | ||
`{ | ||
metrics { | ||
treasuryPriceIndexUSD | ||
templePriceUSD | ||
treasuryPriceIndex | ||
templePrice | ||
} | ||
}` | ||
); | ||
setMetrics({ | ||
price: parseFloat(ramosData.metrics[0].templePriceUSD), | ||
tpi: parseFloat(ramosData.metrics[0].treasuryPriceIndexUSD), | ||
price: parseFloat(ramosData.metrics[0].templePrice), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done 4d01631 |
||
tpi: parseFloat(ramosData.metrics[0].treasuryPriceIndex), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done 4d01631 |
||
treasury: | ||
parseFloat(treasuryData.metrics[0].treasuryValueUSD) + | ||
parseFloat(arbitrumTreasuryData.metrics[0].treasuryValueUSD), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isnt there appropriate config in the
constants/env/types.ts
Subgraph
?e: here https://github.com/TempleDAO/temple/blob/stage/apps/dapp/src/constants/env/production.tsx#L133
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new subgraph, let me check with @medariox and if nothing else will add it to the config properly.