thesalink

Stock token tech

ERC20 decimals, ui multiplier, and Chainlink math for Thesalink.

Raw amounts times Chainlink price, divided by 1e8. Nothing else.

Token shape

FieldValue
StandardERC20 · 18 decimals
Display scalarERC8056 uiMultiplier
Price feedChainlink · 8 decimals
Price basisPrice already includes the multiplier

Formulas

canonical math
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 read

Never 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

example
raw   = 420000000000000000   // 0.42 tokens
price = 22900000000          // 229.00 with 8 dec
value = 420000000000000000 * 22900000000 / 1e8
      = 96180000000000000000000000  // scaled usd

Redeem

  • 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.

On this page