Skip to content

Commit

Permalink
fix(time): fixes SECS_PER_YEAR to gregorian constant (#215)
Browse files Browse the repository at this point in the history
* fix(time): fixes SECS_PER_YEAR to gregorian constant

Signed-off-by: sam <sam@freighttrust.com>

* fix(secs_per_year): use gregorian avg
  • Loading branch information
sam bacha authored Feb 20, 2021
1 parent 8f32114 commit dff2c5c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contracts/Vault.vy
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ managementFee: public(uint256)
# Governance Fee for performance of Vault (given to `rewards`)
performanceFee: public(uint256)
MAX_BPS: constant(uint256) = 10_000 # 100%, or 10k basis points
SECS_PER_YEAR: constant(uint256) = 31_557_600 # 365.25 days
# NOTE: A four-century period will be missing 3 of its 100 Julian leap years, leaving 97.
# So the average year has 365 + 97/400 = 365.2425 days
# ERROR(Julian): -0.0078
# ERROR(Gregorian): -0.0003
SECS_PER_YEAR: constant(uint256) = 31_556_952 # 365.2425 days
# `nonces` track `permit` approvals with signature.
nonces: public(HashMap[address, uint256])
DOMAIN_SEPARATOR: public(bytes32)
Expand Down

0 comments on commit dff2c5c

Please sign in to comment.