# Create an Automated Market Maker An [Automated Market Maker (AMM)](/docs/concepts/tokens/decentralized-exchange/automated-market-makers) can be an efficient way to facilitate exchanges between two assets while earning its liquidity providers passive income. This tutorial shows how to create an AMM for a given asset pair. AMM script script ## Prerequisites - You must have an XRP Ledger address and some XRP. For development and testing purposes, you can get these from a [Faucet](/resources/dev-tools/xrp-faucets). - You should be familiar with the Getting Started instructions for your preferred client library. This page provides examples for the following: - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/) **version 2.11.0 or later**. See [Get Started Using JavaScript](/docs/tutorials/javascript/build-apps/get-started) for setup steps. - You can also read along and use the interactive steps in your browser without any setup. - You should have a basic understanding of how [tokens](/docs/concepts/tokens) work in the XRP Ledger. - You may want to read about [Automated Market Makers in the XRP Ledger](/docs/concepts/tokens/decentralized-exchange/automated-market-makers) first. ## Example Code Complete sample code for all of the steps of these tutorials is available under the [MIT license](https://github.com/XRPLF/xrpl-dev-portal/blob/master/LICENSE). - See [Code Samples: Create an AMM](https://github.com/XRPLF/xrpl-dev-portal/tree/master/_code-samples/create-amm/) in the source repository for this website. ## Steps ### 1. Connect to the network You must be connected to the network to query it and submit transactions. The following code shows how to connect to a public {{use_network}} server using a supported [client library](/docs/references/client-libraries): JavaScript // In browsers, use a