# Stable Build #1: Introducing the SDK for Stablecoin Builders

By [Stable](https://blog.stable.xyz) · 2026-06-04

---

If you’re building on [Stable](https://stable.xyz/), whether that’s a neobank, a payroll provider, a wallet, or an incentivized yield product, this SDK is your backend. It lets you move USDT0 between user balances, bridge it in from other chains, and swap between tokens. 

[@stablechain/sdk](https://docs.stable.xyz/en/reference/sdk?utm_campaign=stable-build-01-sdk-v0) adds Earn alongside the existing transfer, bridge, and swap. Approvals, permits, share math, liquidity routing, and decimals are all handled internally, so a position takes the same shape as any other call you're already making.

This is the first **_Stable Build_,** our series for developers shipping products on Stable. If we ship something for you, you'll read it here first.

**What you can do today**
-------------------------

Each method maps to a real operation a stablecoin product needs: putting balances to work, taking them back out, claiming what's earned, and reading the position to show your users where they stand.

**The SDK is changing quickly while we ship v1. The snippets below are accurate at the time of writing, but the** [**SDK reference**](https://docs.stable.xyz/en/reference/sdk?utm_campaign=stable-build-01-sdk-v0) **is always the source of truth.**

### Deposit

Move USDT0 from a user’s balance into a [Morpho](https://morpho.org/) vault that supplies StableEarn.

    const { txHash } = await stable.earn.deposit({ amount: 100 });

ERC-20 approval and permit signatures happen behind the scenes. Pass `depositBuffer` to cap the deposit at a fraction of the vault's idle liquidity, or `idempotencyKey` to deduplicate retries. See the [SDK reference](https://docs.stable.xyz/en/reference/sdk?utm_campaign=stable-build-01-earn) for the full parameter list.

### Withdraw and redeem

Exit by asset amount with `withdraw`, or by share count with `redeem`.

    // By asset amount
    await stable.earn.withdraw({ amount: 100 });
    
    // By share count, for closing a full position
    await stable.earn.redeem({ shares: 50 });

When idle vault liquidity is short, `forceWithdraw` and `forceRedeem` deallocate from the underlying market adapters in the same call. See the SDK reference for the full Earn surface.

### Incentive rewards

Fetch pending [Merkl](https://merkl.xyz/) rewards and claim every reward token in one transaction, with proofs handled for you

    const { rewards } = await stable.earn.incentiveRewards.fetch();
    const { txHash, tokenCount } = await stable.earn.incentiveRewards.claim();

See the [SDK reference](https://docs.stable.xyz/en/reference/sdk?utm_campaign=stable-build-01-earn) for the response shape.

### Read 

`createStableReader` returns a read-only client for positions, APY, projections, and instant-withdrawability checks. Useful anywhere a dashboard or quote screen wants the data layer without a connected wallet.

    import { createStableReader, Network, STABLE_VAULT_ADDRESS } from "@stablechain/sdk";
    
    const reader = createStableReader({
    
      network: Network.Mainnet,
    
      earn: { vault: STABLE_VAULT_ADDRESS },
    
      address: "0xYourAddress",
    
    });
    
    const { assets } = await reader.earn.position();
    
    const { apy, native, rewards } = await reader.earn.getYield();
    
    const { projectedYield } = await reader.earn.preview({ amount: 1000, horizonDays: 365 });
    
    const { isInstant, availableLiquidity } = await reader.earn.withdrawability({ amount: 500 });

See the SDK reference for the response shape.

### In the same client

Alongside StableEarn, SDK v0 includes the core asset movement primitives developers need. Whether you're moving assets, earning yield, or managing positions, it all happens through the same typed client.

`transfer`, `bridge`, and `swap` are unchanged and ship in the same stable object, with `quoteBridge` and `quoteSwap` for read-only previews. A neobank backend can move balances, move funds in from another chain, swap into USDT0, and put the rest to work, all without leaving the SDK.

Getting Started
---------------

**npm install @stablechain/sdk** **viem** and you're set. The [SDK quickstart](https://docs.stable.xyz/en/tutorial/sdk-quickstart?utm_campaign=stable-build-01-earn) walks through creating a client, sending your first deposit, and reading a position on testnet. Grab testnet USDT0 from the [faucet](https://docs.stable.xyz/en/how-to/use-faucet?utm_campaign=stable-build-01-earn) before running through it.

What’s next
-----------

We're shipping richer financial primitives on top of USDT, more data through the reader, and broader liquidity into the same client

Start building
--------------

The [SDK overview](https://docs.stable.xyz/en/reference/sdk?utm_campaign=stable-build-01-sdk-v0) is the canonical reference for all methods, errors, and signing modes. 

**If you're building on Stable or have questions about the SDK, find us in** [**Discord**](https://discord.gg/stablexyz)**.** 

We're shaping the next version now, and we want to hear what you need from the SDK. Tell us what you're building, what's missing, and what you'd like to see next.

---

*Originally published on [Stable](https://blog.stable.xyz/stable-build-1-introducing-the-sdk-for-stablecoin-builders)*
