Skip to main content

Quickstart

This guide gets you depositing into the private yield vault and withdrawing with accrued yield, using TACEO's hosted infrastructure — no contract deployment required.
In parallel, you can walk through the flow in the reference app Merces Yield

Testnet only

The current deployment uses test tokens with no real-world value. Do not use mainnet private keys or real funds.

Prerequisites

Complete the Private Payments Quickstart first — it covers installing the client, creating a Client instance, and funding your private balance. Come back here once your client is set up and you hold a private USDT balance.

Step 1: Deposit private USDT into the vault

The client must already hold a private USDT balance. If starting from an ERC-20 balance, first call confidentialDeposit (or privateDeposit) as shown in the Payments Quickstart.

import { parseUnits } from 'viem';

const decimals = await client.getDecimals();
const txHash = await client.vaultDeposit(parseUnits('100', decimals));

console.log('Vault deposit confirmed:', txHash);

Step 2: Check your vault balance

import { formatUnits } from 'viem';

const decimals = await client.getDecimals();
const vaultShares = await client.getVaultBalance();
const privateBalance = await client.getPrivateBalance();

// Convert shares back to the current USDT value
const vaultValueUsdt = await client.convertToAssets(vaultShares);

console.log('Private USDT balance:', formatUnits(privateBalance, decimals));
console.log('Vault shares (vUSDT):', formatUnits(vaultShares, decimals));
console.log('Vault value in USDT: ', formatUnits(vaultValueUsdt, decimals));

Step 3: Withdraw back to your private balance

Specify how many vault shares to redeem. The corresponding USDT amount — including any accrued yield — is credited to your private balance.

import { formatUnits } from 'viem';

const decimals = await client.getDecimals();

// Withdraw all vault shares
const shares = await client.getVaultBalance();
const txHash = await client.vaultWithdraw(shares);

console.log('Vault withdrawal confirmed:', txHash);

const newPrivateBalance = await client.getPrivateBalance();
console.log('New private USDT balance:', formatUnits(newPrivateBalance, decimals));

Next steps