llm_advice your model can act on directly.
Paid endpoint. Pass your key in the
x-api-key header. See Get an API key.Why agents use this
- Fees move constantly. A static value is either wasteful or broken. There’s no correct hardcoded number.
- LLM-native output.
llm_adviceis a plain sentence like “Network is quiet, use low tier to save 60%.” Feed it straight into your prompt. - Three-tier structure matches user intent. “Get me in fast” (high), “reasonable” (medium), “I’m patient” (low). Match to user preference or agent urgency.
- Live congestion signal.
current_congestionis a stable classifier your bot can log and monitor over time.
Use cases
- Dynamic fee per trade. Loop your bot: call
optimal-fee, use the tier that matches urgency, submit. Typical savings: 30-50% versus a fixed conservative fee. - Time mints to congestion dips. Poll every minute; auto-mint the moment
current_congestionflips toLOW. - CI/monitoring alert. Slack notification when fees spike above a threshold so ops knows to pause automated batches.
- Per-user fee preference in a DEX UI. Show the three tiers with
descriptionandestimated_timefrom the response. Users pick, bot executes. - Fee attribution in analytics. Log the recommended tier at trade time so you can compare theoretical optimum versus what you actually paid.
Recipe: adaptive fee selection for a trading bot
adaptive-fee.ts