feat: add SBOR action provider for benchmark lending rates - #1519
Open
sbor-index wants to merge 4 commits into
Open
sbor-index wants to merge 4 commits into
sbor-index wants to merge 4 commits into
Conversation
🟡 Heimdall Review Status
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the SBOR action provider: a read-only benchmark of lending rates, so an agent can check an offered rate against the market before it borrows.
SBOR reads lending contract state and publishes once a day: the SBOR indices, one borrow and one supply rate per currency on Stacks, and
BTC-COLLATERAL-USDC, the cost of borrowing USDC against cbBTC and WBTC on the Morpho markets on Base and Ethereum.Actions:
get_sbor_rate: current rates, with the age of the fixingcompare_rate_to_sbor: the difference in basis points, a verdict, andstopAndAskHumanwhen a borrow is more than 50 basis points above the benchmark. No verdict on data older than 48 hours, or on a benchmark not published that daylist_sbor_markets: the markets behind a benchmark, with utilization and depthIt needs no key and no wallet, and never builds or sends a transaction;
supportsNetworkreturns true. Venue and asset names from the API pass throughsanitizeOnchainMetadata. Modeled on the DefiLlama provider.Tests
21 unit tests in
sborActionProvider.test.ts, covering stale data, unpublished benchmarks, the stop threshold, units, API errors and sanitization.pnpm testintypescript/agentkitpasses all 924 tests. Lint, format and type checks are clean for the changed files.Direct call against the live SBOR fixing of 25 September 2026:
Not yet run in the example chatbots, which need CDP and model API keys. The same comparison logic runs in SBOR's MCP server (
xyz.sbor/sbor), tested end to end as a Claude connector.Checklist