Skip to main content
The 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

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 from SmartAccount.execute():
Blend deposit: mint BLEND_XLM equal to b-tokens received
Blend withdrawal: burn BLEND_XLM equal to b-tokens returned
Aquarius add liquidity: mint AQ_XLM_USDC equal to LP tokens received
Aquarius remove liquidity: burn AQ_XLM_USDC equal to LP tokens burned

Functions

initialize

One-time initialization per symbol. Sets the token info for a given tracking symbol.

mint

Increases 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

Decreases 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

Returns the tracking token balance for id and symbol. The primary read function used by RiskEngine during collateral valuation.

total_supply

Returns the total tracking tokens minted across all accounts for symbol.

admin

Returns the admin address (AccountManager).

set_admin

Changes the admin. Requires current admin auth.

Storage Layout


Reading TrackingToken Balances (TypeScript)