@@ -7,6 +7,7 @@ import isEqual from 'lodash.isequal'
77import moment from 'moment'
88import { RedBankSlice } from 'store/interfaces/redBank.interface'
99import { Store } from 'store/interfaces/store.interface'
10+ import colors from 'styles/_assets.module.scss'
1011import { State } from 'types/enums'
1112import { GetState } from 'zustand'
1213import { NamedSet } from 'zustand/middleware'
@@ -31,7 +32,21 @@ const redBankSlice = (set: NamedSet<Store>, get: GetState<Store>): RedBankSlice
3132
3233 const incentiveAssetsInfo = incentives . map ( ( incentive : MarketIncentive ) => {
3334 const incentiveAsset = findAssetByDenom ( incentive . denom , assets )
34- if ( ! incentiveAsset ) return
35+ if ( ! incentiveAsset )
36+ return {
37+ symbol : MARS_SYMBOL ,
38+ color : colors . mars ,
39+ apy : 0 ,
40+ }
41+ const startTime = incentive . start_time ?? 0
42+ const duration = incentive . duration ?? 0
43+ const isValid = moment ( ) . isBefore ( moment ( startTime + duration ) )
44+ if ( ! isValid )
45+ return {
46+ symbol : incentiveAsset . symbol ,
47+ color : incentiveAsset . color ,
48+ apy : 0 ,
49+ }
3550 const anualEmission = Number ( incentive . emission_per_second ) * SECONDS_IN_YEAR
3651 const anualEmissionVaule = convertToBaseCurrency ( {
3752 denom : incentive . denom ,
@@ -93,7 +108,6 @@ const redBankSlice = (set: NamedSet<Store>, get: GetState<Store>): RedBankSlice
93108 findByDenom ( get ( ) . marketInfo , asset . denom ) ?. incentives ,
94109 { denom : asset . denom , amount : depositLiquidity . toString ( ) } ,
95110 )
96-
97111 const redBankAsset : RedBankAsset = {
98112 ...asset ,
99113 walletBalance : assetWallet ?. amount . toString ( ) ,
0 commit comments