16trust / 100

Perp Calculator

by Vextorium in Security & trust

x402 APIFailing, checked 4 h ago

Perpetual futures calculator (isolated margin): liquidation price and distance, notional and size, PnL at stop-loss and take-profit, reward/risk ratio, and position sizing to risk a fixed USD amount.

POST https://api.vextorium.com/v1/perp-calculator

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
0.0%
Response time
- typical, - slowest 5%
Last check
4 h ago: Amount "0.004" is not in atomic token units
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://api.vextorium.com/v1/perp-calculator" \
  -H "content-type: application/json" \
  -d '{"input":60000,"leverage":10,"margin":100,"side":"long","stop_loss":57000,"take_profit":66000}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.vextorium.com%2Fv1%2Fperp-calculator
const res = await pay("https://api.vextorium.com/v1/perp-calculator", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"input":60000,"leverage":10,"margin":100,"side":"long","stop_loss":57000,"take_profit":66000}),
});
console.log(await res.json());

Example input

{
  "input": 60000,
  "leverage": 10,
  "margin": 100,
  "side": "long",
  "stop_loss": 57000,
  "take_profit": 66000
}

Example output

{
  "amount": 0.01666667,
  "in_stop_loss": {
    "pnl": -50,
    "pnl_pct_of_margin": -50,
    "price": 57000
  },
  "in_take_profit": {
    "pnl": 100,
    "pnl_pct_of_margin": 100,
    "price": 66000
  },
  "input": 60000,
  "leverage": 10,
  "liquidation_distance_pct": 9.5477,
  "liquidation_price": 54271.35678392,
  "margin": 100,
  "note": "Isolated margin, no fees or funding. Each exchange rounds differently: use it as an estimate.",
  "notional": 1000,
  "reward_risk_ratio": 2,
  "side": "long"
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
4 h agoAmount "0.004" is not in atomic token units40281 ms$0.004
9 h agoAmount "0.004" is not in atomic token units40283 ms$0.004
13 h agoAmount "0.004" is not in atomic token units402107 ms$0.004
17 h agoAmount "0.004" is not in atomic token units40298 ms$0.004
21 h agoAmount "0.004" is not in atomic token units40286 ms$0.004
25 h agoAmount "0.004" is not in atomic token units40279 ms$0.004
29 h agoAmount "0.004" is not in atomic token units40274 ms$0.004
33 h agoAmount "0.004" is not in atomic token units40286 ms$0.004
37 h agoAmount "0.004" is not in atomic token units402222 ms$0.004
42 h agoAmount "0.004" is not in atomic token units40284 ms$0.004
45 h agoAmount "0.004" is not in atomic token units40277 ms$0.004
2 days agoAmount "0.004" is not in atomic token units40276 ms$0.004
2 days agoAmount "0.004" is not in atomic token units40284 ms$0.004
2 days agoAmount "0.004" is not in atomic token units402104 ms$0.004
3 days agoAmount "0.004" is not in atomic token units40293 ms$0.004