This guide walks you through creating a vault on testnet, funding it with USDC, and activating it for contributions. It then covers how vaults work under the hood (lifecycle, fees, shares) and advanced operations like contributing to existing vaults, redeeming shares, and delegating trading permissions.
TypeScript examples use the Decibel TypeScript SDK (
DecibelWriteDex / DecibelReadDex). Python examples still use aptos-sdk with on-chain entry functions and will be updated in a follow-up.Testnet funding (Aptos testnet) — To run the full Part 1 flow (create, contribute, redeem), keep about 210 USDC in your primary Trading Account (subaccount), in chain units (6 decimals):
The creation fee and
| Item | Chain units | USDC |
|---|---|---|
| Vault creation fee (deducted from subaccount) | 100_000_000 | $100 |
initialFunding (min activation) | 100_000_000 | $100 |
Optional depositToVault (min contribution) | 10_000_000 | $10 |
| Suggested subaccount total | 210_000_000 | ~$210 |
initialFunding are separate debits from subaccount collateral.Reference implementation: typescript/packages/e2e/src/vault-e2e.ts. Run cd typescript/packages/e2e && pnpm start:vault-e2e (see .env.example for PRIVATE_KEY and API_KEY; NEXT_PUBLIC_GAS_STATION_API_KEY is only required for that smoke script, not for a typical integration).Part 1: Launch Your First Vault
Fund your account, create a vault on testnet, and activate it.
Part 2: How Vaults Work
Lifecycle, fees, shares, and parameters.
Part 3: Advanced Operations
Contributing, redeeming, querying, and delegation.
Part 1: Launch Your First Vault
You can also create and manage vaults through the Decibel UI without writing any code. Navigate to Accounts, then click the Vaults tab and “Create Vault.” This guide covers the programmatic approach.
1. Prerequisites
- Node.js 18+ (TypeScript), or Python 3.8+ (Python examples)
- An API Wallet with its private key (create one at app.decibel.trade/api)
- An API Key (Bearer Token) from Geomi (see Get API Keys)
- Testnet APT for gas fees: paste your API Wallet address into the Aptos Testnet Faucet. This is your wallet address, not your Trading Account (subaccount) address.
Gas (choose one) — Default: pay gas with testnet APT from the faucet above. Optional: set
gasStationApiKey on DecibelConfig to sponsor gas via Geomi Gas Station (see SDK configuration). Vault integrations do not require Gas Station; the repo’s vault-e2e script uses it only for convenience on testnet.2. Install Dependencies
@aptos-labs/ts-sdk is a peer dependency for Ed25519Account signing (same as the Write SDK setup).
3. Set Up Your Script
TypeScript examples useDecibelWriteDex / DecibelReadDex. Python examples use aptos-sdk with the testnet package address below.
4. Get Your Trading Account Address
Your Trading Account (subaccount) holds USDC collateral used to fund a vault.The primary subaccount is auto-created on your first deposit. You don’t need to create it manually.
5. Mint Testnet USDC
On testnet, mint USDC withrestricted_mint (rate-limited per account). For the full Part 1 walkthrough, plan for ~210 USDC in your subaccount (see the funding table above). If mint allowance is exhausted, fund via the Decibel UI or write.deposit from your wallet.
- Pay own gas (default)
- With Gas Station (optional)
Use this when
gasStationApiKey is not set on your SDK config (same as testnet APT from step 1).Alternatively, fund your wallet with testnet USDC through the Decibel UI and skip minting. On Python, creation fees and minimums depend on your target network’s on-chain config.
6. Deposit USDC to Your Trading Account
Move USDC from your wallet into your Trading Account so it can be used as vault capital. Use at least210_000_000 chain units (~210 USDC) to cover the testnet creation fee, minimum initialFunding, and a follow-on contribution:
initialFunding.
7. Create and Fund Your Vault
Create a vault and deposit initial capital from your Trading Account. On Aptos testnet, a $100 creation fee (100_000_000 chain units) is debited from subaccount collateral in addition to initialFunding. With initialFunding of at least 100_000_000 (100 USDC, 6 decimals), the vault activates automatically. The example below uses 200_000_000 for headroom above the minimum.
delegateToCreator: true grants your account permission to trade on the vault. If you set it to false, delegate separately in step 9 (equivalent to the repo’s vault-e2e.ts, which uses delegateToCreator: false then delegates in step 9).8. Activate the Vault (if needed)
IfinitialFunding was at least 100 USDC (6 decimals), skip this step. Otherwise activate after funding to the minimum:
- Pay own gas (default)
- With Gas Station (optional)
9. Delegate Trading (optional)
Skip this step if you setdelegateToCreator: true in step 7. To grant trading permissions to another address (e.g. a bot wallet):
- Pay own gas (default)
- With Gas Station (optional)
10. Place an Order as the Vault
Vault trading uses the sameplaceOrder API as a normal Trading Account. The difference is the subaccountAddr: pass the vault’s portfolio subaccount (derived from the vault object address), not your wallet’s primary subaccount. You must have delegated trading first (delegateToCreator: true in step 7, or step 9). Use a market that exists on your network (this example uses APT/USD).
Verify your vault is live. Browse to app.decibel.trade/vaults and search for your vault name. You can also query it via the REST API to confirm it’s active and accepting contributions.
Part 2: How Vaults Work
A vault pools capital under a single manager. The manager trades with the pooled funds, and profits (after fees) are distributed to all shareholders proportionally. Contributors receive fungible share tokens representing their claim on the vault’s net assets. See Vaults for Traders for the full contributor perspective.Vault Lifecycle
| Phase | What happens |
|---|---|
| Creation | Manager creates the vault, sets fee parameters, and deposits initial capital |
| Pre-activation | Vault exists but doesn’t accept contributions. Manager must fund it to the minimum ($100) |
| Activation | Manager activates the vault (or it auto-activates if funded with >= $100 at creation). It can now accept outside contributions |
| Active trading | Manager (or delegate) trades with pooled capital. Contributors can join or redeem |
| Ongoing | Fees are crystallized at each interval. Shares are minted/burned as contributors join/leave |
Interval-Based Performance Fees
Vaults use an interval-based fee model. There is no high watermark or cumulative tracking.- When a vault is created, the manager sets a fee rate (0-10%) and a fee interval (30-365 days).
- At the end of each interval, the protocol compares the vault’s current NAV to its NAV at the start of that interval.
- If the vault profited during that interval, the manager receives their fee percentage as newly minted shares.
- If the vault lost money or broke even, the manager receives nothing for that interval.
- The next interval starts fresh. There is no carry-forward of losses from previous intervals.
Key Parameters
These are the protocol-enforced limits. Vault managers choose values within these ranges at creation time.| Parameter | Range / Value |
|---|---|
| Performance fee | 0-10% (0-1000 bps) |
| Fee interval | 30-365 days |
| Min manager capital | Lesser of 5% of vault NAV or $100,000 |
| Min activation funding | $100 |
| Min contribution | $10 |
| Min redemption | $5 |
| Max contribution lockup | 0-7 days |
| Vault creation fee | Configurable per network ($100 on Aptos testnet) |
Shares as Fungible Tokens
When you contribute to a vault, you receive fungible share tokens on Aptos. These shares are transferable, can be used as collateral in other DeFi protocols, and can be traded on secondary markets. See Fungible Token Ownership for details.Protocol Vault (DLP) vs User Vaults
Decibel runs one special vault, the Decibel Liquidity Provider (DLP), alongside user-created vaults. Both use the same onchain infrastructure.| DLP Vault | User Vaults | |
|---|---|---|
| Manager | Protocol (automated) | Any user |
| Strategy | Market making | Manager’s discretion |
| Contribution lockup | 72 hours | 0-7 days (manager-configured) |
| Fee structure | 0% | Manager-defined (0-10%) |
Part 3: Advanced Operations
Contributing to an Existing Vault
Anyone can contribute to an active vault that accepts contributions. The minimum contribution is $10 USDC (10_000_000 chain units). Contributions go through your Trading Account (subaccount). After creating a vault in Part 1, an additional depositToVault matches the e2e smoke test’s follow-on contribution step.
Redeeming Shares
To withdraw from a vault, redeem your share tokens for the underlying USDC. The minimum redemption is $5 (5_000_000 share units at 6 decimals). The protocol may close up to 10% of positions per redemption at up to 2% slippage to free capital.
Query your share balance on the contributor subaccount (not the wallet address), then redeem at least the minimum:
Querying Vault Data
Trading on Behalf of a Vault
The vault manager (or any delegated account) places orders withwrite.placeOrder and subaccountAddr set to the vault portfolio subaccount (see Part 1, step 10 and Write SDK — Trading on behalf of a vault).
- At creation:
delegateToCreator: truegrants the creator trading permissions. - After creation: use
buildDelegateDexActionsToTxto delegate to a bot wallet. - Delegations can optionally include an expiration timestamp.
- The vault owner can revoke delegations on-chain at any time.
subaccountAddr is the vault subaccount.
What’s Next
Read the onchain reference
Full parameter docs for Create and Fund, Activate, Contribute, Redeem, and Delegate.
Understand vault fees and mechanics
See Vaults for Traders for the contributor perspective and Fees for the full fee breakdown.
Explore the DLP Vault
Learn about the protocol-owned liquidity vault and its backstop role on the DLP Vault page.
Build with the SDK
See Write SDK — Vault transactions and Trading on behalf of a vault. Optional end-to-end smoke:
cd typescript/packages/e2e && pnpm start:vault-e2e.
