paraswap-dex-lib. The harness is the same adapter shape Velora uses internally: it fetches your token, pair, price, blacklist, and firm quote endpoints, validates the responses, and can run route-level E2E swaps against your quoted liquidity.
This is not a replacement for Velora’s onboarding tests, but it catches most integration mistakes before credentials are exchanged.
What the harness checks
The generic RFQ folder contains the files you need most:
Use the schema tests first, then the live endpoint fetcher, then route-level E2E tests. If the first layer fails, the later layers will be noisy.
Prerequisites
Clone the repo and install dependencies:>=22 and pnpm >=11.
Your API needs a chain-scoped base URL. For example, if Velora should call https://mm.example.com/mainnet/tokens, set:
/tokens rather than /mainnet/tokens, also set:
GENERIC_RFQ_PATH_TO_OVERRIDE unset if the chain prefix is part of the signed path.
Smoke-test response schemas
Run the local validator tests before pointing the harness at your service:- Token entries must include an
addressstring. The schema does not checksum or EVM-validate token addresses at this layer, so catch bad token addresses in your own tests too. decimalsmust be present.- Price levels must be string numbers.
- Empty price objects are allowed for disabled pairs.
- Crossed books are rejected: the highest bid must be lower than the lowest ask.
- Firm quotes must return an
orderwith a validmaker,taker, token addresses, amounts,nonceAndMeta, andsignature.
Test your live endpoints
Set the live endpoint credentials:GENERIC_RFQ_SECRET_KEY is base64 encoded. The fetcher decodes it before signing requests. The live fetcher uses paraswap as the auth domain; use that Domain value for this test unless you edit the script.
The current fetch-mm-api.ts script is hardcoded to network = 1, so it reads HTTP_PROVIDER_1 and validates firm quotes against the mainnet taker address declared in the script. Edit those constants if you want to use it against another chain.
Then run the live fetcher:
GET /tokensGET /pairsGET /pricesGET /blacklist
mainFirm() helper for POST /firm, but it is disabled and its payload uses placeholders. Fill makerAsset, takerAsset, either makerAmount or takerAmount, and userAddress. Then add the required takerAddress field to the payload, and call mainFirm() at the bottom of the file.
For takerAddress, use the Velora execution contract that will fill the order on that chain. During onboarding, Velora will confirm the exact value to test. The harness validates that your returned order uses the expected taker.
Run route-level E2E tests
After the endpoint checks pass, test whether dex-lib can route through your RFQ liquidity. Edite2e-test-config.ts with the token pairs, side, and amounts you want to test:
dexKey in generic-rfq-e2e.test.ts:
paraswap as the auth domain.
Run the E2E test:
What to send Velora
When you contact Velora to become a market maker, include:- Chain-scoped base URLs for each chain.
- The chains, token pairs, and expected liquidity you want to start with.
- Whether you use HMAC authentication, IP allowlisting, or both.
- Maker wallet addresses and whether they are EOAs or EIP-1271 contracts.
- The
paraswap-dex-libcommit you tested against. - The endpoint fetcher output and E2E test output.
Current harness notes
The harness is useful because it is strict. Two details matter:- It rejects crossed books. Keep the highest bid below the lowest ask.
- Its direct
/firmvalidator expects anorder. If you support the production blacklist shortcut, where/firmreturns success withoutorderfor a blacklisteduserAddress, test that behavior separately and rely on/blacklistfor the harness run.