Skip to content

Commit

Permalink
Cleanup of unused Pools components and related logic (#5059)
Browse files Browse the repository at this point in the history
* Cleanup Pools: remove pools components

* Cleanup Pools: uniswap liqudity tokens cleanup

* Cleanup Pools: remove unused liquidity pool expanded states

* Cleanup Pools: remove unused apollo queries

* Cleanup Pools: remove uniswapLiquidity redux

* Cleanup Pools: remove usersPositions redux

* Cleanup unused Savings components and related logic (#5060)

* Cleanup Savings: remove savings components

* Cleanup Savings: remove refetch savings logic in data redux

* Cleanup Savings: remove more savings components from RAL v1 list

* Cleanup Savings: remove unused SavingsSheet
  • Loading branch information
jinchung authored Sep 20, 2023
1 parent 58efb43 commit 278c22f
Show file tree
Hide file tree
Showing 63 changed files with 43 additions and 3,623 deletions.
24 changes: 0 additions & 24 deletions src/apollo/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,6 @@ export const compoundClientDeprecated = new ApolloClient({
}),
});

/**
* @deprecated Use the `@/graphql` module for new GraphQL queries.
* @link https://github.com/rainbow-me/rainbow/blob/develop/src/graphql/README.md
* */
export const uniswapClientDeprecated = new ApolloClient({
...defaultOptions,
cache: new InMemoryCache(),
link: new HttpLink({
uri: 'https://api.thegraph.com/subgraphs/name/ianlapham/uniswapv2',
}),
});

/**
* @deprecated Use the `@/graphql` module for new GraphQL queries.
* @link https://github.com/rainbow-me/rainbow/blob/develop/src/graphql/README.md
* */
export const blockClientDeprecated = new ApolloClient({
...defaultOptions,
cache: new InMemoryCache(),
link: new HttpLink({
uri: 'https://api.thegraph.com/subgraphs/name/blocklytics/ethereum-blocks',
}),
});

export class ApolloClientWithTimeout extends ApolloClient<any> {
queryWithTimeout<T = any, TVariables = OperationVariables>(
options: QueryOptions<TVariables, T>,
Expand Down
138 changes: 0 additions & 138 deletions src/apollo/queries.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
import gql from 'graphql-tag';

export const UNISWAP_PAIR_DATA_QUERY_VOLUME = (
pairAddress: string,
block: number
) => {
const queryString = `
fragment PairFields on Pair {
volumeUSD
}
query pairs {
pairs(${
block ? `block: {number: ${block}}` : ``
} where: { id: "${pairAddress}"} ) {
...PairFields
}
}`;
return gql`
${queryString}
`;
};

export const COMPOUND_ACCOUNT_AND_MARKET_QUERY = gql`
query account($id: ID!) {
markets {
Expand Down Expand Up @@ -48,124 +28,6 @@ export const COMPOUND_ACCOUNT_AND_MARKET_QUERY = gql`
}
`;

export const UNISWAP_ADDITIONAL_POOL_DATA = gql`
query pairs($address: String!) {
pairs(where: { id: $address }) {
volumeUSD
reserveUSD
trackedReserveETH
}
}
`;

export const GET_BLOCKS_QUERY = (timestamps: any) => {
let queryString = 'query blocks {';
queryString += timestamps.map((timestamp: any) => {
return `t${timestamp}:blocks(first: 1, orderBy: timestamp, orderDirection: desc, where: { timestamp_gt: ${timestamp}, timestamp_lt: ${
timestamp + 600
} }) {
number
}`;
});
queryString += '}';
return gql`
${queryString}
`;
};

export const USER_POSITIONS = gql`
query liquidityPositions($user: Bytes!) {
liquidityPositions(where: { user: $user, liquidityTokenBalance_gt: 0 }) {
pair {
id
reserve0
reserve1
reserveUSD
token0 {
decimals
id
name
symbol
derivedETH
}
token1 {
decimals
id
name
symbol
derivedETH
}
totalSupply
}
liquidityTokenBalance
}
}
`;

export const USER_MINTS_BURNS_PER_PAIR = gql`
query events($user: Bytes!, $pair: Bytes!) {
mints(where: { to: $user, pair: $pair }) {
amountUSD
amount0
amount1
timestamp
pair {
token0 {
id
}
token1 {
id
}
}
}
burns(where: { sender: $user, pair: $pair }) {
amountUSD
amount0
amount1
timestamp
pair {
token0 {
id
}
token1 {
id
}
}
}
}
`;

export const USER_HISTORY = gql`
query snapshots($user: Bytes!, $skip: Int!) {
liquidityPositionSnapshots(
first: 1000
skip: $skip
where: { user: $user }
) {
timestamp
reserveUSD
liquidityTokenBalance
liquidityTokenTotalSupply
reserve0
reserve1
token0PriceUSD
token1PriceUSD
pair {
id
reserve0
reserve1
reserveUSD
token0 {
id
}
token1 {
id
}
}
}
}
`;

export const CONTRACT_FUNCTION = gql`
query contractFunction($chainID: Int!, $hex: String!) {
contractFunction(chainID: $chainID, hex: $hex) {
Expand Down
Loading

0 comments on commit 278c22f

Please sign in to comment.