{"uid":"cap_j55T3RQXSax_SEXllgj9k","slug":"pnl-after-fees-50b84183","name":"PnL After Fees","description":"Net PnL after entry and exit fee rates on a sized position. Call when realistic fill accounting when fees matter to edge. Returns net pnl after fees as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.","url":"https://api.delx.ai/api/v1/x402/pnl-with-fees","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"exit":{"type":"integer","description":"Input field: exit."},"size":{"type":"integer","description":"Input field: size."},"entry":{"type":"integer","description":"Input field: entry."},"fee_rate":{"type":"number","description":"Input field: fee rate."}}},"responseSchema":{"type":"json","example":{"fees":0.21,"schema":"delx/util-pnl-with-fees/v1","net_pnl":9.79,"gross_pnl":10}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_BeL4xn7_6qTT21-8QM5Zj","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates net profit and loss on a sized position after applying entry and exit fee rates, returning a deterministic JSON result.","exampleAgentPrompt":"What's my net PnL after fees on a 500-unit position entered at 42000 and exited at 43500, with a fee rate of 0.001 on both sides?","exampleUseCases":[{"title":"Check edge viability after round-trip fees","prompt":"I'm thinking about entering 1000 units at 100 and exiting at 102 with a fee rate of 0.002 — what's my actual net PnL after paying fees on both legs?"},{"title":"Verify trade profitability for algo strategy","prompt":"My algo bot entered a 250-unit position at 3800 and is targeting an exit at 3850 with a 0.0015 fee rate — can you tell me the net profit after fees so I know if the edge holds?"},{"title":"Compare gross vs net returns for trading journal","prompt":"I closed a 750-unit position, entry was 1200 and exit was 1185, fee rate was 0.001 — what's my net PnL after fees so I can log the real result?"}],"resultDescription":"Returns a deterministic JSON object containing the net PnL value after subtracting entry and exit fees from the gross profit or loss on the sized position. The result is advisory only and computed using local math with no live market data.","failureModes":["Missing required fields (entry, exit, size, fee_rate) result in an error response","Non-numeric or invalid values for price or size fields may cause computation failure","Negative size or fee_rate values may produce unexpected results","Payment failure (insufficient USDC) blocks the request before computation"],"whenToPreferThis":"Use this endpoint when you need a quick, deterministic, fee-adjusted PnL calculation for a known position size, entry, and exit price without needing live market data, external APIs, or complex infrastructure. Ideal for trading bots, algo strategy validation, and journaling tools where accurate fee accounting matters to edge evaluation.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T01:19:00.802Z","isFirstParty":false}