Fastest path: AI assistants
Paste this into any AI coding agent — Claude Code, Cursor, Windsurf, ChatGPT, or anything that can fetch a URL:Fetch https://compasslabs.ai/llms-widgets.md and integrate Compass widgets into this project.The agent will pull the full integration guide, install dependencies, generate the provider/server/widget files, and wire up your env. Claude Code users can install the slash command for repeat use:
/integrate-compass-widgets.
How it works
- User connects their wallet
- Widget shows yield opportunities (Aave, Morpho vaults, Pendle, credit, rebalancing)
- User picks a market, enters an amount, signs an EIP-712 transaction
- Your server relays the signed transaction to Compass; gas can be sponsored
- Each user gets a non-custodial product account — they sign every transaction themselves
Installation
Quick start
Three steps: wrap with providers, add a server route, drop in a widget.1. Providers
2. Server route
Using NestJS?
Using NestJS?
CompassModule.registerAsync() is also available if you need to inject config from another module (e.g. ConfigService). Routes are served at /api/compass/* — no global prefix needed.3. Add a widget
Available widgets
| Widget | What it does |
|---|---|
EarnAccount | Banking-style savings account — variable (Aave, Morpho) + fixed (Pendle) markets, deposit/withdraw, P&L |
CompassEarnWidget | Unified earn interface combining variable and fixed markets |
CreditAccount | Credit borrowing UI on top of an earn position |
RebalancingWidget | Automated portfolio rebalancing across positions |
TraditionalInvestingWidget | Tokenized stocks interface |
Building custom UIs
Prefer to compose your own layout? The SDK exports building blocks:- Shared components —
ChainSwitcher,WalletStatus,EarnAccountGuard,CreditAccountGuard,EarnAccountBalance,AccountBalancesModal,DepositWithdrawForm,SwapForm,PnLSummary,TransactionHistory,CopyableAddress,ActionModal - Data hooks —
useSwapQuote,useRebalancingData,useRefreshBalances - Context hooks —
useCompassWallet,useCompassChain,useCompassApi,useEarnAccount,useCreditAccount
Theming
Six built-in presets:compass-dark, compass-light, minimal-dark, minimal-light, high-contrast-dark, high-contrast-light.
Theme type — your IDE will autocomplete every override.
Wallet adapter
CompassProvider needs a wallet prop bridging your wallet library to the widgets:
signTypedData is the critical one — every transaction is EIP-712 signed by the user, then your server relays it (and optionally sponsors gas).
Supported chains
ethereum, base, arbitrum.
Gas sponsorship
SetgasSponsorPrivateKey and rpcUrls on the server handler. Widgets automatically use sponsored transactions when configured. See Gas Sponsorship.
Next steps
LLM Integration Guide
Full reference for AI-assisted integration.
Earn
The underlying Yield API.
Fixed Earn
Add fixed-yield Pendle markets to your product.
Gas Sponsorship
Sponsor gas so users never need ETH.