Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.vscode/*
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,8 @@
"last 1 safari version"
]
},
"license": "GPL-3.0-or-later"
"license": "GPL-3.0-or-later",
"dependencies": {
"react-google-charts": "^4.0.0"
}
}
30 changes: 30 additions & 0 deletions src/apollo/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ export const client = new ApolloClient({
shouldBatch: true,
})

export const v2Client = new ApolloClient({
link: new HttpLink({
uri: 'https://api.thegraph.com/subgraphs/name/voltfinance/voltage-exchange-v2',
}),
cache: new InMemoryCache(),
shouldBatch: true,
})

export const healthClient = new ApolloClient({
link: new HttpLink({
uri: 'https://api.thegraph.com/index-node/graphql',
Expand All @@ -34,9 +42,31 @@ export const stakingClient = new ApolloClient({
shouldBatch: true,
})

export const barClient = new ApolloClient({
link: new HttpLink({
uri: 'https://api.thegraph.com/subgraphs/name/t0mcr8se/voltbar',
}),
cache: new InMemoryCache(),
shouldBatch: true,
})

export const blockClient = new ApolloClient({
link: new HttpLink({
uri: 'https://api.thegraph.com/subgraphs/name/fuseio/fuse-blocks',
}),
cache: new InMemoryCache(),
})

export const stableswapClient = new ApolloClient({
link: new HttpLink({
uri: 'https://api.thegraph.com/subgraphs/name/t0mcr8se/stableswap-subgraph',
}),
cache: new InMemoryCache(),
})

export const fusdClient = new ApolloClient({
link: new HttpLink({
uri: 'https://api.thegraph.com/subgraphs/name/voltfinance/fusd-subgraph',
}),
cache: new InMemoryCache(),
})
99 changes: 97 additions & 2 deletions src/apollo/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ export const GET_BLOCK = gql`
export const GET_BLOCKS = (timestamps) => {
let queryString = 'query blocks {'
queryString += timestamps.map((timestamp) => {
return `t${timestamp}:blocks(first: 1, orderBy: timestamp, orderDirection: desc, where: { timestamp_gt: ${timestamp}, timestamp_lt: ${timestamp + 600
} }) {
return `t${timestamp}:blocks(first: 1, orderBy: timestamp, orderDirection: desc, where: { timestamp_gt: ${timestamp}, timestamp_lt: ${
timestamp + 600
} }) {
number
}`
})
Expand Down Expand Up @@ -450,6 +451,21 @@ export const GLOBAL_DATA = (block) => {
return gql(queryString)
}

export const GLOBAL_DATA_V2 = gql`
query uniswapFactories {
uniswapFactories(where: { id: "${FACTORY_ADDRESS}" }) {
id
totalVolumeUSD
totalVolumeETH
untrackedVolumeUSD
totalLiquidityUSD
totalLiquidityETH
txCount
pairCount
}
}
`

export const GLOBAL_TXNS = gql`
query transactions {
transactions(first: 100, orderBy: timestamp, orderDirection: desc) {
Expand Down Expand Up @@ -532,6 +548,58 @@ export const ALL_TOKENS = gql`
}
`

export const BAR_QUERY = gql`
query bar {
bars(first: 1) {
id
ratio
totalSupply
voltStaked
}
histories(first: 1000, orderBy: id, orderDirection: desc) {
id
date
voltStaked
ratio
}
voltBalanceHistories(first: 1000, orderBy: id, orderDirection: desc) {
id
totalVoltStaked
}
}
`

export const STABLESWAP_DATA = gql`
{
systemInfos(first: 5) {
id
exchangeCount
swapCount
tokenCount
}
swaps(first: 5) {
id
address
numTokens
lpTokenSupply
virtualPrice
cumulativeVolume
tokens {
id
}
}
dailyVolumes(first: 1000, orderBy: timestamp, orderDirection: desc) {
id
swap {
id
}
timestamp
lpTokenSupply
volume
}
}
`

export const TOKEN_SEARCH = gql`
query tokens($value: String, $id: String) {
asSymbol: tokens(where: { symbol_contains: $value }, orderBy: totalLiquidity, orderDirection: desc) {
Expand Down Expand Up @@ -859,3 +927,30 @@ export const FILTERED_TRANSACTIONS = gql`
}
}
`

export const FUSD_DATA = gql`
{
massetDayDatas(first: 1000, orderBy: id, orderDirection: desc) {
id
totalSupply
dailyRedeemAmount
dailySwapAmount
dailyMintAmount
}
massets(first: 10) {
id
totalSupply {
simple
}
cumulativeRedeemed {
simple
}
cumulativeMinted {
simple
}
cumulativeSwapped {
simple
}
}
}
`
Loading