{"name":"fee","oldName":"fee_advice","title":"What fee to pay","category":"network","useWhen":"Run before setting a priority fee. Gives the price in the exact unit Compute Budget expects (micro-lamports per compute unit) and the total cost 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 recent on-chain priority fees into three prices: cheap, normal and fast. Pass your transaction to get its compute limit and exact cost at each price.","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":"Optional. Your transaction, so fees are measured on the accounts it writes to and compute is measured by a dry run.","whereToGet":"From your wallet SDK before signing: Buffer.from(tx.serialize({ requireAllSignatures: false })).toString('base64'). Or the swap transaction an aggregator API gave you."},{"name":"network","type":"\"mainnet-beta\" | \"devnet\"","required":false,"lookingFor":"Which Solana network to read. Default \"mainnet-beta\" (real money).","whereToGet":"Leave it out for mainnet. Use \"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":"Which fees were sampled: the accounts your transaction writes to, or the whole network.","howWorkedOut":"Your transaction's writable accounts when given, otherwise network-wide."},{"field":"samples / share_paying","type":"number","is":"How many recent slots were sampled, and the share that paid any priority fee.","howWorkedOut":"getRecentPrioritizationFees (about the last 150 slots)."},{"field":"prices.cheap / normal / fast .compute_unit_price","type":"number","is":"The price to set with setComputeUnitPrice. cheap usually lands within a few slots when it's quiet. fast is for urgent trades.","howWorkedOut":"The 50th, 75th and 90th percentile of sampled fees (at least 1 for normal and fast when everything sampled is zero)."},{"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.","howWorkedOut":"Built from the normal price and compute_units."}],"notes":[],"inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tx":{"type":"string","minLength":20},"network":{"default":"mainnet-beta","type":"string","enum":["mainnet-beta","devnet"]}}}}