Getting rebalance opportunities
Expected response
Getting rebalance opportunities
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Using this endpoint, you can retrieve rebalance opportunities for a given position. It returns all tokens that offer better yields across different protocols, based on a comparison of higher APY values. The protocols used are considered highly trusted and belong to main markets, meaning all of them are audited and secure. Therefore, the purpose of rebalancing is not to find safer or more stable protocols, but rather to identify higher yield opportunities. This endpoint can be used to build notifications or UX/UI features that alert users whose positions are underperforming, enabling them to rebalance their positions more efficiently.
GET /yield/rebalance-opportunities
Getting rebalance opportunities
curl --request GET \
--url https://api.starkfi.io/yield/rebalance-opportunities \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api_key>' \
{
"statusCode": 200,
"success": true,
"status": "get_rebalance_opportunities_ok",
"message": "Rebalance opportunities retrieved successfully",
"data": {
"opportunities": [
{
"token": {
"symbol": "SOL",
"mint": "So11111111111111111111111111111111111111112"
},
"route_winner": "SOL-KAMINO > SOL-JUPITER",
"winner": {
"provider": "kamino",
"protocol_display_name": "Kamino",
"strategy_id": "kamino:So11111111111111111111111111111111111111112:d4A2prbA2whesmvHaL88BH6Ewn5N4bTSU2Ze8P6Bc4Q",
"apy_percent": 5.1941
},
"alternatives": [
{
"provider": "jupiter_lend",
"protocol_display_name": "Jupiter Lend",
"strategy_id": "jupiter_lend:So11111111111111111111111111111111111111112:2uQsyo1fXXQkDtcpXnLofWy88PxcvnfH2L8FPSE62FVU",
"apy_percent": 4
}
],
"apy_spread_percent": 1.19
},
{
"token": {
"symbol": "USDC",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
},
"route_winner": "USDC-JUPITER > USDC-KAMINO",
"winner": {
"provider": "jupiter_lend",
"protocol_display_name": "Jupiter Lend",
"strategy_id": "jupiter_lend:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:9BEcn9aPEmhSPbPQeFGjidRiEKki46fVQDyPpSQXPA2D",
"apy_percent": 4.15
},
"alternatives": [
{
"provider": "kamino",
"protocol_display_name": "Kamino",
"strategy_id": "kamino:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59",
"apy_percent": 3.3912
}
],
"apy_spread_percent": 0.76
}
],
"sources": {
"jupiter_lend": {
"ok": true,
"message": "get_lending_markets_ok",
"count": 3
},
"kamino": {
"ok": true,
"message": "vaults_retrieved_successfully",
"count": 3
}
}
}
}
Getting rebalance opportunities
curl --request GET \
--url https://api.starkfi.io/yield/rebalance-opportunities/:asset_symbol \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api_key>' \
{
"statusCode": 200,
"success": true,
"status": "get_rebalance_opportunity_by_symbol_ok",
"message": "Rebalance opportunity retrieved successfully",
"data": {
"opportunities": [
{
"token": {
"symbol": "USDC",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
},
"route_winner": "USDC-JUPITER > USDC-KAMINO",
"winner": {
"provider": "jupiter_lend",
"protocol_display_name": "Jupiter Lend",
"strategy_id": "jupiter_lend:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:9BEcn9aPEmhSPbPQeFGjidRiEKki46fVQDyPpSQXPA2D",
"apy_percent": 4.15
},
"alternatives": [
{
"provider": "kamino",
"protocol_display_name": "Kamino",
"strategy_id": "kamino:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59",
"apy_percent": 3.3912
}
],
"apy_spread_percent": 0.76
}
],
"sources": {
"jupiter_lend": {
"ok": true,
"message": "get_lending_markets_ok",
"count": 3
},
"kamino": {
"ok": true,
"message": "vaults_retrieved_successfully",
"count": 3
}
}
}
}
.png?fit=max&auto=format&n=I_v6ul4JDafNKFQP&q=85&s=f0ad25536f8a3ca42331fcff88ab2b26)