Skip to content

feat: add SBOR action provider for benchmark lending rates - #1519

Open
sbor-index wants to merge 4 commits into
coinbase:mainfrom
sbor-index:main
Open

sbor-index wants to merge 4 commits into
coinbase:mainfrom
sbor-index:main

Conversation

@sbor-index

Copy link
Copy Markdown

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 fixing
  • compare_rate_to_sbor: the difference in basis points, a verdict, and stopAndAskHuman when 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 day
  • list_sbor_markets: the markets behind a benchmark, with utilization and depth

It needs no key and no wallet, and never builds or sends a transaction; supportsNetwork returns true. Venue and asset names from the API pass through sanitizeOnchainMetadata. 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 test in typescript/agentkit passes 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:

compare_rate_to_sbor { rate: 5.5, side: "borrow", benchmark: "BTC-COLLATERAL-USDC" }

{
  "benchmarkRate": 4.79,
  "differenceBps": 71,
  "verdict": "above",
  "stopAndAskHuman": true,
  "guidance": "The offer is 71 basis points above the benchmark, more than 50. Stop and ask a human before borrowing.",
  "bestMarket": { "venue": "Morpho on Base", "asset": "cbBTC/USDC", "rate": 4.71, "utilization": 87.48 }
}

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

  • Added documentation to all relevant README.md files
  • Added a changelog entry

@cb-heimdall

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@github-actions github-actions Bot added documentation Improvements or additions to documentation action provider New action provider typescript labels Sep 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action provider New action provider documentation Improvements or additions to documentation typescript

Development

Successfully merging this pull request may close these issues.

2 participants