Skip to main content

Introduction

Swap Router API


Using Swap Router API, you can find the best route to exchange assets and make the exchange.

Step by step:

  1. Lookup chains you want to swap Supported Chains
  2. Lookup addresses of tokens you want to swap, for example ‘0xxx’ , ‘0xxxx’ for MATIC -> USDC
  3. Lookup spender is trusted Spender
  4. Check for allowance of swap router contract to spend source asset (/approve/allowance) Check Allowance
  5. If necessary, give approval for swap router to spend source token (/approve/transaction) Allowance transaction
  6. Monitor the best exchange route using (/swap/calculateTrade) Swap Route
  7. Monitor the best cross chain exchange route using (/swap/calculateCrossTrade) Cross Chain Route

Swap API Endpoint:

VersionNoteEndpoint
V1The latest versionhttp://router-api.openliq.com/