> ## Documentation Index
> Fetch the complete documentation index at: https://docs.powfi.alephium.org/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK & API

> Build on Powfi, the DeFi protocol on Alephium: swaps, concentrated and constant-product liquidity, and xALPH liquid staking.

Powfi ships one integration surface today: the **TypeScript SDK** (`@alephium/powfi-sdk`). It wraps the Powfi smart contracts on Alephium (CPMM pools, CLMM pools, and xALPH staking), computes quotes locally, and builds and signs transactions through any `@alephium/web3` signer.

## Who this chapter is for

* **Wallet and frontend developers** who want to quote and execute swaps, show pool data, or let users provide liquidity.
* **Backend and bot developers** running market-making, arbitrage, or treasury automation against Powfi pools.
* **Aggregators and integrators** routing flow through Powfi, optionally charging an [integrator fee](https://docs.powfi.alephium.org/guides/integrator-fees.md).

> [!NOTE]
>
> **Want to run something first?** The [Quickstart](https://docs.powfi.alephium.org/quickstart.md) reads a live CPMM pool on testnet and quotes a swap in about 20 lines, with no signer needed.

## Pick your integration path

| You are building | Use | Why |
| - | - | - |
| A swap UI or wallet | `powfi.cpmm` / `powfi.clmm` + static quote helpers | Local quotes (no RPC per keystroke), signer-agnostic transactions |
| A trading bot or backend | `Powfi.load({ networkId, signer })` with a `PrivateKeyWallet` | Full control over slippage, deadlines, and route selection |
| A CLMM liquidity manager | `powfi.clmm` + [`TickUtils`](https://docs.powfi.alephium.org/utilities/tick-utils) + [`ClmmLiquidityUtils`](https://docs.powfi.alephium.org/utilities/liquidity-utils) | Price ↔ tick conversion and position math that match on-chain rounding |
| A staking integration | `powfi.staking` | Stake ALPH for xALPH, manage unstake requests |
| Something the modules don't cover | Re-exported [contract artifacts](https://docs.powfi.alephium.org/reference/contracts.md) | Direct, typed access to every Powfi contract and script |

If you're not sure: start with the module facade (`powfi.cpmm`, `powfi.clmm`, `powfi.staking`). Drop down to the raw contract bindings only when you need a method the SDK doesn't wrap.

## Protocol building blocks

> [card] [CPMM](https://docs.powfi.alephium.org/modules/cpmm.md)
>
> Constant-product (x·y=k) pools with a 0.3% swap fee and fungible LP tokens.

> [card] [CLMM](https://docs.powfi.alephium.org/modules/clmm.md)
>
> Concentrated-liquidity (Uniswap V3-style) pools with fee tiers, tick ranges, and farming rewards.

> [card] [Staking](https://docs.powfi.alephium.org/modules/staking.md)
>
> Stake ALPH for liquid xALPH, and unstake as it unlocks over time.

> [card] [Token list](https://docs.powfi.alephium.org/modules/token.md)
>
> Cached token metadata (symbol, decimals, logo) from the Alephium token list.

## Where to go next

> [card] [Quickstart](https://docs.powfi.alephium.org/quickstart.md)
>
> Install, load, quote, swap.

> [card] [TypeScript SDK](https://docs.powfi.alephium.org/typescript-sdk.md)
>
> Initialization, module facades, transaction results, pitfalls.

> [card] [Guides](https://docs.powfi.alephium.org/guides/cpmm-swap.md)
>
> End-to-end recipes for common tasks.

> [!NOTE]
>
> **Versioning.** Every code sample in this section targets `@alephium/powfi-sdk@1.0.2` (`@alephium/web3@3.0.3`). When the SDK changes, pages are re-verified and this banner is updated. If a sample fails on a newer version, check the [changelog on GitHub](https://github.com/alephium/powfi-sdk) first.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.