Skip to content

Updated Transactions

The LendingProtocolV1_1 amendment updates the following transactions to support closed-ended vaults.

VaultCreate

New Fields

Field NameJSON TypeInternal TypeRequired?Description
VaultKindNumberUInt8NoThe 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.
SubscriptionDateNumberUInt32No(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.
RedemptionDateNumberUInt32No(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 - SubscriptionDate must be at least 180 seconds and less than 946708560 seconds (30 years).
  • Both dates must be in the future relative to the parent ledger's close time.

New Error Cases

Error CodeDescription
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.
  • tecEXPIREDSubscriptionDate or RedemptionDate isn't ahead of the parent ledger's close time.
    temDISABLEDVaultKind, SubscriptionDate, or RedemptionDate is present and the LendingProtocolV1_1 amendment isn't enabled.

    VaultDelete

    New Fields

    Field NameJSON TypeInternal TypeRequired?Description
    MemoDataStringBlobNoA data field to record why the vault was deleted, as hexadecimal. Limited to 256 bytes.

    New Error Cases

    Error CodeDescription
    temMALFORMED
  • MemoData is present but empty.
  • MemoData is larger than 256 bytes.
  • temDISABLEDMemoData is present and the LendingProtocolV1_1 amendment isn't enabled.

    VaultDeposit

    New Error Cases

    Error CodeDescription
    tecEXPIREDThe vault is closed-ended and in its Investment or Redemption phase.

    VaultWithdraw

    New Error Cases

    Error CodeDescription
    tecTOO_SOONThe vault is closed-ended and in its Investment phase.

    LoanSet

    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.

    New Error Cases

    Error CodeDescription
    tecTOO_SOONThe vault is closed-ended and still in its Subscription phase.
    tecEXPIREDThe vault is closed-ended and has entered its Redemption phase.
    tecNO_PERMISSIONThe vault is closed-ended and the loan's final scheduled payment is less than 60 seconds before the vault's RedemptionDate.

    LoanBrokerSet

    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.

    New Error Cases

    Error CodeDescription
    tecNO_PERMISSIONThe target vault isn't closed-ended.