How It Works
Compass provides a non-custodial DeFi API — you call an endpoint, get back an unsigned payload, and the user signs it via their Para wallet. Users earn yield, borrow against crypto, or rebalance portfolios without touching a DeFi protocol. This walkthrough covers three products: Earn (deposit into Aave, Morpho, Pendle vaults), Credit (borrow stablecoins against collateral), and Portfolio Manager (atomic rebalancing across venues).Why Combine Para and Compass
Example Use Cases
- Yield Savings Account — Users deposit USDC and earn 4-8% APY across vaults. You embed a 10% performance fee on yield. Users see one balance, one APY.
- Crypto-Backed Credit Line — Users borrow USDC against ETH collateral. Display health factor and liquidation risk. Users never interact with Aave directly.
- Auto-Rebalancing Portfolio — Monitor rates and rebalance atomically when better opportunities emerge. One signature moves $50K from Aave (4.8%) to Morpho (6.2%).
What You Need
- A Para SDK setup with embedded wallets configured
- A Compass API key — get one free at compasslabs.ai
- Compass SDKs: TypeScript · Python — both fully typed with all endpoints
Gas Sponsorship (Recommended)
With gas sponsorship, your users never need ETH. You provide a gas sponsor wallet — a server-side private key funded with ETH on your target chain (Base, Ethereum, or Arbitrum). Your backend uses this wallet to pay gas and relay transactions on behalf of users. Compass returns EIP-712 typed data, the user signs it off-chain, and your sponsor wallet submits the transaction. Without gas sponsorship, Compass returns a standard unsigned transaction that the user signs and broadcasts directly from their Para wallet. The user pays their own gas, which requires them to hold ETH. This walkthrough uses gas sponsorship for all examples. See Compass Gas Sponsorship docs for more details.Step-by-Step Integration
Step 1: Install the Compass SDK
Add the Compass TypeScript SDK alongside your existing Para setup. Para’sParaProvider already includes wagmi — the useSignTypedData hook used for EIP-712 signing is available out of the box.
Step 2: Create a Product Account
Compass uses isolated on-chain accounts (Product Accounts) per product. Create a separate account for each product you plan to use — Earn, Credit, or both. Each account is a smart account controlled by the user’s wallet. Compass never holds custody — it orchestrates creation and transaction routing. Each account is deployed once per user. Calling the create endpoint again safely returns the existing address without a new transaction. Your gas sponsor deploys these accounts so the user never needs ETH.- Create Earn Account
- Create Credit Account
Step 3: Fund Your Account
Before depositing into a vault or borrowing, move tokens from the user’s wallet into their Product Account. This step teaches the three-step signing pattern that every gas-sponsored Compass operation follows. Your backend requests EIP-712 typed data from Compass (prepare), the Para wallet signs it via wagmi’suseSignTypedData (sign), and your backend submits the signed payload through your gas sponsor (execute).
- Backend — Prepare
- Backend — Execute
- Frontend
signTypedDataAsync and /api/execute calls shown above.
Product Operations
The signing pattern is identical across all products. Only the SDK call in the Prepare step changes — swap it in and use the same Execute route and frontend signing flow from Step 3. Product operations returnSafeTx types (normalize with EIP712Domain + SafeTx), unlike transfers which use PermitTransferFrom. The backend returns primaryType so the frontend handles both automatically.
Querying Data
All read endpoints are free, require no signing, and return instantly. Use these to populate your UI with available markets and rates.Related Resources
Compass Earn Docs
Vaults, APYs, and yield strategies across Morpho, Aave, and Pendle
Gas Sponsorship
Gasless transactions with EIP-712 signing and sponsor wallets
EIP-712 Typed Data Signing
Sign structured data using the EIP-712 standard with Para wallets