Skip to content

Commit fb5520d

Browse files
committed
furhter rounding cleanup
1 parent 16f2467 commit fb5520d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Shares represent the portion of the Vault assets a depositor owns. Vault Owners
138138

139139
The **`Scale`** field enables the vault to accurately represent fractional asset values using integer-only MPT shares, which prevents the loss of value from decimal truncation. It defines a scaling factor, calculated as $10^{\text{Scale}}$, that converts a decimal asset amount into a corresponding whole number of shares. For example, with a `Scale` of `6`, a deposit of **20.3** assets is multiplied by $10^6$ and credited as **20,300,000** shares.
140140

141-
As a general rule, all calculations involving MPTs are executed with a precision of a single MPT, treating them as indivisible units. If a calculation results in a fractional amount, it will be rounded up, down or to the nearest whole number depending on the context. Crucially, the rounding direction is determined by the protocol and is not controlled by the transaction submitter, which may lead to unexpected results.
141+
As a general rule, all calculations involving MPTs are executed with a precision of a single MPT, treating them as indivisible units. If a calculation results in a fractional amount, it will be rounded up, down or to the nearest whole number depending on the context. For example, Vault shares are always rounded down. Crucially, the rounding direction is determined by the protocol and is not controlled by the transaction submitter, which may lead to unexpected results.
142142

143143
###### 3.1.6.1.1 `IOU`
144144

@@ -246,7 +246,7 @@ The calculation depends on whether the vault is empty.
246246
- **Initial Deposit**: For the first deposit into an empty vault, shares are calculated using a scaling factor, $\sigma = 10^{\text{Scale}}$, to properly represent fractional assets as whole numbers.
247247
$$\Delta_{shares} = \Delta_{assets} \times \sigma$$
248248

249-
- **Subsequent Deposits**: For all other deposits, shares are calculated proportionally using the deposit NAV. The resulting $\Delta_{shares}$ value is **rounded down** to the nearest integer.
249+
- **Subsequent Deposits**: For all other deposits, shares are calculated proportionally using the deposit NAV. The resulting $\Delta_{shares}$ value is **rounded down**.
250250
$$\Delta_{shares} = \frac{\Delta_{assets} \times \Gamma_{shares}}{\Gamma_{assets} - \Omega}$$
251251

252252
Because the share amount is rounded down, the actual assets taken from the depositor ($\Delta_{assets'}$) are recalculated.
@@ -285,7 +285,7 @@ First, the requested asset amount is converted into the equivalent number of sha
285285

286286
$$\Delta_{shares} = \frac{\Delta_{assets\\_requested} \times \Gamma_{shares}}{(\Gamma_{assets} - \Omega - \iota)}$$
287287

288-
This calculated $\Delta_{shares}$ amount is **rounded down (floor)** to the nearest whole number.
288+
This calculated $\Delta_{shares}$ amount is **rounded down (floor)**.
289289

290290
Next, the floored number of shares from Step 1 is used to calculate the final asset payout using the same logic as a redemption.
291291

0 commit comments

Comments
 (0)