{"uid":"cap_cDF1mraCxTn7uhPUAU856","slug":"average-entry-price-vwap-fill-calculator-2f628a7d","name":"Average Entry Price (VWAP Fill Calculator)","description":"Volume-weighted average entry across fill price/size pairs. Call when averaging multiple fills into one book cost basis. Returns average entry and total size 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/avg-entry","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"fills":{"type":"array","description":"Input field: fills."}}},"responseSchema":{"type":"json","example":{"fills":2,"schema":"delx/util-avg-entry/v1","avg_entry":11.5,"total_size":4}},"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_NyHvacC4urtcSaSPVoYUn","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":"Computes the volume-weighted average entry price across multiple trade fills, returning the blended cost basis and total position size.","exampleAgentPrompt":"I bought ETH in three separate fills — 1.5 ETH at $2,800, 2.0 ETH at $2,750, and 0.5 ETH at $2,900 — can you calculate my volume-weighted average entry price and total position size?","exampleUseCases":[{"title":"DCA position cost basis tracking","prompt":"I've been dollar-cost averaging into BTC over several trades: 0.1 BTC at $58,000, 0.15 BTC at $55,000, and 0.05 BTC at $62,000. What's my average entry price and how much BTC do I hold total?"},{"title":"Partial fill aggregation for order book","prompt":"My limit order was filled in four tranches — 500 shares at $42.10, 300 at $42.20, 200 at $42.05, and 1000 at $42.15. Can you work out my blended cost basis per share and total shares acquired?"},{"title":"Multi-leg options position averaging","prompt":"I legged into a position across three fills: 10 contracts at $1.25, 5 contracts at $1.40, and 15 contracts at $1.30. What is my volume-weighted average entry and total contract count?"}],"resultDescription":"Returns a deterministic JSON object containing the volume-weighted average entry price across all provided fills and the total aggregated position size, computed locally without any external data sources.","failureModes":["Empty fills array returns an error or undefined result","Fills with zero size cause division-by-zero or are rejected","Malformed fill objects missing price or size fields return validation errors","Non-numeric price or size values cause parsing failures"],"whenToPreferThis":"Use this endpoint when you need a fast, deterministic, cost-free (beyond $0.001 per call) computation of blended entry price from multiple fills without any external market data, RPC calls, or API keys. Ideal for agent workflows that track cost basis, reconcile partial fills, or need a single authoritative average entry price for risk or P&L calculations.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T07:08:07.043Z","isFirstParty":false}