Skip to chapter
HyVaultageBack to Settings

From a price to token quantities

These equations value one finite band. Prices are positive and expressed as USDT per whole token. HyVaultage uses continuous price bounds.

Set the unit and the band

When the live feed quotes assets in USD, divide the token’s USD price by the current USDT/USD price. For instance, 0.90 USD per XRP and 0.999 USD per USDT give about 0.900901 USDT per XRP.

P = token USD price / USDT USD price

Let C be the opening or re-centering price, and w the width as a fraction. A ±2.5% band has w = 0.025. At C = 1.00 its lower and upper bounds are 0.975 and 1.025 USDT per token. A ±2% band at the same center runs from 0.98 to 1.02.

A = C × (1 − w) B = C × (1 + w)

Value a band at any price

Let L be the band’s liquidity parameter. The quantity calculation uses the square root of price capped at the band edges. The final valuation uses the actual market price P, including when P is outside the band.

s = √(min(B, max(A, P)))

token units = L × (1/s − 1/√B)

USDT units = L × (s − √A)

principal value = token units × P + USDT units

Find the liquidity for an allocation

Start with the reviewed principal after the allocation cost. Calculate the token and USDT quantities for L = 1 at the entry price. Divide the available principal by the value of those unit-liquidity quantities. This scales the band to exactly the funded principal.

L = net principal / (unit-liquidity tokens × entry price + unit-liquidity USDT)

For a position with multiple fixed bands, value each leg and add the results. For a full-range leg, use zero for √A and zero for 1/√B. Read the original Uniswap v3 equations.