AGENT SKILL

0xklen-price-a-priority-tip-for-inclusion

暂无简介

License 许可
MIT
最近更新
2026-11-15
Stars
★ 81
Forks
17

02 资源文件 3

03 SKILL.md 正文

Price a priority tip for inclusion

The tip is what actually buys inclusion — base fee is burned and only proves you are solvent — so the correct tip is the smallest value above the block's observed clearing tip for the share of gas you are willing to occupy.

Procedure

  1. Predict next-block base fee rather than reading the current one. EIP-1559 moves base fee by at most 12.5% per block, so a block that is running hot means the next base fee is higher:

    cast block latest --rpc-url $RPC --field baseFeePerGas
    cast block latest --rpc-url $RPC --field gasUsed
    

    If gasUsed == gasLimit, the next base fee is base * 1.125. Use that as the floor, not the current value.

  2. Read the clearing tip from the last 10 blocks by looking at the effective priority fee of transactions that occupy similar gas:

    cast block <N> --rpc-url $RPC --field transactions --json | \
      jq '[.[] | .maxPriorityFeePerGas] | sort | .[length*0.5|floor]'
    
  3. Target a percentile, not the mean. To reliably beat other bidders for the same block, price at roughly the 70th–80th percentile of observed tips; the mean is dragged down by many low-tip inclusions that are cheaper than yours cannot be.

  4. Add an escalator only if latency is your real constraint: a generous maxPriorityFeePerGas with a tight maxFeePerGas lets you bid high without the base-fee risk of a runaway total.

  5. Sanity-check the total cost against the value of the transaction. If the tip plus base fee approaches the profit, lower the tip and accept a later block rather than paying for the current one.

  6. On L2s, replace this entirely: sequencers usually run first-come-first-served or a fixed priority, so a huge tip buys nothing and burns L2 gas. Check the chain's fee model before applying mainnet logic.

  7. After inclusion, compare the paid effective tip to the block's clearing tip; a persistent gap above 30% means your estimator is stale.

Pitfalls

  • Using the mean tip. It is pulled down by many small, cheap inclusions and systematically underprices a competitive block.
  • Setting maxFeePerGas equal to base * 1.125 exactly. One hotter block and the transaction is stuck, because a growing base fee can exceed it.
  • Ignoring gas share. A transaction that consumes 5M of a 30M block competes for a scarce resource and needs a higher tip than a 21k transfer.
  • Treating a private relay bid as a tip. When routing through a bundle, the bid is the whole payment; the tip field is mostly a formatting detail.

Verification

cast block latest --rpc-url $RPC --field baseFeePerGas && cast block latest --rpc-url $RPC --field gasUsed

Compute the predicted next base fee and confirm the submitted maxFeePerGas clears it with margin, while maxPriorityFeePerGas sits above the recent median. Report predicted base fee, chosen tip, and inclusion block.

04 同仓库更多 Skills

jiayaoqijia
jiayaoqijia/cryptoskill

troves

Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say "Troves" explicitly.

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

trade

Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

staking

Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

send

Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

portfolio

View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks "what do I have", "show me everything", "how much am I worth", "my positions", "my investments", "rebalance my portfolio", "I want 50% ETH", "optimize my holdings", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say "portfolio".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

multi-swap

Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.

★ 81