GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - 0xProject/swap-demo-tutorial

BranchesTags
Open more actions menu

Latest commit

 

History

23 Commits
23 Commits

Folders and files

NameName
Last commit message
Last commit date
swap-demo-tutorial-part-1
swap-demo-tutorial-part-1
 
 
swap-demo-tutorial-part-2
swap-demo-tutorial-part-2
 
 
swap-demo-tutorial-part-3
swap-demo-tutorial-part-3
 
 
swap-demo-tutorial-part-4
swap-demo-tutorial-part-4
 
 
swap-demo-tutorial-part-5
swap-demo-tutorial-part-5
 
 
swap-demo-tutorial-part-6
swap-demo-tutorial-part-6
 
 
swap-demo-tutorial-part-7
swap-demo-tutorial-part-7
 
 
swap-demo-tutorial-part-8
swap-demo-tutorial-part-8
 
 
swap-demo-tutorial-part-9
swap-demo-tutorial-part-9
 
 
.DS_Store
.DS_Store
 
 
README.md
README.md
 
 

Repository files navigation

Note šŸ“£ All API requests require a 0x API key. Legacy code examples may contain requests without API keys. Follow this guide for how to get a live API key and use it for any 0x products.

Warning

0x API v1 was sunset on April 11, 2025. Please migrate to v2. For details, see the migration guide. See the latest v2 examples.

How to Build a Simple Token Swap DApp using the 0x Swap API

Learn how to build a token swapping dapp, similar to a simple Matcha.xyz, using the 0x /swap API endpoint.

This app aggregates liquidity across the greater DEX ecosystem using 0x to surfaces the best price to the user and allow them to easily settle their trades!

Follow Along to Learn

  • šŸ’¦ What is liquidity aggregation?
  • 🪟 Query + Display an ERC20 token list
  • ā™»ļø Use @0xProject API's /swap endpoint
  • 🧱 Build a Swap Dapp with Metamask and Web3.js

Video and Written Tutorial

  • šŸŽ„ Watch Video Walk-Through: https://www.youtube.com/watch?v=tVvZ1ivp4X0
  • šŸ“– Full Written Tutorial: https://0x.org/docs/0x-swap-api/guides/how-to-build-a-token-swap-dapp-with-0x-api
  • The repo is broken up by parts which correspond to parts in the written tutorial above ā˜ļø Each part builds upon the previous one.
  • Part 1. Walk-through Starter Code
  • Part 2. Connect to MetaMask
  • Part 3. Create a Modal for the Token List
  • Part 4. Fetch and Display Token List from CoinGecko API
  • Part 5. Display Selected Token Image and Symbol in Swap Box
  • Part 6. Get Price
  • Part 7. Get Quote
  • Part 8. Set a Token Allowance
  • Part 9. Perform the Swap

Further Examples

To find more demo apps, check out the official 0x examples repo.

Try out -

  • Swap API Demo App (Next.js)
  • Tx Relay API Demo App (Next.js App Router)

About

No description, website, or topics provided.

Resources

Readme
Activity
Custom properties

Stars

72 stars

Watchers

6 watching

Forks

2.1k forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Ɨ600. No cookies required.