Skip to content

Commit 2b5f8d6

Browse files
ZenGround0rvagg
authored andcommitted
fix: update lockup period from 10 to 30 days
1 parent 2561a78 commit 2b5f8d6

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

docs/src/content/docs/guides/rails-settlement.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Rails ensure reliable payments through a simple lockup mechanism:
1717

1818
When you create a data set (storage), the system calculates how much balance you need to maintain:
1919

20-
- **Formula**: `lockup = paymentRate × lockupPeriod` (e.g., 10 days worth of payments)
20+
- **Formula**: `lockup = paymentRate × lockupPeriod` (e.g., 30 days worth of payments)
2121
- **Example**: Storing 1 GiB costs ~0.0000565 USDFC/epoch, requiring ~1.63 USDFC minimum balance
2222
- **Purpose**: This protects the service provider by ensuring you always have enough for the next payment period
2323

packages/synapse-sdk/src/test/warm-storage-service.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,8 +1328,8 @@ describe('WarmStorageService', () => {
13281328
assert.exists(check.depositAmountNeeded)
13291329
assert.isTrue(check.depositAmountNeeded > 0n)
13301330

1331-
// depositAmountNeeded should equal 10 days of costs (default lockup)
1332-
const expectedDeposit = check.costs.perEpoch * BigInt(10) * BigInt(TIME_CONSTANTS.EPOCHS_PER_DAY)
1331+
// depositAmountNeeded should equal 30 days of costs (default lockup)
1332+
const expectedDeposit = check.costs.perEpoch * TIME_CONSTANTS.DEFAULT_LOCKUP_DAYS * TIME_CONSTANTS.EPOCHS_PER_DAY
13331333
assert.equal(check.depositAmountNeeded.toString(), expectedDeposit.toString())
13341334
})
13351335

@@ -1373,27 +1373,27 @@ describe('WarmStorageService', () => {
13731373
return `0x${'0'.repeat(64)}`
13741374
}
13751375

1376-
// Test with custom lockup period of 20 days
1377-
const customLockupDays = 20
1376+
// Test with custom lockup period of 60 days
1377+
const customLockupDays = TIME_CONSTANTS.DEFAULT_LOCKUP_DAYS * 2n
13781378
const check = await warmStorageService.checkAllowanceForStorage(
13791379
Number(SIZE_CONSTANTS.GiB), // 1 GiB
13801380
false,
13811381
mockPaymentsService,
1382-
customLockupDays
1382+
Number(customLockupDays)
13831383
)
13841384

13851385
// Verify depositAmountNeeded uses custom lockup period
1386-
const expectedDeposit = check.costs.perEpoch * BigInt(customLockupDays) * BigInt(TIME_CONSTANTS.EPOCHS_PER_DAY)
1386+
const expectedDeposit = check.costs.perEpoch * customLockupDays * TIME_CONSTANTS.EPOCHS_PER_DAY
13871387
assert.equal(check.depositAmountNeeded.toString(), expectedDeposit.toString())
13881388

1389-
// Compare with default (10 days) to ensure they're different
1389+
// Compare with default (30 days) to ensure they're different
13901390
const defaultCheck = await warmStorageService.checkAllowanceForStorage(
13911391
Number(SIZE_CONSTANTS.GiB), // 1 GiB
13921392
false,
13931393
mockPaymentsService
13941394
)
13951395

1396-
// Custom should be exactly 2x default (20 days vs 10 days)
1396+
// Custom should be exactly 2x default (60 days vs 30 days)
13971397
assert.equal(check.depositAmountNeeded.toString(), (defaultCheck.depositAmountNeeded * 2n).toString())
13981398
})
13991399
})

packages/synapse-sdk/src/utils/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export const TIME_CONSTANTS = {
115115
/**
116116
* Default lockup period in days
117117
*/
118-
DEFAULT_LOCKUP_DAYS: 10n,
118+
DEFAULT_LOCKUP_DAYS: 30n,
119119
} as const
120120

121121
/**

utils/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Comprehensive demonstration of the enhanced payment APIs in the Synapse SDK.
192192

193193
- **Balance**: USDFC deposited in the Payments contract for storage costs
194194
- **Rate Allowance**: Maximum per-epoch payment rate a service can set
195-
- **Lockup Allowance**: Security deposit (10 days of storage) locked during rail creation
195+
- **Lockup Allowance**: Security deposit (30 days of storage) locked during rail creation
196196

197197
## Development Notes
198198

0 commit comments

Comments
 (0)