Skip to content

Commit

Permalink
refactor: Remove unused code and optimize useWhirlPoolInformation hook
Browse files Browse the repository at this point in the history
  • Loading branch information
mohandast52 committed Aug 9, 2024
1 parent a1386c0 commit b3a13f0
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ const whirlpoolQuery = async () => {
return filteredPositions;
};

const useWhirlpoolQuery = () => {
return useCallback(async () => {
const result = await whirlpoolQuery();
return result;
}, []);
};

/**
* Hook to get the data from the whirlpool
*/
Expand All @@ -103,11 +96,10 @@ export const useWhirlpool = () => {
};

export const useWhirlPoolInformation = () => {
const getPositions = useWhirlpoolQuery();
const { getWhirlpoolData } = useWhirlpool();

return useCallback(async () => {
const positions = await getPositions();
const positions = await whirlpoolQuery();

if (!positions) return null;

Expand Down Expand Up @@ -164,5 +156,5 @@ export const useWhirlPoolInformation = () => {

const svmPriceLp = getSvmCalculatedPriceLp(reserveOlas, totalSupply.toString());
return svmPriceLp;
}, [getPositions, getWhirlpoolData]);
}, [getWhirlpoolData]);
};

0 comments on commit b3a13f0

Please sign in to comment.