Overview
Starkzap supports Troves strategies throughwallet.troves().
Troves combines off-chain strategy discovery with on-chain execution:
- 📊 Discover strategies - Fetch the currently available Troves strategies and protocol-level stats
- 🧾 Inspect positions - Read the wallet’s share balance and the current underlying asset amounts for a strategy
- 💸 Deposit - Build and execute the Troves deposit flow from typed
Amountinputs - 📤 Withdraw - Build and execute the Troves withdraw flow with the same typed API
- 📦 Batch with other actions - Compose Troves deposits or withdrawals inside
wallet.tx()
Troves uses the Troves HTTP API to discover strategies and build the required calls, then executes those calls through the connected Starknet wallet.
Configuration
Troves is available from the wallet:wallet.troves() throws unless you explicitly override the API base:
apiBase only when you intentionally want to point the SDK at a custom Troves-compatible backend.
Discovering strategies
Fetch the current strategy catalog:Strategy shape
Protocol-level stats
Querying a position
Read the wallet’s position in a strategy by id:getPosition() returns null when the wallet holds no shares, or when the strategy does not expose a readable vault contract for this flow.
Position shape
amounts contains one Amount. For dual-asset strategies, it contains two entries in the same order as the strategy’s depositTokens.
Depositing
Deposit into a Troves strategy with typedAmount inputs:
amount2:
Withdrawing
Withdraw from a Troves strategy using the same typed shape:Using the transaction builder
Troves can be composed into a larger atomic transaction through the tx builder:Low-level call preparation
If you need to inspect or batch Troves calls manually, use the populate helpers:Call[] values without executing them.
Best Practices
- Use
getStrategies()to drive the strategy picker instead of hard-coding ids. - Treat Troves as mainnet-only unless you are explicitly using a custom compatible backend.
- Use typed
Amountvalues from the strategy’s deposit tokens to avoid decimals mismatches. - Prefer
wallet.tx().trovesDeposit(...)andwallet.tx().trovesWithdraw(...)when Troves actions should be atomic with other wallet operations. - Expect some strategies to return
apyas a string label rather than a numeric yield; useapySplitwhen you need structured numeric values.
Next Steps
- Tx Builder — Batch Troves actions with transfers, staking, swaps, and more
- Transactions — Direct execution, fee modes, and preflight
- Bitcoin, Stablecoins, and Tokens — Token presets and typed
Amounthandling - API Reference — Full method and type signatures