Skip to content

Commit 1b4e906

Browse files
authored
fixes vault ledger entry fields (#423)
1 parent 4af2c94 commit 1b4e906

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

XLS-0065-single-asset-vault/README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ A vault has the following fields:
120120

121121
| Field Name | Modifiable? | Required? | JSON Type | Internal Type | Default Value | Description |
122122
| ------------------- | :---------: | :----------------: | :----------------: | :-----------: | :-----------: | :----------------------------------------------------------------------------------------------------------------------------------------------------- |
123-
| `LedgerEntryType` | `N/A` | :heavy_check_mark: | `string` | `UINT16` | `0x0081` | Ledger object type. |
123+
| `LedgerEntryType` | `N/A` | :heavy_check_mark: | `string` | `UINT16` | `0x0084` | Ledger object type. |
124124
| `LedgerIndex` | `N/A` | :heavy_check_mark: | `string` | `UINT16` | `N/A` | Ledger object identifier. |
125125
| `Flags` | `Yes` | :heavy_check_mark: | `string` | `UINT32` | 0 | Ledger object flags. |
126126
| `PreviousTxnID` | `N/A` | :heavy_check_mark: | `string` | `HASH256` | `N/A` | Identifies the transaction ID that most recently modified this object. |
@@ -131,11 +131,11 @@ A vault has the following fields:
131131
| `Account` | `N/A` | :heavy_check_mark: | `string` | `ACCOUNTID` | `N/A` | The address of the Vaults _pseudo-account_. |
132132
| `Data` | `Yes` | | `string` | `BLOB` | None | Arbitrary metadata about the Vault. Limited to 256 bytes. |
133133
| `Asset` | `No` | :heavy_check_mark: | `string or object` | `ISSUE` | `N/A` | The asset of the vault. The vault supports `XRP`, `IOU` and `MPT`. |
134-
| `AssetTotal` | `N/A` | :heavy_check_mark: | `number` | `NUMBER` | 0 | The total value of the vault. |
135-
| `AssetAvailable` | `N/A` | :heavy_check_mark: | `number` | `NUMBER` | 0 | The asset amount that is available in the vault. |
134+
| `AssetsTotal` | `N/A` | :heavy_check_mark: | `number` | `NUMBER` | 0 | The total value of the vault. |
135+
| `AssetsAvailable` | `N/A` | :heavy_check_mark: | `number` | `NUMBER` | 0 | The asset amount that is available in the vault. |
136136
| `LossUnrealized` | `N/A` | :heavy_check_mark: | `number` | `NUMBER` | 0 | The potential loss amount that is not yet realized expressed as the vaults asset. |
137137
| `AssetsMaximum` | `Yes` | | `number` | `NUMBER` | 0 | The maximum asset amount that can be held in the vault. Zero value `0` indicates there is no cap. |
138-
| `MPTokenIssuanceID` | `N/A` | :heavy_check_mark: | `number` | `UINT192` | 0 | The identifier of the share MPTokenIssuance object. |
138+
| `ShareMPTID` | `N/A` | :heavy_check_mark: | `number` | `UINT192` | 0 | The identifier of the share MPTokenIssuance object. |
139139
| `WithdrawalPolicy` | `No` | :heavy_check_mark: | `string` | `UINT8` | `N/A` | Indicates the withdrawal strategy used by the Vault. |
140140
| `Scale` | `No` | :heavy_check_mark: | `number` | `UINT8` | 6 | The `Scale` specifies the power of 10 ($10^{\text{scale}}$) to multiply an asset's value by when converting it into an integer-based number of shares. |
141141

@@ -235,7 +235,7 @@ The "paper loss" temporarily decreases the vault value. A malicious depositor ma
235235
Consider a vault with a total value of $1.0m and total shares of $1.0m. Assume the "paper loss" for the vault is $900k. The new exchange rate is as follows:
236236

237237
$$
238-
exchangeRate = \frac{AssetTotal - LossUnrealized}{SharesTotal}
238+
exchangeRate = \frac{AssetsTotal - LossUnrealized}{SharesTotal}
239239
$$
240240

241241
$$
@@ -245,7 +245,7 @@ $$
245245
After the "paper loss" is cleared, the new effective exchange rate would be as follows:
246246

247247
$$
248-
exchangeRate = \frac{AssetTotal}{SharesTotal}
248+
exchangeRate = \frac{AssetsTotal}{SharesTotal}
249249
$$
250250

251251
$$
@@ -421,7 +421,7 @@ The transaction creates an `AccountRoot` object for the `_pseudo-account_`. Ther
421421
- Create a new `Vault` ledger object.
422422
- Create a new `MPTokenIssuance` ledger object for the vault shares.
423423
- If the `DomainID` is provided:
424-
- `MPTokenIssuance(Vault.MPTokenIssuanceID).DomainID = DomainID` (Set the Permissioned Domain ID).
424+
- `MPTokenIssuance(Vault.ShareMPTID).DomainID = DomainID` (Set the Permissioned Domain ID).
425425
- Create an `MPToken` object for the Vault Owner to hold Vault Shares.
426426
- Create a new `AccountRoot`[_pseudo-account_](https://github.com/XRPLF/XRPL-Standards/discussions/191) object setting the `PseudoOwner` to `VaultID`.
427427

@@ -465,7 +465,7 @@ The `VaultSet` updates an existing `Vault` ledger object.
465465

466466
- Update mutable fields in the `Vault` ledger object.
467467
- If `DomainID` is provided:
468-
- Set `MPTokenIssuance(Vault.MPTokenIssuanceID).DomainID = DomainID` (Set the Permissioned Domain).
468+
- Set `MPTokenIssuance(Vault.ShareMPTID).DomainID = DomainID` (Set the Permissioned Domain).
469469

470470
##### 3.1.2.3 Invariants
471471

@@ -486,7 +486,7 @@ The `VaultDelete` transaction deletes an existing vault object.
486486

487487
- `Vault` object with the `VaultID` does not exist on the ledger.
488488
- The submitting account is not the `Owner` of the vault.
489-
- `AssetsTotal`, `AssetsAvailable`, or `MPTokenIssuance(Vault.MPTokenIssuanceID).OutstandingAmount` are greater than zero.
489+
- `AssetsTotal`, `AssetsAvailable`, or `MPTokenIssuance(Vault.ShareMPTID).OutstandingAmount` are greater than zero.
490490
- The `OwnerDirectory` of the Vault _pseudo-account_ contains pointers to objects other than the `Vault`, the `MPTokenIssuance` for its shares, or an `MPToken` or trust line for its asset.
491491

492492
##### 3.1.3.2 State Changes
@@ -605,7 +605,7 @@ In sections below assume the following variables:
605605

606606
- There is insufficient liquidity in the vault to fill the request:
607607
- If `Amount` is the vaults share:
608-
- `MPTokenIssuance(Vault.MPTokenIssuanceID).OutstandingAmount` < `Amount` (attempt to withdraw more shares than there are in total).
608+
- `MPTokenIssuance(Vault.ShareMPTID).OutstandingAmount` < `Amount` (attempt to withdraw more shares than there are in total).
609609
- The shares `MPToken.MPTAmount` of the `Account` is less than `Amount` (attempt to withdraw more shares than owned).
610610
- `Vault.AssetsAvailable` < $\Delta_{asset}$ (the vault has insufficient assets).
611611

@@ -633,11 +633,11 @@ In sections below assume the following variables:
633633
- Decrease the `MPToken.MPTAmount` by $\Delta_{asset}$ of the _pseudo-account_ `MPToken` object for the `Vault.Asset`.
634634
- Increase the `MPToken.MPTAmount` by $\Delta_{asset}$ of the depositor `MPToken` object for the `Vault.Asset`.
635635

636-
- Update the `MPToken` object for the `Vault.MPTokenIssuanceID` of the depositor `AccountRoot`:
636+
- Update the `MPToken` object for the `Vault.ShareMPTID` of the depositor `AccountRoot`:
637637
- Decrease the `MPToken.MPTAmount` by $\Delta_{share}$.
638638
- If `MPToken.MPTAmount == 0`, delete the object.
639639

640-
- Update the `MPTokenIssuance` object for the `Vault.MPTokenIssuanceID`:
640+
- Update the `MPTokenIssuance` object for the `Vault.ShareMPTID`:
641641
- Decrease the `OutstandingAmount` field of the share `MPTokenIssuance` object by $\Delta_{share}$.
642642

643643
- Decrease the `AssetsTotal` and `AssetsAvailable` by $\Delta_{asset}$
@@ -677,7 +677,7 @@ The `VaultClawback` transaction performs a Clawback from the Vault, exchanging t
677677
- `MPTokenIssuance.lsfMPTCanClawback` flag is not set (the asset does not support clawback).
678678
- If the `MPTokenIssuance.lsfMPTCanLock` flag is NOT set (the asset cannot be locked).
679679

680-
- The `MPToken` object for the `Vault.MPTokenIssuanceID` of the `Holder` `AccountRoot` does not exist OR `MPToken.MPTAmount == 0`.
680+
- The `MPToken` object for the `Vault.ShareMPTID` of the `Holder` `AccountRoot` does not exist OR `MPToken.MPTAmount == 0`.
681681

682682
##### 3.3.1.2 State Changes
683683

@@ -687,11 +687,11 @@ The `VaultClawback` transaction performs a Clawback from the Vault, exchanging t
687687
- If the `Vault.Asset` is an `MPT`:
688688
- Decrease the `MPToken.MPTAmount` by `min(Vault.AssetsAvailable`, $\Delta_{asset}$`)` of the _pseudo-account_ `MPToken` object for the `Vault.Asset`.
689689

690-
- Update the `MPToken` object for the `Vault.MPTokenIssuanceID` of the depositor `AccountRoot`:
690+
- Update the `MPToken` object for the `Vault.ShareMPTID` of the depositor `AccountRoot`:
691691
- Decrease the `MPToken.MPTAmount` by $\Delta_{share}$.
692692
- If `MPToken.MPTAmount == 0`, delete the object.
693693

694-
- Update the `MPTokenIssuance` object for the `Vault.MPTokenIssuanceID`:
694+
- Update the `MPTokenIssuance` object for the `Vault.ShareMPTID`:
695695
- Decrease the `OutstandingAmount` field of the share `MPTokenIssuance` object by $\Delta_{share}$.
696696

697697
- Decrease the `AssetsTotal` and `AssetsAvailable` by `min(Vault.AssetsAvailable`, $\Delta_{asset}$`)`
@@ -851,8 +851,8 @@ Vault holding an `MPT`:
851851
"issuer": "rIssuer1234567890abcdef1234567890abcdef",
852852
"value": "1000"
853853
},
854-
"AssetTotal": 1000000,
855-
"AssetAvailable": 800000,
854+
"AssetsTotal": 1000000,
855+
"AssetsAvailable": 800000,
856856
"LossUnrealized": 200000,
857857
"AssetsMaximum": 0,
858858
"Share": {

0 commit comments

Comments
 (0)