Api Endpoint

quant-defi

DeFi math helper: APR and APY conversion, funding annualization, impermanent loss, liquidation price, and leverage. Pure computation over your inputs.

Open interactive test console

Offering

Provider
payai.agentstools.dev
Method
GET
Offering type
Api Endpoint
Transport type
http
Category
Blockchain And Crypto
Delivery
Not provided
Pricing model
Not provided
x402 version
2

Endpoint context

URL
https://payai.agentstools.dev/quant/defi
MIME type
application/json
First seen
2026-10-16T02:00:30.940Z
Last seen
Tags
quant, DeFi, APY, impermanent-loss, liquidation, Funding, leverage

Payment pricing

x402 payment terms are the authoritative price for calling this endpoint.

Payment option 1
0.002 USDC
Atomic price: 2000 · Network: eip155:8453 · Asset: USDC · Scheme: exact
Payment option 2
0.002 USDC
Atomic price: 2000 · Network: solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp · Asset: USDC · Scheme: exact
Raw x402 terms
[
  {
    "scheme": "exact",
    "network": "eip155:8453",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "amount": "2000",
    "payTo": "0xF22e558a00D91Ee12A1F50C52186FecB8dDFf493"
  },
  {
    "scheme": "exact",
    "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
    "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "amount": "2000",
    "payTo": "AytHnvc6bZx1ALTy7b5Px7hcavoSYszG9aeKvDcZ8R1u"
  }
]

Observed health

Status
Healthy
Latest latency
379 ms
Average latency
490 ms
HTTP status
402
Last checked
Reachability
100% over 18 checks

Latency is measured to the first response headers. A reachable result does not verify response accuracy or merchant identity.

Input schema

{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "const": "http"
    },
    "method": {
      "type": "string",
      "enum": [
        "GET",
        "HEAD",
        "DELETE"
      ]
    },
    "queryParams": {
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "apr_to_apy",
            "apy_to_apr",
            "funding_annualized",
            "impermanent_loss",
            "liquidation_price",
            "leverage",
            "lp_value"
          ],
          "description": "Which DeFi formula to evaluate"
        },
        "apr": {
          "type": "number",
          "description": "APR as a decimal for op=apr_to_apy"
        },
        "apy": {
          "type": "number",
          "description": "APY as a decimal for op=apy_to_apr"
        },
        "n": {
          "type": "number",
          "description": "Compounding periods per year for the rate conversions"
        },
        "rate": {
          "type": "number",
          "description": "Per-period funding rate for op=funding_annualized"
        },
        "periods_per_year": {
          "type": "number",
          "description": "Funding periods per year, default 1095"
        },
        "price_ratio": {
          "type": "number",
          "description": "Price ratio k for impermanent loss and LP value"
        },
        "entry_price": {
          "type": "number",
          "description": "Entry price for op=liquidation_price"
        },
        "leverage": {
          "type": "number",
          "description": "Leverage for op=liquidation_price and op=leverage"
        },
        "maintenance_margin": {
          "type": "number",
          "description": "Maintenance margin as a decimal, default 0.005"
        },
        "side": {
          "type": "string",
          "enum": [
            "long",
            "short"
          ],
          "description": "Position side for op=liquidation_price"
        },
        "notional": {
          "type": "number",
          "description": "Notional for op=leverage"
        },
        "equity": {
          "type": "number",
          "description": "Equity for op=leverage"
        },
        "initial_value": {
          "type": "number",
          "description": "Optional initial value for op=lp_value"
        }
      },
      "required": [
        "op"
      ]
    }
  },
  "required": [
    "type",
    "method"
  ],
  "additionalProperties": false
}

Output schema

{
  "type": "object",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "required": [
    "input"
  ],
  "properties": {
    "input": {
      "type": "object",
      "required": [
        "type",
        "method"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "http"
        },
        "method": {
          "enum": [
            "GET",
            "HEAD",
            "DELETE"
          ],
          "type": "string"
        },
        "queryParams": {
          "type": "object",
          "required": [
            "op"
          ],
          "properties": {
            "n": {
              "type": "number",
              "description": "Compounding periods per year for the rate conversions"
            },
            "op": {
              "enum": [
                "apr_to_apy",
                "apy_to_apr",
                "funding_annualized",
                "impermanent_loss",
                "liquidation_price",
                "leverage",
                "lp_value"
              ],
              "type": "string",
              "description": "Which DeFi formula to evaluate"
            },
            "apr": {
              "type": "number",
              "description": "APR as a decimal for op=apr_to_apy"
            },
            "apy": {
              "type": "number",
              "description": "APY as a decimal for op=apy_to_apr"
            },
            "rate": {
              "type": "number",
              "description": "Per-period funding rate for op=funding_annualized"
            },
            "side": {
              "enum": [
                "long",
                "short"
              ],
              "type": "string",
              "description": "Position side for op=liquidation_price"
            },
            "equity": {
              "type": "number",
              "description": "Equity for op=leverage"
            },
            "leverage": {
              "type": "number",
              "description": "Leverage for op=liquidation_price and op=leverage"
            },
            "notional": {
              "type": "number",
              "description": "Notional for op=leverage"
            },
            "entry_price": {
              "type": "number",
              "description": "Entry price for op=liquidation_price"
            },
            "price_ratio": {
              "type": "number",
              "description": "Price ratio k for impermanent loss and LP value"
            },
            "initial_value": {
              "type": "number",
              "description": "Optional initial value for op=lp_value"
            },
            "periods_per_year": {
              "type": "number",
              "description": "Funding periods per year, default 1095"
            },
            "maintenance_margin": {
              "type": "number",
              "description": "Maintenance margin as a decimal, default 0.005"
            }
          }
        }
      },
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string"
        },
        "example": {
          "type": "object"
        }
      }
    }
  }
}