55 StakeTokenService ,
66 UmbrellaBatchHelperService ,
77} from '@aave/contract-helpers' ;
8+ import { valueToBigNumber } from '@aave/math-utils' ;
89import { Trans } from '@lingui/macro' ;
910import { BoxProps } from '@mui/material' ;
1011import { useQueryClient } from '@tanstack/react-query' ;
@@ -13,6 +14,7 @@ import { parseUnits } from 'ethers/lib/utils';
1314import { useEffect , useState } from 'react' ;
1415import { TxActionsWrapper } from 'src/components/transactions/TxActionsWrapper' ;
1516import { APPROVAL_GAS_LIMIT , checkRequiresApproval } from 'src/components/transactions/utils' ;
17+ import { ComputedReserveData } from 'src/hooks/app-data-provider/useAppDataProvider' ;
1618import { MergedStakeData } from 'src/hooks/stake/useUmbrellaSummary' ;
1719import { SignedParams , useApprovalTx } from 'src/hooks/useApprovalTx' ;
1820import { useApprovedAmount } from 'src/hooks/useApprovedAmount' ;
@@ -37,6 +39,7 @@ export interface StakeActionProps extends BoxProps {
3739 selectedToken : StakeInputAsset ;
3840 event : string ;
3941 isMaxSelected : boolean ;
42+ reserve : ComputedReserveData ;
4043}
4144
4245export const UmbrellaActions = ( {
@@ -49,6 +52,7 @@ export const UmbrellaActions = ({
4952 event,
5053 stakeData,
5154 isMaxSelected,
55+ reserve,
5256 ...props
5357} : StakeActionProps ) => {
5458 const queryClient = useQueryClient ( ) ;
@@ -193,6 +197,7 @@ export const UmbrellaActions = ({
193197 action : ProtocolAction . umbrellaStake ,
194198 amount : amountToStake ,
195199 assetName : selectedToken . symbol ,
200+ amountUsd : valueToBigNumber ( amountToStake ) . multipliedBy ( reserve . priceInUSD ) . toString ( ) ,
196201 } ) ;
197202
198203 queryClient . invalidateQueries ( { queryKey : queryKeysFactory . umbrella } ) ;
0 commit comments