> ## Documentation Index
> Fetch the complete documentation index at: https://jupiter-feat-jupiterz-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate AMM into Metis

> Implement the Jupiter AMM Interface, verify quote parity with the test kit, and submit your AMM for Metis routing.

This guide covers how to integrate your AMM (automated market maker) into Jupiter's Metis routing engine. The workflow is self-serve: implement the Jupiter AMM Interface, prove that your quotes match on-chain execution with the test kit, then submit your SDK for review.

Jupiter is one of the most widely integrated protocols, so a lot of work is involved in minimizing issues on new integrations and making each integration valuable to our users and partners. Our top priority is ensuring security and providing the best prices and the best token selection for our users, so we will focus on AMMs that will bring the most benefits to them.

## Integration Prerequisites

As Solana grows and more AMMs are built, we have to be more cautious in the AMMs we integrate, we look into a variety of factors.

* **Code health**: It will help with integration and ensure maintainability in the future.
* **Security audit**: This is important to ensure users' funds are secure and the program is not malicious.
* **Traction**: We look at the traction of the AMM to ensure it has market demand and is well-used.
* **Team and backers**: This is a good indicator of the quality of the AMM if they are backed by or built by reputable or verifiable entities.

## Step 1: Implement the AMM Interface

Implement the `Amm` trait from the [`jupiter-amm-interface`](https://docs.rs/crate/jupiter-amm-interface) crate for your AMM. The [jup-ag/jupiter-amm-interface](https://github.com/jup-ag/jupiter-amm-interface) repository is the source of truth for the trait definition and implementation guidance, follow its READMEs.

Jupiter-side requirements:

* Enable us to fork your SDK, this ensures our users that we can guarantee maintenance, support for the SDK, and fix potential bugs related to integrated AMMs.
* Limit the `Amm` implementation to deserializing state and quoting. Keep the detailed math in your SDK, and do heavy deserialization and precomputation in `update` rather than `quote`.

<Info>
  **NOTE**

  `get_accounts_to_update` provides the necessary accounts to fetch. They are batched and cached on our end, then delivered through `update` to the AMM instance. There might be multiple calls to `quote` using the same cache, so **we do not allow any network calls** in the entire implementation.
</Info>

## Step 2: Verify quote parity with the test kit

Before submitting, prove that your implementation quotes exactly what the on-chain program executes. The `jupiter-amm-test-kit` crate in the same repository automates this: it snapshots a live pool, runs your `Amm::quote`, executes your program's native swap instruction in LiteSVM, and asserts the on-chain token deltas equal the quote exactly.

Follow the [test kit README](https://github.com/jup-ag/jupiter-amm-interface/tree/main/test-kit) for the test-suite pattern and fixtures. The [SPL Token Swap reference suite](https://github.com/jup-ag/jupiter-amm-interface/blob/main/test-kit/tests/spl_token_swap.rs) is a complete working example to copy.

The kit covers the common case first: ExactIn swaps that run as a single top-level instruction with one signer. If one of its documented limitations blocks you, [open an issue](https://github.com/jup-ag/jupiter-amm-interface/issues) on the repository rather than working around it silently.

## Step 3: Submit your integration

Once your parity tests pass, submit your AMM for review through the [AMM integrators support form](https://support.jup.ag/requests/new/amm-integrators). Include:

* A link to your SDK repository, with the parity test suite and committed fixtures, and access for us to fork it.
* Your security audit.
* Traction metrics and information about your team and backers.

After your AMM is integrated, markets on it must meet the liquidity criteria described in [Market Listing](/swap/routing/amm/market-listing) to remain routable.

## More

<Accordion title="Detect Jupiter Frontend Flow">
  Trades that originate from the Jupiter frontend (jup.ag) are retail flow. They are non-toxic order flow and if your propAMM can identify this flow, you can quote it tighter spreads with confidence.

  To make that flow verifiable, the Jupiter frontend adds a dedicated signer to every swap transaction and signs the transaction with it:

  | Signer           | Address                                       |
  | ---------------- | --------------------------------------------- |
  | Jupiter frontend | `sighWH8KaiT7QhtV4w29ReVF8kG6D5yG3EQP1KYyGVF` |

  To detect Jupiter frontend flow, check the transaction's account keys for this address as a signer and confirm its signature is present and valid. Jupiter holds the private key, so a valid signature from this address can only have been produced by the Jupiter frontend.

  <Note>
    Verify the signature, not just the presence of the address. Any sender can add `sighWH8KaiT7QhtV4w29ReVF8kG6D5yG3EQP1KYyGVF` to a transaction's account keys, but only the Jupiter frontend can produce a valid signature for it. A transaction that lists the address without a valid signature from it is not Jupiter frontend flow.
  </Note>
</Accordion>
