{"name":"fee","oldName":"fee_advice","title":"What fee to pay","category":"network","useWhen":"Run before setting a priority fee. Gives the price in the unit Compute Budget expects (micro-lamports per compute unit) and the total in SOL, so a unit mix-up never overpays.","benefit":{"kind":"money","text":"Prices are in micro-lamports per compute unit, the unit setComputeUnitPrice takes. Mixing that up with lamports overpays a million times."},"description":"Turns what recent transactions paid for priority into three prices: cheap, normal, fast. Pass your transaction to get its compute limit and exact cost at each.","price":"$0.01","priceText":"25 free calls a day, then $0.01 USDC per call (x402)","http":{"method":"POST","path":"/api/tools/fee","body":"JSON object with the inputs below"},"mcp":{"method":"tools/call","name":"fee"},"inputs":[{"name":"tx","type":"string (base64)","required":false,"lookingFor":"Your transaction, so fees match its accounts and compute comes from a dry run.","whereToGet":"Before signing: Buffer.from(tx.serialize({ requireAllSignatures: false })).toString('base64'), or an aggregator's swap tx."},{"name":"network","type":"\"mainnet-beta\" | \"devnet\"","required":false,"lookingFor":"Default \"mainnet-beta\" (real money).","whereToGet":"\"devnet\" only for test wallets."}],"outputs":[{"field":"unit","type":"string","is":"Always \"micro-lamports per compute unit\". 1,000,000 micro-lamports = 1 lamport. It is the unit setComputeUnitPrice takes.","howWorkedOut":"Fixed."},{"field":"based_on","type":"string","is":"What the prices come from: the transactions in the latest blocks, plus your transaction's writable accounts when given.","howWorkedOut":"The blocks read (slots listed); with a transaction, also getRecentPrioritizationFees on its writable accounts."},{"field":"samples / share_paying","type":"number","is":"How many recent transactions were sampled, and the share of them that paid any priority fee.","howWorkedOut":"Every non-vote transaction in the latest 2 readable blocks (getBlock, version 1 included)."},{"field":"prices.cheap / normal / fast .compute_unit_price","type":"number","is":"The price to set with setComputeUnitPrice. cheap is what half of recent transactions paid or more; fast is for urgent trades.","howWorkedOut":"The 50th, 75th and 90th percentile of what those transactions paid per compute unit (a v1 transaction's lamport total over its compute limit). With a transaction, each is raised to the same percentile of the lowest fees that landed on its accounts, if that is higher."},{"field":"prices.*.priority_lamports / total_lamports / total_sol","type":"string","is":"What the transaction would pay at that price.","howWorkedOut":"priority = price x compute units / 1,000,000, rounded up. total = priority + 5000 lamports per signature."},{"field":"compute_units","type":"number","is":"The compute units the costs are worked out for.","howWorkedOut":"With a transaction: dry-run units used + 10%. Without: 200,000 (a typical one-step default)."},{"field":"compute_units_from","type":"string","is":"Whether compute_units came from a dry run or the default.","howWorkedOut":"\"simulation\" or \"default\"."},{"field":"how_to_use","type":"string","is":"The two Compute Budget steps to add (for a v1 transaction, the two config fields to set).","howWorkedOut":"Built from the normal price and compute_units."}],"notes":[],"inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tx":{"description":"Your transaction, so fees match its accounts and compute comes from a dry run. Before signing: Buffer.from(tx.serialize({ requireAllSignatures: false })).toString('base64'), or an aggregator's swap tx.","type":"string","minLength":20},"network":{"default":"mainnet-beta","description":"Default \"mainnet-beta\" (real money). \"devnet\" only for test wallets.","type":"string","enum":["mainnet-beta","devnet"]}}}}