locking-snapshots-examples
Examples demonstrating rules for locking snapshots
A snapshot is locked if...
- A previous snapshot's cumulativeInterestOwed is less than totalInterestPaid
- A previous snapshot's cumulativePrincipalOwed is less than totalPrincipalPaid
Another way of thinking about is a snapshot is locked if... Paid amounts have exceeded the preceding snapshot's requirements (meaning this snapshot has been allocated toward)
Example 1 - All snapshots locked
totalInterestPaid = 30 totalPrincipalPaid = 40
Snapshot | cumulativeInterestOwed | cumulativePrincipalOwed | totalInterestPaid | totalPrincipalPaid | Locked |
---|---|---|---|---|---|
1 | 0 | 0 | < 30 🔒⬇️ | < 40 🔒⬇️ | YES 🔒 |
2 | 10 | 20 | < 30 🔒⬇️ | < 40 🔒⬇️ | YES 🔒 |
3 | 40 | 30 | > 30 🔒 | < 40 🔒⬇️ | YES 🔒 |
Example 2 - Last snapshot is locked due to previous snapshot interestOwed < totalInterestPaid
totalInterestPaid = 30 totalPrincipalPaid = 20
Snapshot | cumulativeInterestOwed | cumulativePrincipalOwed | totalInterestPaid | totalPrincipalPaid | Locked |
---|---|---|---|---|---|
1 | 0 | 0 | < 30 🔒⬇️ | < 20 🔒⬇️ | YES 🔒 |
2 | 10 | 30 | < 30 🔒⬇️ | > 20 🔒 | YES 🔒 |
3 | 40 | 50 | > 30 🔒 | > 20 🕊️ | YES 🔒 |
Example 3 - Last snapshot is locked due to previous snapshot principalOwed < totalPrincipalPaid
totalInterestPaid = 20 totalPrincipalPaid = 40
Snapshot | cumulativeInterestOwed | cumulativePrincipalOwed | totalInterestPaid | totalPrincipalPaid | Locked |
---|---|---|---|---|---|
1 | 0 | 0 | < 20 🔒⬇️ | < 40 🔒⬇️ | YES 🔒 |
2 | 30 | 30 | > 20 🔒 | < 40 🔒⬇️ | YES 🔒 |
3 | 40 | 50 | > 20 🕊️ | > 40 🔒 | YES 🔒 |
Example 4 - Last snapshot is not locked
totalInterestPaid = 30 totalPrincipalPaid = 40
Snapshot | cumulativeInterestOwed | cumulativePrincipalOwed | totalInterestPaid | totalPrincipalPaid | Locked |
---|---|---|---|---|---|
1 | 0 | 0 | < 30 🔒⬇️ | < 40 🔒⬇️ | YES 🔒 |
2 | 40 | 50 | > 30 🔒 | > 40 🔒 | YES 🔒 |
3 | 50 | 60 | > 30 🕊️ | > 40 🕊️ | NO 🕊️ |