XRP Ledger Standards
XLS-65.4.4 Draft Amendment

Closed-Ended Vault

Adds fixed subscription, investment, and redemption phases to Single Asset Vaults

Authors
Jingchen Wu, Vito Tumas, Gregory Tsipenyuk
Created
2026-07-21
Updated
2026-11-25
Discussion
XRPLF/XRPL-Standards/discussions/590
Amendment
LendingProtocolV1_1
Patch of
XLS-0065: Single Asset Tokenized Vault

65.4.4 Closed-Ended Vault

1. Abstract

Under LendingProtocolV1_1, a Vault may be closed-ended and move through deterministic Subscription, Investment, and Redemption phases. Three immutable fields define this lifecycle. Deposits stop after Subscription, withdrawals pause during Investment, and Redemption opens on its configured date. Open-ended Vaults are unaffected.

2. Motivation

A fixed-term fund needs a known fundraising window and a stable pool of capital during investment. Immutable phase boundaries let depositors see when capital becomes locked and when redemption opens, while letting the operator deploy a settled amount for a fixed term.

3. Specification

This patch changes the parent XLS-65 sections named below. All other parent behavior is unchanged.

3.1 Ledger Entry: Vault

3.1.1 Fields

Add these fields to parent §3.1.2:

Field Name Constant Required JSON Type Internal Type Default Value Description
VaultKind Yes No number UINT8 0 The Vault kind. Absent or 0 means open-ended. Immutable after creation.
SubscriptionDate Yes Conditional number UINT32 N/A End of Subscription and start of Investment. Required when VaultKind == ClosedEnded.
RedemptionDate Yes Conditional number UINT32 N/A Start of Redemption. Required when VaultKind == ClosedEnded.

VaultKind is not stored when it has the default value. SubscriptionDate and RedemptionDate are stored only on closed-ended Vaults.

3.1.1.1 VaultKind Values

VaultKind accepts:

Name Value Description
OpenEnded 0 Default. The Vault has NoPhase; absence has the same meaning.
ClosedEnded 1 The Vault has Subscription, Investment, and Redemption phases.

3.1.2 Phase Derivation

The phase is derived and is not stored. Let now be the parent ledger close time:

Condition Phase
VaultKind == OpenEnded NoPhase
now <= SubscriptionDate Subscription
SubscriptionDate < now < RedemptionDate Investment
now >= RedemptionDate Redemption

An absent VaultKind means OpenEnded. VaultCreate rejects unknown values. When other logic reads a future, unknown kind, it treats that value as OpenEnded and therefore as NoPhase.

3.1.3 Invariants

Extend parent §3.1.10 invariant 14 under LendingProtocolV1_1 with VaultKind, SubscriptionDate, and RedemptionDate. Each field is immutable: if present, it remains equal to its prior value; if absent, it remains absent except when the transaction creates the entry.

A closed-ended Vault always has both dates and satisfies:

MIN_INVESTMENT_PERIOD <= RedemptionDate - SubscriptionDate < MAX_INVESTMENT_PERIOD

This also implies SubscriptionDate < RedemptionDate.

3.1.4 Example JSON

{
  "LedgerEntryType": "Vault",
  "Account": "rwCNM7SeUHTajEBQDiNqxDG8p1Mreizw85",
  "Asset": {
    "currency": "USD",
    "issuer": "rXJSJiZMxaLuH3kQBUV5DLipnYtrE6iVb"
  },
  "AssetsAvailable": "0",
  "AssetsMaximum": "1000000",
  "AssetsTotal": "0",
  "LossUnrealized": "0",
  "Owner": "rNGHoQwNG753zyfDrib4qDvvswbrtmV8Es",
  "Scale": 6,
  "ShareMPTID": "0000000169F415C9F1AB6796AB9224CE635818AFD74F8175",
  "VaultKind": 1,
  "SubscriptionDate": 711232800,
  "RedemptionDate": 721600800
}

3.2 Protocol Constants

Constant Value Meaning
MIN_INVESTMENT_PERIOD 180 Minimum length, in seconds, of the Investment phase.
MAX_INVESTMENT_PERIOD 946708560 Exclusive maximum Investment length: 30 Gregorian years of 365.2425 days, in seconds.

3.3 Transaction: VaultCreate

3.3.1 Fields

Add VaultKind, SubscriptionDate, and RedemptionDate from §3.1.1 to parent §3.2.1 with the same types, defaults, and conditional requirements.

3.3.2 Failure Conditions

Add these data-verification checks to parent §3.2.5.1:

  1. LendingProtocolV1_1 is not enabled and any of VaultKind, SubscriptionDate, or RedemptionDate is present. (temDISABLED)
  2. VaultKind has an unrecognized value. (temMALFORMED)
  3. VaultKind is absent or OpenEnded, but either date is present. (temMALFORMED)
  4. VaultKind is ClosedEnded, but either date is absent. (temMALFORMED)
  5. VaultKind is ClosedEnded, and SubscriptionDate + MIN_INVESTMENT_PERIOD > RedemptionDate or RedemptionDate >= SubscriptionDate + MAX_INVESTMENT_PERIOD. (temMALFORMED)

The sums in check 5 MUST use arithmetic wide enough to avoid 32-bit overflow.

Append these protocol-level failures to parent §3.2.5.2:

  1. VaultKind is ClosedEnded and SubscriptionDate is not strictly after the parent ledger close time. (tecEXPIRED)
  2. VaultKind is ClosedEnded and RedemptionDate is not strictly after the parent ledger close time. (tecEXPIRED)

3.3.3 State Changes

Extend parent §3.2.6 step 1:

  • For an absent or OpenEnded VaultKind, do not store any of the three fields.
  • For a ClosedEnded VaultKind, store VaultKind, SubscriptionDate, and RedemptionDate on the new Vault.

3.4 Transaction: VaultDeposit

3.4.1 Failure Conditions

Append to parent §3.5.2.2:

    • SingleAssetVault: The check does not apply.
    • LendingProtocolV1_1: The Vault is closed-ended and now > SubscriptionDate, where now is the parent ledger close time. (tecEXPIRED)

No VaultDeposit succeeds unless the phase is Subscription or NoPhase.

3.5 Transaction: VaultWithdraw

3.5.1 Failure Conditions

Append to parent §3.6.2.2:

    • SingleAssetVault: The check does not apply.
    • LendingProtocolV1_1: The Vault is closed-ended and SubscriptionDate < now < RedemptionDate, where now is the parent ledger close time. (tecTOO_SOON)

No VaultWithdraw succeeds during Investment.

VaultClawback is not phase-gated and remains allowed in every phase.

3.6 RPC: vault_info

3.6.1 Response Fields

Add these fields to parent §3.9.2. They are present only for closed-ended Vaults; callers MUST interpret their collective absence as VaultKind == OpenEnded.

Field Name Required? JSON Type Description
vault.VaultKind No number The Vault kind; 1 means ClosedEnded.
vault.SubscriptionDate No number End of Subscription and start of Investment.
vault.RedemptionDate No number Start of Redemption.

4. Rationale

Two immutable dates make the lifecycle deterministic and monotonic without storing or maintaining a phase. Subscription includes its boundary, Investment is strictly between the dates, and Redemption includes its boundary. Open-ended Vaults map to NoPhase, preserving their existing behavior.

The 180-second minimum leaves room for a loan beginning after Subscription, the existing 60-second minimum payment interval, and the lending patch's 60-second redemption buffer. The maximum bounds protocol timestamps to a 30-year investment period.

5. Test Plan

The reference implementation tests VaultCreate with each VaultKind value, including the unrecognized-value and mismatched-date failure conditions in §3.3.2 checks 1-5 and the tecEXPIRED checks 8-9. It covers the MIN_INVESTMENT_PERIOD and MAX_INVESTMENT_PERIOD boundaries in check 5 at, above, and below each limit, using wide arithmetic to confirm no 32-bit overflow at the boundary. It tests VaultDeposit and VaultWithdraw at the Subscription/Investment and Investment/Redemption phase boundaries, including the inclusive and exclusive edges from the phase table in §3.1.2, and confirms VaultClawback succeeds in every phase. It also runs an end-to-end lifecycle: create a closed-ended Vault, deposit during Subscription, cross into Investment, cross into Redemption, and withdraw — with the amendment both enabled and disabled.

6. Security Considerations

Investment intentionally locks depositor capital. The immutable public dates expose the lock-up before deposit and prevent an owner from changing its duration afterward. The period bounds ensure valid arithmetic but do not make a chosen term suitable; depositors must inspect both dates.

Phase transitions use consensus-derived ledger close time. VaultClawback remains available during Investment so issuer compliance controls are not blocked by the depositor withdrawal gate.