{
  "openapi": "3.1.0",
  "info": {
    "title": "PipTradeDex",
    "version": "1.0.0",
    "description": "Private cross-chain trading data: live market snapshots, private route checks and confidential settlement quotes across 34 networks."
  },
  "servers": [
    {
      "url": "https://piptradedex.xyz"
    }
  ],
  "paths": {
    "/markets": {
      "post": {
        "operationId": "markets",
        "summary": "Live market snapshot: price, 24h change, volume, high and low, trade count and FDV for any asset PipTradeDex tracks, with a short read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "markdown": {
                      "type": "string",
                      "contentMediaType": "text/markdown"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ok"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment required — the body carries an x402 accepts[] envelope (scheme \"exact\", network sui). Sign it and retry with the X-PAYMENT header."
          },
          "422": {
            "description": "Invalid request body — never charged"
          }
        },
        "x-payment-info": {
          "pricingMode": "fixed",
          "price": "0.02",
          "currency": "USDC",
          "protocols": [
            "mpp",
            "x402"
          ],
          "x402": {
            "scheme": "exact",
            "network": "sui:mainnet",
            "asset": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
            "payTo": "0xc6f8af4273cd8ba687d65b773e79e4f110ae0859b59c9449758d6831748fda74"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "asset": {
                    "type": "string",
                    "description": "ticker or contract address"
                  }
                },
                "required": [
                  "asset"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/route-check": {
      "post": {
        "operationId": "route_check",
        "summary": "Private route availability: a yes or no on whether a trade of this size settles privately between two chains, with the network and any size floor.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "markdown": {
                      "type": "string",
                      "contentMediaType": "text/markdown"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ok"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment required — the body carries an x402 accepts[] envelope (scheme \"exact\", network sui). Sign it and retry with the X-PAYMENT header."
          },
          "422": {
            "description": "Invalid request body — never charged"
          }
        },
        "x-payment-info": {
          "pricingMode": "fixed",
          "price": "0.05",
          "currency": "USDC",
          "protocols": [
            "mpp",
            "x402"
          ],
          "x402": {
            "scheme": "exact",
            "network": "sui:mainnet",
            "asset": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
            "payTo": "0xc6f8af4273cd8ba687d65b773e79e4f110ae0859b59c9449758d6831748fda74"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "asset": {
                    "type": "string",
                    "description": "ticker or contract address"
                  },
                  "size_usd": {
                    "type": "string",
                    "description": "trade size in USD"
                  },
                  "from_chain": {
                    "type": "string",
                    "description": "source chain"
                  },
                  "to_chain": {
                    "type": "string",
                    "description": "destination chain"
                  }
                },
                "required": [
                  "asset",
                  "size_usd",
                  "from_chain",
                  "to_chain"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/sui-quote": {
      "post": {
        "operationId": "sui_quote",
        "summary": "Private Sui settlement quote: rate, amounts, all-in cost and settlement time for a swap with a Sui leg.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "markdown": {
                      "type": "string",
                      "contentMediaType": "text/markdown"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ok"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment required — the body carries an x402 accepts[] envelope (scheme \"exact\", network sui). Sign it and retry with the X-PAYMENT header."
          },
          "422": {
            "description": "Invalid request body — never charged"
          }
        },
        "x-payment-info": {
          "pricingMode": "fixed",
          "price": "0.05",
          "currency": "USDC",
          "protocols": [
            "mpp",
            "x402"
          ],
          "x402": {
            "scheme": "exact",
            "network": "sui:mainnet",
            "asset": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
            "payTo": "0xc6f8af4273cd8ba687d65b773e79e4f110ae0859b59c9449758d6831748fda74"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pair": {
                    "type": "string",
                    "description": "asset pair, for example \"USDC on Base to SUI\""
                  },
                  "size_usd": {
                    "type": "string",
                    "description": "trade size in USD"
                  }
                },
                "required": [
                  "pair",
                  "size_usd"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/xlayer-quote": {
      "post": {
        "operationId": "xlayer_quote",
        "summary": "Private X Layer settlement quote: rate, amounts, all-in cost and settlement time for a swap with an X Layer leg.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "markdown": {
                      "type": "string",
                      "contentMediaType": "text/markdown"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ok"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment required — the body carries an x402 accepts[] envelope (scheme \"exact\", network sui). Sign it and retry with the X-PAYMENT header."
          },
          "422": {
            "description": "Invalid request body — never charged"
          }
        },
        "x-payment-info": {
          "pricingMode": "fixed",
          "price": "0.05",
          "currency": "USDC",
          "protocols": [
            "mpp",
            "x402"
          ],
          "x402": {
            "scheme": "exact",
            "network": "sui:mainnet",
            "asset": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
            "payTo": "0xc6f8af4273cd8ba687d65b773e79e4f110ae0859b59c9449758d6831748fda74"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pair": {
                    "type": "string",
                    "description": "asset pair, for example \"USDC to OKB\""
                  },
                  "size_usd": {
                    "type": "string",
                    "description": "trade size in USD"
                  }
                },
                "required": [
                  "pair",
                  "size_usd"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/health": {
      "post": {
        "operationId": "health",
        "summary": "Liveness.",
        "responses": {
          "200": {
            "description": "Success"
          },
          "422": {
            "description": "Invalid request body — never charged"
          }
        }
      }
    }
  }
}