Test your API integration

Ensure you are receiving and responding to order flow as expected

A simple integration test for the API server you set up in Receive order flow. It is a Docker container that can be executed against your running API instance. It will request an indicative quote and firm quote and check that the response is as expected for either the legacy or sponsored endpoints.


The Docker CLI must be installed.

Pull API integration test container

Execute the following command to pull the container:

docker pull ghcr.io/dflowprotocol/market-maker-api-integration-test:latest

Run tests

To run the Docker image, run the following command:

docker run -e MARKET_MAKER_URL=<URL> mm_api_validator --evm-legacy --evm-sponsored


The following options are available, but only one should be run at a time:

  --evm-legacy            Run legacy swap API tests
  --evm-sponsored         Run sponsored swap API tests

Environment variables

The MARKET_MAKER_URL environment variable can be used to specify the URL of your API instance to test against. This environment variable is required.

This URL should specify the full path for either the legacy or sponsored swap API, e.g. https://api.marketmaker.network/evm/legacy or https://api.marketmaker.moonbeam.network/evm/sponsored.

Expected Execution Results

Executing the above command should give the following results, showing all tests passing:

➜ docker run -e MARKET_MAKER_URL=http://host.docker.internal:8084/evm/legacy ghcr.io/dflowprotocol/market-maker-api-integration-test:latest --evm-legacy
yarn run v1.22.19
$ mocha --timeout 1000000 --require source-map-support/register dist/evm_legacy.js
Market Maker URL: http://host.docker.internal:8084/evm/legacy

    ✔ getFirmQuote (778ms)
    ✔ getIndicativeQuote (288ms)

  2 passing (1s)

Done in 1.52s.