*** title: Build a Token Swap App (Permit2) description: >- Advanced guide covering how to build a token swap app using 0x Swap API (Permit2). ---------- ⚠️ The **Permit2** flow is intended for **advanced integrators only**. If you're new to 0x Swap API or want to avoid the double-signature UX, consider using [AllowanceHolder](/docs/0x-swap-api/guides/build-token-swap-dapp-nextjs) instead. This guide walks through a Next.js demo app that demonstrates a full token swap flow using **Permit2**, a contract designed for advanced integrators who are comfortable handling EIP-712 signatures and advanced token approvals. This guide is intended for advanced integrators only. If you are new to Swap API or want to avoid the double-signature flow, we recommend using the Swap API [AllowanceHolder](/docs/0x-swap-api/guides/build-token-swap-dapp-nextjs) flow. ## Try it Out Code for the demo app used in this tutorial: [https://github.com/0xProject/0x-examples/tree/main/swap-v2-permit2-next-app](https://github.com/0xProject/0x-examples/tree/main/swap-v2-permit2-next-app) ## What We’re Building This app demonstrates principles used in production swapping apps such as [Matcha.xyz](https://matcha.xyz/): * Fetch indicative prices via `/swap/permit2/price` * Get firm quotes via `/swap/permit2/quote` * Approve token allowances using Permit2 * Sign Permit2 EIP-712 messages and submit transactions ![](https://files.buildwithfern.com/0x.docs.buildwithfern.com/e5a7d21520c1b3cfe816d43d59338f1251551cd97f2e151b0c992885d8dba038/docs/assets/img/0x-swap-api/swap-v2-demo-app.png) Video tutorial version here: