Skip to main content

Overview

Starkzap supports Troves strategies through wallet.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 Amount inputs
  • 📤 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:
By default, Troves is mainnet-only. If the wallet is not on Starknet Mainnet, wallet.troves() throws unless you explicitly override the API base:
Use apiBase only when you intentionally want to point the SDK at a custom Troves-compatible backend.

Discovering strategies

Fetch the current strategy catalog:
You can force a fresh fetch instead of using the default cached endpoint:

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

For single-asset strategies, 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 typed Amount inputs:
Dual-asset strategies can provide amount2:
With execution options:

Withdrawing

Withdraw from a Troves strategy using the same typed shape:
For dual-asset strategies:

Using the transaction builder

Troves can be composed into a larger atomic transaction through the tx builder:
Withdraw through the builder:

Low-level call preparation

If you need to inspect or batch Troves calls manually, use the populate helpers:
These return Starknet Call[] values without executing them.

Best Practices

  1. Use getStrategies() to drive the strategy picker instead of hard-coding ids.
  2. Treat Troves as mainnet-only unless you are explicitly using a custom compatible backend.
  3. Use typed Amount values from the strategy’s deposit tokens to avoid decimals mismatches.
  4. Prefer wallet.tx().trovesDeposit(...) and wallet.tx().trovesWithdraw(...) when Troves actions should be atomic with other wallet operations.
  5. Expect some strategies to return apy as a string label rather than a numeric yield; use apySplit when you need structured numeric values.

Next Steps