{"openapi":"3.1.0","info":{"title":"SatoshifyDex Instant Match Public API","version":"1.0.0","description":"Public, read-only REST API enabling external platforms (wallets, fintechs, aggregators, merchants) to programmatically access Satoshify's decentralized fiat-to-USDT liquidity via the Automated Market Matching Engine (AMM-E). All settlements occur non-custodially on BNB Chain Mainnet (56) using TrustfyEscrowV3.","contact":{"name":"Satoshify Ecosystem Engineering","url":"https://satoshifydex.com/developers/api","email":"support@satoshifydex.com"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"}},"servers":[{"url":"https://satoshifydex.com","description":"Production Network (BNB Chain Mainnet 56)"}],"tags":[{"name":"Instant Match (AMM-E)","description":"Smart order routing quotes and market discovery"},{"name":"Settlement & Status","description":"Read-only verification of on-chain trade lifecycle"},{"name":"System & Health","description":"Node connectivity, block synchronization, and metadata"}],"paths":{"/api/v1/public/instant-match":{"get":{"tags":["System & Health"],"summary":"API Root & Discovery","description":"Returns service status, protocol addresses, and documentation links.","responses":{"200":{"description":"Service metadata and protocol topology"}}}},"/api/v1/public/instant-match/health":{"get":{"tags":["System & Health"],"summary":"Infrastructure Vitality & Chain Health","description":"Returns BSC node latency, indexer block height, and active offer metrics.","responses":{"200":{"description":"System health metrics"}}}},"/api/v1/public/instant-match/markets":{"get":{"tags":["Instant Match (AMM-E)"],"summary":"Market Liquidity & Supported Rails","description":"Returns live aggregated liquidity, best rates, and payment methods grouped by fiat currency.","responses":{"200":{"description":"Aggregated market depth and supported currencies"}}}},"/api/v1/public/instant-match/quote":{"post":{"tags":["Instant Match (AMM-E)"],"summary":"Request Algorithmic AMM-E Quote","description":"Evaluates active on-chain advertisements, runs multi-factor scoring (price, reputation, speed, capacity), and returns an optimal guaranteed quote with cryptographic proof token, deep link, and Web3 preflight payload.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["side","fiatCurrency"],"properties":{"side":{"type":"string","enum":["BUY","SELL"],"description":"BUY = User buys USDT with fiat; SELL = User sells USDT for fiat"},"fiatCurrency":{"type":"string","example":"USD","description":"3-letter ISO fiat currency code (e.g. USD, EUR, AED, GBP, TRY)"},"fiatAmount":{"type":"number","example":500,"description":"Exact amount in fiat currency"},"cryptoAmount":{"type":"number","example":500,"description":"Exact amount in USDT"},"paymentMethod":{"type":"string","example":"Bank Transfer","description":"Optional preferred payment rail"},"countryId":{"type":"string","example":"US","description":"Optional ISO country code"},"partnerId":{"type":"string","example":"wallet_trust_partner","description":"Optional partner ID for attribution"},"partnerAddress":{"type":"string","example":"0x71C6793F1e191963e6B0121F247c4b4a1b068888","description":"Optional BEP-20 wallet address for on-chain referral fee sharing (10% of protocol fees)"},"partnerRef":{"type":"string","example":"inv_982341","description":"Optional external order reference for reconciliation"}}}}}},"responses":{"200":{"description":"Optimal quote details with execution token and URLs"},"400":{"description":"Invalid request parameters"},"429":{"description":"Rate limit exceeded"}}}},"/api/v1/public/instant-match/preflight":{"post":{"tags":["Instant Match (AMM-E)"],"summary":"Generate Web3 Preflight Calldata","description":"Converts a signed quote token into non-custodial smart contract calldata, allowing Web3 wallets to invoke TrustfyEscrowV3.matchAndFund() directly with user signature.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["quoteToken"],"properties":{"quoteToken":{"type":"string","description":"Tamper-proof token returned by /quote"}}}}}},"responses":{"200":{"description":"Web3 preflight calldata and Permit2 parameters"},"400":{"description":"Invalid or expired quote token"}}}},"/api/v1/public/instant-match/order/{tradeId}":{"get":{"tags":["Settlement & Status"],"summary":"Read-Only Trade Status Verification","description":"Retrieves real-time settlement status, on-chain transaction hashes, and lifecycle state transitions for an executed trade.","parameters":[{"name":"tradeId","in":"path","required":true,"schema":{"type":"string"},"description":"UUID or tradeId of the match"}],"responses":{"200":{"description":"Trade status and on-chain confirmation details"},"404":{"description":"Trade not found"}}}}}}