# Powfi Docs ## Overview ### Powfi - [Overview](https://docs.powfi.alephium.org/index.md): What Powfi is: concentrated and constant-product liquidity, xALPH liquid staking, ALPH alignment, and incentives. ## User Guide ### Basics - [User Guide](https://docs.powfi.alephium.org/user-guide/index.md): Connect your Alephium wallet, get some ALPH, make your first swap, provide liquidity, or stake ALPH. - [Choosing a Wallet](https://docs.powfi.alephium.org/user-guide/choosing-a-wallet.md): Alephium's own wallets, third-party software wallets, hardware wallets, and the hot/cold wallet pattern. - [Funding a Wallet](https://docs.powfi.alephium.org/user-guide/funding-a-wallet.md): Get ALPH into your Alephium wallet: buy it in your wallet, withdraw from an exchange, bridge it, or receive it. ### Using Powfi - [Swap](https://docs.powfi.alephium.org/user-guide/swap.md): Your first token swap on Powfi: connect your wallet, choose tokens, review the quote, confirm, and verify. - [Provide Liquidity](https://docs.powfi.alephium.org/user-guide/provide-liquidity.md): Provide liquidity to Powfi CPMM or CLMM pools, create pools, and earn a share of trading fees. - [Stake ALPH](https://docs.powfi.alephium.org/user-guide/stake.md): Stake ALPH on Powfi and receive xALPH: how staking works, how rewards accrue, and what to keep in mind. ### Help - [FAQ](https://docs.powfi.alephium.org/user-guide/faq.md): Common questions about xALPH: what it is, how rewards work, how to use it, and how to convert it back to ALPH. ## Developer Guide ### SDK & API - [SDK & API](https://docs.powfi.alephium.org/developer-guide.md): Build on Powfi, the DeFi protocol on Alephium: swaps, concentrated and constant-product liquidity, and xALPH liquid staking. - [Quickstart](https://docs.powfi.alephium.org/quickstart.md): Install the SDK, read a pool, quote a swap, and send your first transaction. - [TypeScript SDK](https://docs.powfi.alephium.org/typescript-sdk.md): @alephium/powfi-sdk: installation, initialization, module facades, transaction results, and common pitfalls. - [AI integration](https://docs.powfi.alephium.org/ai-integration.md): Machine-readable versions of these docs for coding agents and LLM tools. ### Core concepts - [Amounts & slippage](https://docs.powfi.alephium.org/concepts/amounts-and-slippage.md): bigint units, token decimals, basis points, and how each pool type applies slippage. - [Networks & configuration](https://docs.powfi.alephium.org/concepts/networks.md): Built-in networks, overriding endpoints, and how contract addresses are resolved. - [Errors](https://docs.powfi.alephium.org/concepts/errors.md): Typed SDK errors and the plain errors thrown by validation. ### Modules - [Powfi](https://docs.powfi.alephium.org/modules/powfi.md): The SDK entry point: network, providers, signer, and module instances. - [CPMM](https://docs.powfi.alephium.org/modules/cpmm.md): Constant-product (x·y=k) pools: pool state, quotes, swaps, liquidity, and pool creation. - [CLMM](https://docs.powfi.alephium.org/modules/clmm.md): Concentrated-liquidity pools: fee tiers, pool state, swap simulation, swaps, positions, and farming rewards. - [Staking](https://docs.powfi.alephium.org/modules/staking.md): xALPH liquid staking: stake ALPH, unstake with linear unlocking, and the protocol fee-collector vaults. - [Token](https://docs.powfi.alephium.org/modules/token.md): Token metadata from the Alephium token list, with caching. ### Utilities - [TickUtils](https://docs.powfi.alephium.org/utilities/tick-utils.md): Convert between ticks, sqrtPriceX96, and human-readable prices for CLMM pools. - [Liquidity & pool utils](https://docs.powfi.alephium.org/utilities/liquidity-utils.md): ClmmLiquidityUtils for position math and PoolUtils for position IDs and offline swap simulation. - [Math, numeric & helpers](https://docs.powfi.alephium.org/utilities/math.md): MathUtil, NumericUtils, token ordering, address normalization, and logging. ### Guides - [Swap on CPMM](https://docs.powfi.alephium.org/guides/cpmm-swap.md): Quote locally, show price impact, and execute exact-in or exact-out swaps with slippage protection. - [Provide CPMM liquidity](https://docs.powfi.alephium.org/guides/cpmm-liquidity.md): Create a pair, add balanced liquidity, track your share, and withdraw. - [Swap on CLMM](https://docs.powfi.alephium.org/guides/clmm-swap.md): Pick a fee tier, simulate the swap, compute the output offline, and execute with a price limit. - [Open & manage a CLMM position](https://docs.powfi.alephium.org/guides/clmm-position.md): Choose a price range, size the deposit, add liquidity, collect fees, and withdraw. - [Stake ALPH for xALPH](https://docs.powfi.alephium.org/guides/xalph-staking.md): Stake, show the exchange rate, start an unstake, and claim as it unlocks. - [Referral staking & partner commission](https://docs.powfi.alephium.org/guides/referral-staking.md): Attribute stakes to your partner address with stakeAlphWithReferral, and how partner commission is calculated and paid. - [Integrator fees](https://docs.powfi.alephium.org/guides/integrator-fees.md): Charge a fee on swaps routed through your app, on both CPMM and CLMM. ### Reference - [Types](https://docs.powfi.alephium.org/reference/types.md): Request, response, and config types exported by @alephium/powfi-sdk. - [Contract artifacts & deployments](https://docs.powfi.alephium.org/reference/contracts.md): Typed bindings for every Powfi contract and script, and the bundled deployment addresses. - [Developer CLI](https://docs.powfi.alephium.org/reference/cli.md): The bundled command-line tool for exercising the SDK against devnet, testnet, or mainnet. > The links below point to documentation indexes. Follow each `/_llms/` index recursively until you reach documentation pages. ## Indexes - [Simplified Chinese (33 pages)](https://docs.powfi.alephium.org/_llms/zh-hans.md): Documentation for Simplified Chinese. - [French (33 pages)](https://docs.powfi.alephium.org/_llms/fr.md): Documentation for French. This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.