Skip to main content
Earn vaults are curated strategy vaults run through external vault providers (today, Exponent Strategy Vaults). A deposit mints vault shares (LP tokens) priced at the vault’s NAV. Withdrawals redeem shares instantly from reserves or through a withdrawal queue. This guide walks through the full flow. Data lives on the markets API (https://tars.loopscale.com/v1/markets). Transactions are built by the Pandora API (https://tars.loopscale.com/v1/pandora). For how the vault works underneath, see Earn Vault Architecture and Earn Vault Flows.

1. Find a vault

Get Earn Vaults lists every registered vault with its latest snapshot. That includes Draft vaults that aren’t open for deposits yet, so filter on status == 1 before offering deposits. The fields you need most: realizedApyBps* fields are deprecated aliases of realizedReturnBps*. Use the new names.
The transaction endpoints don’t check status, the withdrawal flags, or requiresAcknowledgment. They’ll build a deposit for a Draft vault or a cancel on a vault with cancelEnabled: false (the latter then fails onchain). Gate these in your own UI, the way the Loopscale app does.
Get Earn Vault History returns the same snapshot fields over time for charts, newest first. Snapshots are taken every 15 minutes.

Reading vault configuration

parsedAccountJson.exponentStrategyVault on Get Earn Vault is the decoded onchain vault account. Fields worth knowing:

2. Acknowledge the vault’s terms

If requiresAcknowledgment is true, show the vault’s terms and call Acknowledge Earn Vault once per wallet before its first deposit. It only records the acceptance (a timestamp on the wallet’s position), so it builds no transaction. Check acknowledgedAt on Get Earn Position to see whether a wallet has already accepted.

3. Deposit

Call Deposit to Earn Vault with the wallet and an amount in base units. The response carries two transactions in txBase64s: an AUM refresh, then the deposit. Sign both with the wallet and submit them in order as one Jito bundle.
Pass minLpOut to protect against NAV moving between quote and landing. You can estimate expected shares as amount × 1e18 / navPerShareE18. Deposits fail onchain if they would exceed the vault’s deposit cap.

Sending the bundle

The two transactions must land in the same slot, because the vault program rejects price data that wasn’t refreshed in the current slot. Any Jito-compatible sender works. The action transaction already pays the tip.
Transactions carry a blockhash from build time, so sign and send promptly. If a bundle doesn’t land, rebuild rather than resending, since the AUM refresh has to be current.

4. Track the position

Get Earn Position returns a wallet’s share balance, cost basis and realized PnL in one vault, plus its open withdrawal requests. Get Earn Portfolio returns the same for every vault the wallet holds, including vaults where it only has open withdrawal requests.
shareBalance is the wallet’s live share-token balance. queuedShares are shares sitting in escrow behind open withdrawal requests, and they still earn until filled. Cost basis is average cost across both. feesPaidAssets isn’t populated yet and reads 0.

5. Withdraw

Call Withdraw from Earn Vault with mode:
  • instant redeems from the vault’s reserves right away, paying the withdrawal fee plus the instant fee, while reserves and the per-window instant cap allow.
  • queued opens a withdrawal request. The response’s requestId identifies it.
Either mode accepts mint to pick a payout token from acceptedAssetMints. Instant mode pays it out directly. For queued requests the mint is recorded as a preference: the manager chooses the payout token(s) at fill time, so check fills on the request for what was actually paid.

Instant capacity

Before offering instant mode, estimate capacity from the vault account:
If a request is larger than capacity, the transaction fails onchain. Offer queued mode instead.

Queued requests

Watch a queued request with Get Earn Withdrawal Queue or Get Earn Position. A request moves through 0 Pending → 1 Partial → 2 Fulfilled, or 3 Cancelled.
  • Claim. Claim Earn Withdrawal pays out everything filled so far. It succeeds only once sharesFilled > sharesClaimed and the vault’s withdrawal period has unlocked (the lock interval, or the next scheduled withdrawal day).
  • Cancel. Cancel Earn Withdrawal returns the shares. It needs cancelEnabled, and the vault’s cancel cooldown to have passed. The Loopscale app only offers it while nothing has been filled.
Every withdraw, claim and cancel response uses the same two-transaction bundle as a deposit.

Building directly against the vault program

The Pandora API is the easiest path, but you can also build transactions yourself with Exponent’s TypeScript SDK (@exponent-labs/exponent-sdk). The Pandora endpoints use the same calls: You’re then responsible for the same-slot bundling, Kamino/Scope reserve refreshes (Scope’s refresh must be the first instruction in its transaction), and lookup tables. See Exponent’s strategy vault developer docs.

Common errors