The LendingProtocolV1_1 amendment updates the following transactions to support closed-ended vaults.
| Field Name | JSON Type | Internal Type | Required? | Description |
|---|---|---|---|---|
VaultKind | Number | UInt8 | No | The kind of vault to create. If omitted, defaults to 0 and creates an open-ended vault; 1 creates a closed-ended vault. Immutable after the vault is created. |
SubscriptionDate | Number | UInt32 | No | (Closed-ended vaults only) The time, in seconds since the Ripple Epoch, when the vault's subscription window closes and its investment period begins. Required when VaultKind is 1 and immutable after the vault is created. |
RedemptionDate | Number | UInt32 | No | (Closed-ended vaults only) The time, in seconds since the Ripple Epoch, when the vault's investment period ends and depositors can redeem their shares. Required when VaultKind is 1 and immutable after the vault is created. |
Note
RedemptionDate-SubscriptionDatemust be at least180seconds and less than946708560seconds (30 years).- Both dates must be in the future relative to the parent ledger's close time.
| Error Code | Description |
|---|---|
temMALFORMED | VaultKind is present with a value other than 0 or 1.VaultKind is 0, but SubscriptionDate or RedemptionDate is present.VaultKind is 1, but is missing SubscriptionDate and RedemptionDate.RedemptionDate - SubscriptionDate is less than 180 seconds or is greater than or equal to 946708560 seconds. |
tecEXPIRED | SubscriptionDate or RedemptionDate isn't ahead of the parent ledger's close time. |
temDISABLED | VaultKind, SubscriptionDate, or RedemptionDate is present and the LendingProtocolV1_1 amendment isn't enabled. |
| Field Name | JSON Type | Internal Type | Required? | Description |
|---|---|---|---|---|
MemoData | String | Blob | No | A data field to record why the vault was deleted, as hexadecimal. Limited to 256 bytes. |
| Error Code | Description |
|---|---|
temMALFORMED | MemoData is present but empty.MemoData is larger than 256 bytes. |
temDISABLED | MemoData is present and the LendingProtocolV1_1 amendment isn't enabled. |
| Error Code | Description |
|---|---|
tecEXPIRED | The vault is closed-ended and in its Investment or Redemption phase. |
| Error Code | Description |
|---|---|
tecTOO_SOON | The vault is closed-ended and in its Investment phase. |
A loan can only be originated against a closed-ended vault during its Investment phase, and only if the loan's final scheduled payment is at least 60 seconds before the vault enters its Redemption phase. This means the maximum term of new loans shrinks as the vault approaches its RedemptionDate.
| Error Code | Description |
|---|---|
tecTOO_SOON | The vault is closed-ended and still in its Subscription phase. |
tecEXPIRED | The vault is closed-ended and has entered its Redemption phase. |
tecNO_PERMISSION | The vault is closed-ended and the loan's final scheduled payment is less than 60 seconds before the vault's RedemptionDate. |
Note
A loan broker can only be attached to a closed-ended vault. This restriction only applies to loan brokers created after LendingProtocolV1_1 is enabled. If a loan broker was created before the amendment, it can still originate loans from open-ended vaults.
| Error Code | Description |
|---|---|
tecNO_PERMISSION | The target vault isn't closed-ended. |