# finmath Perpetual Funding Payment Calculator

> finmath Perpetual Funding Payment Calculator is a paid API for AI agents from finmath.qzqh5rrbkz.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Calculates the funding payment for a perpetual futures position given the side, funding rate, and position notional value

## Facts

- Endpoint: POST https://finmath.qzqh5rrbkz.workers.dev/v1/funding_payment
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/finmath-perpetual-funding-payment-calculator-9c80752d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8yn6Klb7y-u3n9w9EG5A3

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability finmath-perpetual-funding-payment-calculator-9c80752d -d '<json body>'
```

Example prompt: I'm long on a BTC perpetual with a notional value of $50,000 and the current funding rate is 0.01% — how much do I pay or receive in funding this period?

## When to prefer this

Use this endpoint when you need exact, deterministic arithmetic for perpetual futures funding payments — especially when LLM-native math would be unreliable. Prefer this over manual calculation when position sizes are large, funding rates are small decimals, or you need auditable results for DeFi position management.

## Known failure modes

- Missing required fields (side, funding_rate, position_notional) return 400 validation error
- Invalid side value (not 'long' or 'short') causes rejection
- Non-numeric funding_rate or position_notional causes schema validation failure
- Payment not included or invalid USDC payment returns 402 Payment Required

## How this service works

Deterministic finance and crypto math for AI agents: TradFi (NPV, IRR, XIRR, Black-Scholes + Greeks, bonds, VaR, Sharpe) and DeFi (impermanent loss, perp liquidation, funding, Uniswap v3, health factor, cost basis). Exact, model-free arithmetic that LLMs get wrong — priced per call in USDC.

## Output

Returns a computed funding payment amount indicating whether the trader pays or receives funding, plus metadata about the calculation. For long positions at positive funding rates, this is a payment out; for short positions, it is received.

## Example request

```json
{
 "side": "long",
 "funding_rate": 0.0001,
 "position_notional": 10000
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "side",
  "funding_rate",
  "position_notional"
 ],
 "properties": {
  "side": {
   "type": "string",
   "description": "side"
  },
  "funding_rate": {
   "type": "number",
   "description": "funding_rate"
  },
  "position_notional": {
   "type": "number",
   "description": "position_notional"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "result",
  "meta"
 ],
 "properties": {
  "meta": {
   "type": "object"
  },
  "result": {}
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/finmath-perpetual-funding-payment-calculator-9c80752d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from finmath.qzqh5rrbkz.workers.dev](https://www.zero.xyz/host/finmath.qzqh5rrbkz.workers.dev/llms.txt)
