TrackingToken contract is a single on-chain token registry that tracks synthetic position balances for each SmartAccount. Instead of querying external protocols (Blend, Aquarius, Soroswap) directly during health checks, the RiskEngine reads TrackingToken balances to determine a margin account’s external positions.
Testnet address: CA24GDWO63ZXNMW5FLWF2KMZ5DCF3DO7J3RYABFICDIDHH4A342RD2TR
Tracked Symbols
| Symbol | Represents | Value in risk model |
|---|---|---|
BLEND_XLM | XLM b-tokens held in Blend pool | Valued via b_rate × oracle price |
BLEND_USDC | USDC b-tokens held in Blend pool | Valued via b_rate × oracle price |
AQ_XLM_USDC | Aquarius XLM/USDC LP tokens | $0 (no oracle feed) |
SS_XLM_USDC | Soroswap XLM/USDC LP tokens | $0 (no oracle feed) |
LP tokens (AQ_XLM_USDC, SS_XLM_USDC) are tracked to prevent double-counting but are valued at $0 in health factor calculations. Only Blend b-tokens receive non-zero collateral valuation.
Mint / Burn Flow
TrackingTokens are minted and burned by the AccountManager based on the return value fromSmartAccount.execute():
BLEND_XLM equal to b-tokens receivedBlend withdrawal: burn
BLEND_XLM equal to b-tokens returnedAquarius add liquidity: mint
AQ_XLM_USDC equal to LP tokens receivedAquarius remove liquidity: burn
AQ_XLM_USDC equal to LP tokens burned
Functions
initialize
mint
to’s balance for symbol by amount. Only callable by admin (AccountManager).
Called when: A SmartAccount deposits into Blend or adds liquidity to Aquarius/Soroswap.
burn
from’s balance for symbol by amount. Only callable by admin (AccountManager).
Called when: A SmartAccount withdraws from Blend or removes liquidity from Aquarius/Soroswap.
balance
id and symbol. The primary read function used by RiskEngine during collateral valuation.
total_supply
symbol.
admin
set_admin
Storage Layout
| Key | Type | Description |
|---|---|---|
TokenInfo(Symbol) | {decimals, name, symbol} | Metadata per symbol |
Admin | Address | Admin (AccountManager) |
TotalSupply(Symbol) | i128 | Total minted per symbol |
Balance(Address, Symbol) | i128 | Per-account, per-symbol balance |
Reading TrackingToken Balances (TypeScript)
Related
- SmartAccount — triggers mint/burn via
execute()return value - AccountManager — calls
mint/burnbased ontoken_delta - Risk Engine — reads balances for collateral valuation
- Math Reference — how Blend positions are priced

