Skip to content

Commit

Permalink
get staked amount from gql
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-d committed Jun 24, 2024
1 parent 0c3355e commit 6b71fac
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 9 additions & 1 deletion web/src/app/stake/MyPositions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ const MyPositionsWalletFragment = graphql(`
symbol
}
}
liquidity {
fusdc {
valueUsd
}
token1 {
valueUsd
}
}
}
}
}
Expand Down Expand Up @@ -74,7 +82,7 @@ export const MyPositions = () => {
symbol: position.pool.token.symbol,
},
],
staked: 0,
staked: parseFloat(position.liquidity.fusdc.valueUsd) + parseFloat(position.liquidity.token1.valueUsd),
totalYield: 0,
}));
}, [showDemoData, address, walletData]);
Expand Down
4 changes: 2 additions & 2 deletions web/src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
const documents = {
"\n fragment SwapFormFragment on SeawaterPool {\n address\n earnedFeesAPRFUSDC\n earnedFeesAPRToken1\n token {\n address\n decimals\n name\n symbol\n }\n }\n": types.SwapFormFragmentFragmentDoc,
"\n fragment AllPoolsFragment on SeawaterPool {\n address\n token {\n name\n decimals\n }\n volumeOverTime {\n daily {\n fusdc {\n valueScaled\n }\n }\n }\n tvlOverTime {\n daily\n }\n liquidityOverTime {\n daily {\n fusdc {\n valueScaled\n }\n }\n }\n liquidityIncentives {\n valueUsd\n }\n superIncentives {\n valueUsd\n }\n positions {\n positions {\n lower\n upper\n }\n }\n }\n": types.AllPoolsFragmentFragmentDoc,
"\n fragment MyPositionsWalletFragment on Wallet {\n id\n positions {\n positions {\n positionId\n pool {\n token {\n name\n address\n symbol\n }\n }\n }\n }\n }\n": types.MyPositionsWalletFragmentFragmentDoc,
"\n fragment MyPositionsWalletFragment on Wallet {\n id\n positions {\n positions {\n positionId\n pool {\n token {\n name\n address\n symbol\n }\n }\n liquidity {\n fusdc {\n valueUsd\n }\n token1 {\n valueUsd\n }\n }\n }\n }\n }\n": types.MyPositionsWalletFragmentFragmentDoc,
"\n fragment SelectPrimeAssetFragment on SeawaterPool {\n address\n volumeOverTime {\n daily {\n fusdc {\n valueUsd\n }\n }\n }\n token {\n name\n symbol\n address\n decimals\n }\n }\n": types.SelectPrimeAssetFragmentFragmentDoc,
"\n fragment ManagePoolFragment on SeawaterPool {\n address\n id\n token {\n symbol\n name\n decimals\n }\n liquidityIncentives {\n valueScaled\n }\n superIncentives {\n valueScaled\n }\n utilityIncentives {\n amountGivenOut\n maximumAmount\n }\n earnedFeesAPRFUSDC\n }\n": types.ManagePoolFragmentFragmentDoc,
"\nfragment PositionsFragment on Wallet {\n positions {\n positions {\n positionId\n pool {\n address\n }\n lower\n upper\n liquidity {\n fusdc {\n valueUsd\n }\n token1 {\n valueUsd\n }\n }\n }\n }\n}\n": types.PositionsFragmentFragmentDoc,
Expand Down Expand Up @@ -55,7 +55,7 @@ export function graphql(source: "\n fragment AllPoolsFragment on SeawaterPool {
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(source: "\n fragment MyPositionsWalletFragment on Wallet {\n id\n positions {\n positions {\n positionId\n pool {\n token {\n name\n address\n symbol\n }\n }\n }\n }\n }\n"): (typeof documents)["\n fragment MyPositionsWalletFragment on Wallet {\n id\n positions {\n positions {\n positionId\n pool {\n token {\n name\n address\n symbol\n }\n }\n }\n }\n }\n"];
export function graphql(source: "\n fragment MyPositionsWalletFragment on Wallet {\n id\n positions {\n positions {\n positionId\n pool {\n token {\n name\n address\n symbol\n }\n }\n liquidity {\n fusdc {\n valueUsd\n }\n token1 {\n valueUsd\n }\n }\n }\n }\n }\n"): (typeof documents)["\n fragment MyPositionsWalletFragment on Wallet {\n id\n positions {\n positions {\n positionId\n pool {\n token {\n name\n address\n symbol\n }\n }\n liquidity {\n fusdc {\n valueUsd\n }\n token1 {\n valueUsd\n }\n }\n }\n }\n }\n"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand Down
Loading

0 comments on commit 6b71fac

Please sign in to comment.