{
 "openapi": "3.1.0",
 "info": {
  "title": "Midas FX Quotes",
  "version": "1.0.0",
  "description": "Executable FX rates for currency stablecoins (cNGN, wBRL, wARS, EURC, XSGD, KESm...) on Celo, Base, BSC and Polygon: per exchange (Uniswap, Aerodrome, Pancake, Curve, Mento, Textile RFQ) the effective rate at your trade size, slippage, and spread against the official rate. Computed from on-chain quotes and Textile RFQ previews; not bureau-de-change or parallel-market quotes."
 },
 "servers": [
  {
   "url": "https://midas-fx-api.onrender.com"
  }
 ],
 "paths": {
  "/fx": {
   "get": {
    "summary": "Currencies covered, their official rate and where each trades (free)",
    "security": [],
    "responses": {
     "200": {
      "description": "OK"
     }
    }
   }
  },
  "/fx/{ccy}": {
   "get": {
    "summary": "Executable rate per exchange at a trade size",
    "parameters": [
     {
      "name": "ccy",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "ARS",
        "AUD",
        "BRL",
        "CAD",
        "CHF",
        "COP",
        "EUR",
        "GBP",
        "GHS",
        "IDR",
        "KES",
        "NGN",
        "PHP",
        "XOF",
        "ZAR"
       ]
      },
      "description": "3-letter currency code"
     },
     {
      "name": "size",
      "in": "query",
      "schema": {
       "type": "number",
       "minimum": 1,
       "maximum": 1000000,
       "default": 1000
      },
      "description": "trade size in USD"
     }
    ],
    "x-payment-info": {
     "protocols": [
      "x402"
     ],
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.01"
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "example": {
         "ccy": "NGN",
         "size": 1000,
         "asOf": "2026-11-06T09:33:51Z",
         "oracle": {
          "ratePerUsd": 1346.6,
          "status": "ok",
          "sources": [
           "erapi",
           "fawaz",
           "mento"
          ]
         },
         "venues": [
          {
           "chain": "celo",
           "coin": "cNGN",
           "venue": "textile",
           "buy": {
            "rate": 1376.72,
            "amount": 1376724.7,
            "usd": 1000,
            "spreadBps": -223.7,
            "slippageBps": 0
           },
           "sell": {
            "rate": 1377.28,
            "amount": 1346601.3,
            "usd": 977.73,
            "spreadBps": 227.8,
            "slippageBps": 0
           }
          }
         ],
         "best": {
          "buy": {
           "chain": "celo",
           "coin": "cNGN",
           "venue": "textile"
          },
          "sell": {
           "chain": "celo",
           "coin": "cNGN",
           "venue": "textile"
          }
         },
         "excluded": [],
         "notes": []
        }
       }
      }
     },
     "402": {
      "description": "Payment required: x402, USDC on Base (PAYMENT-REQUIRED header; v1 challenge in the body)"
     }
    }
   }
  },
  "/fx/{ccy}/history": {
   "get": {
    "summary": "Recorded rates per exchange",
    "parameters": [
     {
      "name": "ccy",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "ARS",
        "AUD",
        "BRL",
        "CAD",
        "CHF",
        "COP",
        "EUR",
        "GBP",
        "GHS",
        "IDR",
        "KES",
        "NGN",
        "PHP",
        "XOF",
        "ZAR"
       ]
      },
      "description": "3-letter currency code"
     },
     {
      "name": "hours",
      "in": "query",
      "schema": {
       "type": "number",
       "maximum": 168,
       "default": 24
      }
     },
     {
      "name": "size",
      "in": "query",
      "schema": {
       "type": "number",
       "enum": [
        100,
        1000,
        10000
       ]
      }
     }
    ],
    "x-payment-info": {
     "protocols": [
      "x402"
     ],
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.01"
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "example": {
         "ccy": "NGN",
         "points": [
          {
           "ts": "2026-11-06T09:35:00Z",
           "ccy": "NGN",
           "size": 1000,
           "chain": "celo",
           "coin": "cNGN",
           "venue": "textile",
           "oracle": 1346.6,
           "buy": 1376.72,
           "sell": 1377.28
          }
         ]
        }
       }
      }
     },
     "402": {
      "description": "Payment required: x402, USDC on Base (PAYMENT-REQUIRED header; v1 challenge in the body)"
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "apiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "x-api-key",
    "description": "for customers on a key instead of paying per call"
   }
  }
 }
}