What You’ll Learn
By the end of this guide, you’ll understand how to:- Fetch real-time market data from multiple protocols
- Identify available actions in the API response
- Use Blinks to execute transactions
- Track positions across protocols
Getting Real-Time Market Data
The Markets API aggregates real-time market data from multiple protocols and returns it in a detailed, unified data format.Fetching Market Data
In our example, we will focus on data from the Kamino lending market. You can find the full API reference for the Markets API here.Please note that the
pk_demo key is for testing purposes only! Request your production API key by getting in touch with us.Understanding Market Data
The API returns detailed market information including rates, liquidity, rewards, and available actions. You can see the full response for this market in the accordion below.View Complete Response Example
View Complete Response Example
Market Identity
Each market is uniquely identified by its protocol, type, and token:id: Unique identifier combining protocol, market type, and addresstype: Market category, e.g.yieldfor lend,lendingfor borrow etc.provider: Protocol information for branding in your UItoken: Token information for use in your applicationwebsiteUrl: Direct link to the market on the protocol’s website
Understanding Earnings
The earnings structure shows the current and historical market rates including rewards.depositApy: Total yield you earn (base rate + all rewards combined)baseDepositApy: The protocol’s base lending ratebaseDepositApy30d/90d/180d: Historical APY averages over different time periodsrewards: Additional earnings from rewards on top of the base rate
Markets can offer multiple reward tokens. See the Rewards Guide for detailed examples.
Market Liquidity
Market size indicators help you understand liquidity and stability:totalDeposit: Total tokens deposited (in token’s native units)totalDepositUsd: Total value in USD
Available Actions
Each market includes a set of actions that can be executed on the market. A more detailed explanation of the actions is provided in the next section.Additional Data
Based on the market, this field can be empty or contain protocol-specific data:Taking Action on a Market
Theactions object contains blink URLs for each available operation. These URLs return ready-to-sign transactions, which eliminates the need for teams to integrate protocols through complex SDKs as well as the maintenance of these integrations.
From Markets to Transactions
Once you have a blink URL from the Markets API, you can use it to fetch and execute transactions. The process involves three steps:1
Fetch transaction
Send a
POST request with user’s wallet address and the required parameters to receive a transaction from the API2
Update blockhash (recommended)
It’s recommended to update the blockhash of the transaction before signing it to ensure it remains valid
3
Sign and send transaction
Sign the transaction with any Solana wallet and broadcast it to the network
Integration Options
There are two ways to integrate blinks into your application. Please follow the links below for hands-on code examples:Programmatic (Headless)
Full control over the user experience. Ideal for custom UIs and AI agents.
UI Components
Drop-in components with automatic rendering and state management of blinks.
Tracking Positions Across Protocols
After executing transactions, track user positions across all protocols:Please note that the
pk_demo key is for testing purposes only! Request your production API key by getting in touch with us.- Current balance and USD value
- Accumulated yield
- Health factor for leveraged positions
- Available actions
- etc.
List Positions by Wallet
Get all positions for a wallet address across supported protocols
Historical Position Data
Track position growth and portfolio analytics over time