Stock token tech
ERC20 decimals, ui multiplier, and Chainlink math for Thesalink.
Raw amounts times Chainlink price, divided by 1e8. Nothing else.
Token shape
| Field | Value |
|---|---|
| Standard | ERC20 · 18 decimals |
| Display scalar | ERC8056 uiMultiplier |
| Price feed | Chainlink · 8 decimals |
| Price basis | Price already includes the multiplier |
Formulas
raw = balanceOf(token, holder) // uint, 18 dec
price = chainlinkPrice(token) // uint, 8 dec, includes multiplier
valueUsd = raw * price / 1e8
ui = raw * uiMultiplier(token) / 1e18 // display only, NEVER priced
redeem = floor(storedRaw * shares / supply) // no oracle readNever do this
Never compute ui × price. The display amount already multiplies in the multiplier while the price still includes it, so that product double-counts the scalar.
Worked example
raw = 420000000000000000 // 0.42 tokens
price = 22900000000 // 229.00 with 8 dec
value = 420000000000000000 * 22900000000 / 1e8
= 96180000000000000000000000 // scaled usdRedeem
- No oracle read at redeem time.
- Round down in favor of the basket.
- Only approved participants can mint/burn Stock Tokens at primary; Thesalink basket shares mint/redeem via the vault.
Execution
RFQ desks (0x, 1inch, LiFi routing) are primary. AMM pools for stock tokens are thin and used only when a quote shows they clear better.
