Skip to main content
For AI-friendly documentation, see Para llms.txt and Compass llms.txt.
If you’re using Para for embedded wallets, you can now add yield, lending, borrowing, and portfolio management to your app using the Compass API. Your users get a full DeFi experience without ever managing approvals or interacting with protocols directly.

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

  1. 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.
  2. Crypto-Backed Credit Line — Users borrow USDC against ETH collateral. Display health factor and liquidation risk. Users never interact with Aave directly.
  3. Auto-Rebalancing Portfolio — Monitor rates and rebalance atomically when better opportunities emerge. One signature moves $50K from Aave (4.8%) to Morpho (6.2%).
Want to see what you’d be building? Try Compass Studio — a visual interface for Earn, Credit, and Portfolio products. Explore vaults, simulate transactions, and copy working configurations into your app.

What You Need

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.
You can also sponsor gas through Account Abstraction integrations like Alchemy, Pimlico, or ZeroDev instead of running your own sponsor wallet.

Step-by-Step Integration

Step 1: Install the Compass SDK

Add the Compass TypeScript SDK alongside your existing Para setup. Para’s ParaProvider already includes wagmi — the useSignTypedData hook used for EIP-712 signing is available out of the box.
Add these server-side environment variables:

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.

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’s useSignTypedData (sign), and your backend submits the signed payload through your gas sponsor (execute).
All amounts in the Compass API are in human-readable units (e.g., "100" means 100 USDC), not in base units or wei.
Every Compass operation — deposit, withdraw, swap, borrow, repay, bundle — follows this same three-step pattern. Only the SDK call in the Prepare step changes. The Execute route is reused by all operations.
Before your first gas-sponsored transfer, each token needs a one-time Permit2 approval. Without it, earnTransfer and creditTransfer will return an “Insufficient allowance” error.
The frontend signing and execution flow is identical — use the same signTypedDataAsync and /api/execute calls shown above.
Some tokens like USDT and WETH don’t support EIP-2612 permits. For those, set gasSponsorship: false in the approve call — the user signs and pays gas for the one-time approval directly.

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 return SafeTx types (normalize with EIP712Domain + SafeTx), unlike transfers which use PermitTransferFrom. The backend returns primaryType so the frontend handles both automatically.

Deposit into a Vault

Withdraw with Fee

Check Positions

Querying Data

All read endpoints are free, require no signing, and return instantly. Use these to populate your UI with available markets and rates.
See the full Compass API reference for all available endpoints.

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