On-Chain Rent Calculation

At 0xequity, token holders of a specific property receive monthly rent proportional to the number of tokens they own—the more tokens, the higher the rent. The rent per month is being calculated on-chain using the formula provided below.

Average Number of Days in a Month

To accurately compute the average number of days in a month, accounting for leap years in the Gregorian calendar, follow these steps:

Understanding Leap Years

The Gregorian calendar has two types of years:

  • Common years: These have 365 days.

  • Leap years: These have 366 days, occurring every 4 years, except for years divisible by 100 but not divisible by 400.

Calculating Average Days Per Year

The Gregorian calendar system we use cycles every 400 years, which is 4800 months. In a cycle, there are 7 x 400 = 2800 months of 31 days, there are 4 x 400 = 1600 months of 30 days, there are 300 +3 = 303 months of 28 days, and there are 100 - 3 = 97 months of 29 days. Taking the weighted mean, the average number of days in a month is (2800 x 31 + 1600 x 30 + 303 x 28 + 97 x 29) / 4800 = 30.436875 days exactly.

We rounded the days from 30.436875 days to 30.43684 days.

So in 1 Month (30.43684 days) = 2629743 Seconds approximately

Finally we calculate

The Importance of On-Chain Rent CalculationCommentCalculating rent on-chain offers numerous advantages compared to off-chain methods. Let’s explore these benefits:

  1. 1.Transparency: On-chain calculations allow all transactions and computations to be publicly verified, building trust among investors.

  2. 2.Accuracy: Automated smart contracts eliminate human error in rent calculations, ensuring accurate distribution of rental income.

  3. 3.Security: Blockchain technology provides robust security, safeguarding the integrity of rent calculations against tampering or fraud.​

  4. 4.Efficiency: Smart contracts simplify the process, reducing administrative workload and enabling quicker, real-time rent distributions.​

  5. 5.Immutable Records: The blockchain’s unchangeable ledger guarantees that all calculations and transactions are permanently recorded, offering a dependable audit trail.

By leveraging on-chain calculations, 0xequity ensures a transparent, accurate, secure, efficient, and immutable method for distributing rental income to its token holders.

Last updated