Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge preprod to master #86

Merged
merged 90 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
674ad34
add dropdown
NandyBa Jun 14, 2024
f668dd5
simplify selector and add all token option
NandyBa Jun 14, 2024
d778d54
feat: change allPage value to Infinity
NandyBa Jul 31, 2024
ca241d3
feat: estimate the fully rented rent
NandyBa Aug 8, 2024
c779b47
feat: add fully rented estimation to asset cards
NandyBa Aug 8, 2024
554c16a
refactor: move hook calls to top of the page
NandyBa Aug 8, 2024
0b9d732
fix: propInfo definition
NandyBa Aug 8, 2024
bcd085b
fix: last rent condition
NandyBa Aug 8, 2024
d8586f4
feat: add estimation for property with not fully rented history
NandyBa Aug 8, 2024
6860e2b
feat: get fully rented APR
NandyBa Aug 8, 2024
aafdb19
apply max APR method
NandyBa Aug 9, 2024
7d79682
rename variable and functions
NandyBa Aug 9, 2024
403f1e4
feat: add RWA token
NandyBa Aug 12, 2024
f720c4a
feat: re-enable property onClick
NandyBa Aug 12, 2024
5d4064a
feat: add rwa valuation on the rwa card
NandyBa Aug 12, 2024
82235e5
fix: missing property
NandyBa Aug 12, 2024
ab1c085
feat: add rwa to summary card
NandyBa Aug 12, 2024
2fb3ecc
define useRWA
NandyBa Aug 14, 2024
50840ed
take into account user currency
NandyBa Aug 14, 2024
b67a48e
feat: add RWA value to net value calculation
NandyBa Aug 14, 2024
89da9f6
remove comment
NandyBa Aug 14, 2024
7dfe620
refactor: clean imports
NandyBa Aug 14, 2024
231ea30
feat: include RWA on Ethereum
NandyBa Aug 14, 2024
787bf7c
fix: en communs
NandyBa Aug 14, 2024
1e4e44e
feat: update filter to support RWA token
NandyBa Aug 15, 2024
aa6f3d7
fix: prettier
NandyBa Aug 15, 2024
60908da
fix: other prettier errors
NandyBa Aug 15, 2024
c7dd3d6
let prettier add strange semi-column
NandyBa Aug 15, 2024
3d51ee6
fix: imports
NandyBa Aug 15, 2024
6462260
use hook
NandyBa Aug 15, 2024
86cfeb2
add fallback
NandyBa Aug 15, 2024
3e0787a
switch for a useMemo
NandyBa Aug 15, 2024
175d3ff
feat: add real time fully rented APR
NandyBa Aug 15, 2024
d00acd3
feat: add gloabl metric fully rented APR
NandyBa Aug 15, 2024
8cded5d
feat: add disclaimer
NandyBa Aug 15, 2024
cdc615f
feat: add disclaimer
NandyBa Aug 15, 2024
1ae5788
feat: update disclaimer message
NandyBa Aug 15, 2024
72abe31
fix: disclaimer message
NandyBa Aug 15, 2024
417c038
improve message
NandyBa Aug 15, 2024
6beb363
feat: create yam statics stics page
NandyBa Aug 17, 2024
0b29e7d
feat: add yam statistics for all RealT Tokens on Gnosis (who have Gno…
NandyBa Aug 17, 2024
7568a40
feat: mask tokens with no volume
NandyBa Aug 17, 2024
e3c048d
fix: add token name
NandyBa Aug 17, 2024
31bf8c9
feat: add pagination
NandyBa Aug 17, 2024
0a3d7e8
feat: improve style
NandyBa Aug 17, 2024
ddfc70a
feat: change token per page to 100
NandyBa Aug 17, 2024
1707f15
Merge pull request #62 from RealToken-Community/yam-statistics
AlexRLT Aug 17, 2024
30a6824
Merge pull request #61 from RealToken-Community/add-rwa
AlexRLT Aug 17, 2024
57aa448
Merge branch 'develop' into add-selector-for-the-amount-of-thumbnails…
NandyBa Aug 17, 2024
08ba640
Merge pull request #50 from RealToken-Community/add-selector-for-the-…
AlexRLT Aug 17, 2024
553a319
Merge branch 'develop' into estimate-fully-rented-rent
NandyBa Aug 17, 2024
94102b8
feat: add fully rented APR to asset grid
NandyBa Aug 17, 2024
791ef77
refactor: remove logs
NandyBa Aug 17, 2024
86b991d
feat: add fully rented APR to property details
NandyBa Aug 17, 2024
a78c828
Merge pull request #60 from RealToken-Community/estimate-fully-rented…
AlexRLT Aug 18, 2024
d3aacda
fix: reset current page when tokens changed
NandyBa Aug 18, 2024
ce1b280
fix: reset current page when user change page size
NandyBa Aug 18, 2024
7169d01
feat: add translation for YAM statistics hearder label
NandyBa Aug 18, 2024
60708c6
fix: yamStatistics: use selected currency for token price
NandyBa Aug 18, 2024
b93d813
feat: yamStatistics: add owned | all filter
NandyBa Aug 18, 2024
addc2e7
feat: yamStatistics: add subsidized, fullySubsidized and notSubsidize…
NandyBa Aug 18, 2024
58c2c79
Merge pull request #63 from RealToken-Community/bunch-fixes-and-impro…
AlexRLT Aug 19, 2024
599825b
add additional fallbacks RPC URLs
NandyBa Aug 25, 2024
90bfcf0
fix: RPC initialization on currencies file
NandyBa Aug 25, 2024
2c289c0
Merge pull request #65 from RealToken-Community/add-fallbacks-rpc-urls
AlexRLT Aug 25, 2024
9e00655
Merge pull request #66 from RealToken-Community/develop
AlexRLT Aug 25, 2024
03a466c
feat: YamStatistic: add Yamp Volume's number of days
NandyBa Aug 26, 2024
0e2bbb9
fix: fullyRentedAPR: fix french disclaimer text
NandyBa Aug 26, 2024
c9313ae
fix: second disclaimer text small error
NandyBa Aug 26, 2024
77f1f55
feat: fullyRentedAPR: manage VEFA properties
NandyBa Aug 26, 2024
62a9fe2
refactore: improve comment
NandyBa Aug 26, 2024
3a833bf
feat: show VEFA properties forced fully rented APR only if property d…
NandyBa Aug 26, 2024
2885342
fix: RWA table view
NandyBa Aug 26, 2024
79bdd62
Merge pull request #68 from RealToken-Community/fix-texts
AlexRLT Aug 26, 2024
34f6157
Merge pull request #70 from RealToken-Community/fix-rwa-table-view
AlexRLT Aug 26, 2024
ddedfb8
Merge pull request #69 from RealToken-Community/feat-fully-rented-apr…
AlexRLT Aug 26, 2024
8ba6b9a
Merge pull request #71 from RealToken-Community/develop
AlexRLT Aug 26, 2024
00ab067
feat: add bridge link on header (#74)
Yohann76 Aug 28, 2024
b753a52
fix: VEFA Realtime APR
NandyBa Aug 28, 2024
c0fe9df
Merge pull request #75 from RealToken-Community/fix-vefa-realtime-APR
AlexRLT Aug 29, 2024
072a3c7
Merge pull request #76 from RealToken-Community/develop
AlexRLT Aug 30, 2024
3fca9df
Merge branch 'master' into preprod
NandyBa Aug 31, 2024
8f8b11d
fix-vefa-properties-name (#78)
jojodunet Aug 31, 2024
378f936
chore: release v2.4.0 (#79)
jojodunet Aug 31, 2024
309459d
feat: use API return by API for VEFA property in real time mode
NandyBa Sep 1, 2024
72c4d1d
fix: start date filtering issue caused by RWA token
NandyBa Sep 1, 2024
fd211a5
Merge pull request #82 from RealToken-Community/vefa-apr-realtime
AlexRLT Sep 1, 2024
183bbcd
Merge pull request #83 from RealToken-Community/fix-start-date-filtering
AlexRLT Sep 1, 2024
2d6bbf3
Merge pull request #81 from RealToken-Community/develop
AlexRLT Sep 1, 2024
80f8e5a
fix: APY fully rented for properties before start rent day (#85)
NandyBa Sep 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "realtoken-dashboard-v2",
"version": "2.3.3",
"version": "2.4.0",
"scripts": {
"dev": "next dev",
"build": "next build",
Expand Down
2 changes: 1 addition & 1 deletion src/components/assetsView/filters/AssetsViewSort.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export function useAssetsViewSort(filter: AssetsViewSortFilter) {
case AssetSortType.RENT:
return B.amount * B.netRentDayPerToken - A.amount * A.netRentDayPerToken
case AssetSortType.RENT_START:
return B.rentStartDate.date.localeCompare(A.rentStartDate.date)
return B.rentStartDate?.date.localeCompare(A.rentStartDate?.date)
case AssetSortType.NAME:
return A.shortName.localeCompare(b.shortName)
case AssetSortType.SUPPLY:
Expand Down
60 changes: 59 additions & 1 deletion src/components/assetsView/views/AssetTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const AssetTable: FC<{
{props.realtokens.map((item, index) => {
const isAProperty = item.hasOwnProperty('rentStatus')
if (!isAProperty) {
return <AssetTableRow key={'0'} value={item as UserRealtoken} />
return <RWATableRow key={'0'} value={item as RWARealtoken} />
}
return <AssetTableRow key={index} value={item as UserRealtoken} />
})}
Expand Down Expand Up @@ -159,4 +159,62 @@ const AssetTableRow: FC<{ value: UserRealtoken }> = (props) => {
</Table.Tr>
)
}

const RWATableRow: FC<{ value: RWARealtoken }> = (props) => {
const { t } = useTranslation('common', { keyPrefix: 'numbers' })
const transfersIsLoaded = useSelector(selectTransfersIsLoaded)

const { shortName, value, unitPriceCost, amount, totalInvestment } =
props.value

return (
<Table.Tr>
<Table.Td style={{ minWidth: '150px' }}>
<Anchor>{shortName}</Anchor>
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{useCurrencyValue(value)}
</Table.Td>
{transfersIsLoaded ? (
<>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
</>
) : null}

<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{useCurrencyValue(unitPriceCost)}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{t('decimal', { value: amount })}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{useCurrencyValue(totalInvestment)}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
</Table.Tr>
)
}

AssetTableRow.displayName = 'AssetTableRow'
7 changes: 7 additions & 0 deletions src/components/layouts/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ export const Header: FC = () => {
label={t('YAM')}
leftSection={<IconExternalLink size={'1rem'} stroke={1.5} />}
/>
<NavLink
component={'a'}
href={'https://bridge.realtoken.network/'}
target={'_blank'}
label={t('Bridge')}
leftSection={<IconExternalLink size={'1rem'} stroke={1.5} />}
/>
</Drawer>
<div>
<Box className={styles.container}>
Expand Down
50 changes: 45 additions & 5 deletions src/hooks/useFullyRentedAPR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ import {
RentCalculationState,
} from 'src/types/RentCalculation'

const fullyRentedAPREstimation = (token: UserRealtoken) => {
const fullyRentedAPREstimation = (
token: UserRealtoken,
rentCalculation: RentCalculation,
) => {
// VEFA properties
if (isVEFA(token)) {
return getVEFAFullRentedAPR(token, rentCalculation)
}

// Case of fully rented property
if (token.rentedUnits === token.totalUnits) {
return token.annualPercentageYield
Expand Down Expand Up @@ -59,7 +67,7 @@ export const useFullyRentedAPR = (token: UserRealtoken) => {
const fullyRentedAPR = useMemo(() => {
const isDisabled = APRDisabled(rentCalculation, token)
if (isDisabled) return 0
return fullyRentedAPREstimation(token)
return fullyRentedAPREstimation(token, rentCalculation)
}, [token, rentCalculation])

return fullyRentedAPR
Expand All @@ -70,14 +78,16 @@ export const useGeneralFullyRentedAPR = (tokens: UserRealtoken[]) => {
// Fully rented APR average using valuation ponderation
const fullyRentedAPR = useMemo(() => {
const totalValue = tokens.reduce((acc, token) => {
const isDisabled = APRDisabled(rentCalculation, token)
const isDisabled = APRDisabled(rentCalculation, token) && !isVEFA(token)
if (isDisabled) return acc
return acc + token.value
}, 0)
const totalAPR = tokens.reduce((acc, token) => {
const isDisabled = APRDisabled(rentCalculation, token)
const isDisabled = APRDisabled(rentCalculation, token) && !isVEFA(token)
if (isDisabled) return acc
return acc + token.value * fullyRentedAPREstimation(token)
return (
acc + token.value * fullyRentedAPREstimation(token, rentCalculation)
)
}, 0)
return totalAPR / totalValue
}, [tokens, rentCalculation])
Expand All @@ -96,3 +106,33 @@ const APRDisabled = (
rentStartDate > realtimeDate.toDate()
return isDisabled
}

export const isVEFA = (token: UserRealtoken) => {
return (
token.shortName === 'Playa Caracol Cottage 10' ||
token.shortName === 'Playa Caracol 303300 E' ||
token.shortName === 'Playa Caracol 303200 E' ||
token.shortName === 'PH Pinoalto A002' ||
token.shortName === 'PH Pinoalto A003' ||
token.shortName === 'Vervana T1 '
)
}

const VEFAAPRs = {
'Playa Caracol Cottage 10': 10.77,
'Playa Caracol 303300 E': 10.69,
'Playa Caracol 303200 E': 10.8,
'PH Pinoalto A002': 10.11,
'PH Pinoalto A003': 10.11,
'Vervana T1 ': 11.33,
}

const getVEFAFullRentedAPR = (
token: UserRealtoken,
rentCalculation: RentCalculation,
) => {
if (rentCalculation.state === RentCalculationState.Realtime) {
return token.annualPercentageYield
}
return VEFAAPRs[token.shortName as keyof typeof VEFAAPRs]
}
3 changes: 2 additions & 1 deletion src/i18next/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"home": "Home",
"realt": "RealT",
"RMM": "RMM",
"YAM": "YAM"
"YAM": "YAM",
"Bridge": "Bridge"
},
"settings": {
"title": "Language",
Expand Down
5 changes: 3 additions & 2 deletions src/i18next/locales/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"home": "Accueil",
"realt": "RealT",
"RMM": "RMM",
"YAM": "YAM"
"YAM": "YAM",
"Bridge": "Bridge"
},
"settings": {
"title": "Langue",
Expand Down Expand Up @@ -395,6 +396,6 @@
"description": "Récupération de vos transactions en cours. Ce chargement peut prendre un certain temps en fonction du nombre de transactions effecutées (10-20 secondes / 1000 transactions). Lors de vos prochaines visites, seul les nouvelles transactions seront récupérées."
},
"disclaimer":{
"fullyRentedAPR": "Cette estimation est en phase bêta et a été développée par la communauté RealT. Nous vous invitons à signaler tout problème éventuel. Les informations fournies sont à titre indicatif uniquement. La communauté RealT ou RealT ne peut être tenu responsable en cas de décision prise à partir de données inexactites."
"fullyRentedAPR": "Cette estimation est en phase bêta et a été développée par la communauté RealT. Nous vous invitons à signaler tout problème éventuel. Les informations fournies sont à titre indicatif uniquement. La communauté RealT ou RealT ne peut être tenue responsable en cas de décision prise à partir de données inexactes."
}
}
2 changes: 1 addition & 1 deletion src/pages/yamStatistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const YamStatisticsPage = () => {
<th>Token Price</th>
<th>Yam Price</th>
<th>Yam Difference (30 days)</th>
<th>Yam Volume</th>
<th>Yam Volume (30 days)</th>
</tr>
{paginationYamStatistics.map((statistics, index) => (
<YamStatisticsRow
Expand Down
Loading