Minima Docs
  • Minima DeFi Router
  • Quick Start
  • Supported Protocols and Functions
  • Swaps
    • Good to know
    • Query a Swap
    • Exclude Protocols from Route
    • Execute a Swap
  • Reference
    • API Reference
      • Querying a Swap Route
      • Deposit
      • Withdraw
Powered by GitBook
On this page
  1. Reference
  2. API Reference

Querying a Swap Route

PreviousAPI ReferenceNextDeposit

Last updated 2 years ago

get

Get a swap route from one token to another

Authorizations
Path parameters
tokenInstring · 20 byte EVM addressRequired

Input token for swap

tokenOutstring · 20 byte EVM addressRequired

Output token

amountInstring · Raw uint256 valueRequired

Total amount of input token to be traded

fromstring · 20 byte EVM addressOptional

Transaction originator. If present, will return a transaction ready to be signed

slippageinteger · BPSOptional

Allowed slippage, in bips. Can be congifigured at transaction, defaults to 10 BPS

tostring · 20 byte EVM addressOptional

Recipient of trade. Defaults to from

deadlineMsinteger · Unix SecondsOptional

Deadline for quote, defaults to 5 minutes

chainIdinteger · enumOptional

Chain to perform swap on, defaults to 42220 (CELO). More chains coming soon.

Possible values:
Responses
200
Path found Successfully
application/json
get
GET /routes HTTP/1.1
Host: router.nodefinance.org
X-API-KEY: YOUR_API_KEY
Accept: */*
200

Path found Successfully

{
  "expectedOut": "text",
  "routerAddress": "text",
  "details": {
    "path": [
      "text"
    ],
    "pairs": [
      "text"
    ],
    "extras": [
      "text"
    ],
    "inputAmount": "text",
    "expectedOutputAmount": "text",
    "deadline": 1,
    "partner": 1,
    "sig": "text"
  }
}