Jupiter Lend¶
| Field | Value |
|---|---|
| Module | almanak.connectors.jupiter_lend |
| Protocol kind | Lending |
| Aliases | N/A |
Supported Chains And Intents¶
| Chain | Family | Supported Intents |
|---|---|---|
| No strategy support declared | N/A | No strategy intents registered |
jupiter_lend
¶
Jupiter Lend Connector — EXPERIMENTAL / NOT PRODUCTION-READY.
The Solana lending compiler (compiler_solana.py) routes SUPPLY / BORROW /
REPAY / WITHDRAW intents to JupiterLendAdapter when protocol == "jupiter_lend",
but no demo, no incubating strategy, and no on-chain intent test exercises
this path. The folded compiler integration is unverified.
This connector is intentionally:
- Omitted from ConnectorRegistry (see deregistration block at end of file)
- Removed from almanak strat matrix (no longer added in
almanak/framework/cli/support_matrix.py)
- Removed from public docs (docs/api/connectors/ + mkdocs.yml nav)
See docs/internal/plans/connector-status-audit-2026-05-23.html for the
audit that flagged the lack of demo / intent-test coverage. Re-register only
once at least one on-chain Solana intent test exercises the full lending
lifecycle against a live Jupiter Lend vault.
JupiterLendAdapter
¶
Adapter for Jupiter Lend integration with the Intent system.
Converts lending intents (Supply, Borrow, Repay, Withdraw) into ActionBundles containing serialized Solana VersionedTransactions from Jupiter Lend's REST API.
Example
Initialize the Jupiter Lend adapter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
JupiterLendConfig
|
Jupiter Lend client configuration |
required |
token_resolver
|
TokenResolver | None
|
Optional TokenResolver instance |
None
|
compile_supply_intent
¶
Compile a SupplyIntent to an ActionBundle using Jupiter Lend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
intent
|
SupplyIntent
|
The SupplyIntent to compile |
required |
Returns:
| Type | Description |
|---|---|
ActionBundle
|
ActionBundle containing a serialized Solana transaction |
compile_borrow_intent
¶
Compile a BorrowIntent to an ActionBundle using Jupiter Lend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
intent
|
BorrowIntent
|
The BorrowIntent to compile |
required |
Returns:
| Type | Description |
|---|---|
ActionBundle
|
ActionBundle containing a serialized Solana transaction |
compile_repay_intent
¶
Compile a RepayIntent to an ActionBundle using Jupiter Lend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
intent
|
RepayIntent
|
The RepayIntent to compile |
required |
Returns:
| Type | Description |
|---|---|
ActionBundle
|
ActionBundle containing a serialized Solana transaction |
compile_withdraw_intent
¶
Compile a WithdrawIntent to an ActionBundle using Jupiter Lend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
intent
|
WithdrawIntent
|
The WithdrawIntent to compile |
required |
Returns:
| Type | Description |
|---|---|
ActionBundle
|
ActionBundle containing a serialized Solana transaction |
JupiterLendClient
¶
Client for interacting with the Jupiter Lend REST API.
This client provides methods for: - Listing lending vaults and their metrics - Building deposit, borrow, repay, and withdraw transactions
All transaction endpoints return base64-encoded unsigned VersionedTransactions. No authentication is required.
Example
Initialize the Jupiter Lend client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
JupiterLendConfig
|
Jupiter Lend client configuration |
required |
get_vaults
¶
List all available lending vaults.
Results are cached for 60 seconds to avoid redundant API calls during multi-intent compilation within a single strategy cycle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
force_refresh
|
bool
|
If True, bypass cache and fetch fresh data. |
False
|
Returns:
| Type | Description |
|---|---|
list[JupiterLendVault]
|
List of JupiterLendVault objects |
Raises:
| Type | Description |
|---|---|
JupiterLendAPIError
|
If the API request fails |
find_vault_by_token
¶
Find a vault by token symbol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token_symbol
|
str
|
Token symbol (e.g., "USDC", "SOL") |
required |
Returns:
| Type | Description |
|---|---|
JupiterLendVault | None
|
JupiterLendVault if found, None otherwise |
deposit
¶
Build a deposit (supply) transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vault
|
str
|
Vault address to deposit into |
required |
amount
|
str
|
Amount in token units (e.g., "100.5" for 100.5 USDC) |
required |
wallet
|
str | None
|
Wallet address (defaults to config wallet) |
None
|
Returns:
| Type | Description |
|---|---|
JupiterLendTransactionResponse
|
JupiterLendTransactionResponse with base64-encoded unsigned transaction |
Raises:
| Type | Description |
|---|---|
JupiterLendAPIError
|
If the API request fails |
borrow
¶
Build a borrow transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vault
|
str
|
Vault address to borrow from |
required |
amount
|
str
|
Amount in token units (e.g., "50.0" for 50 USDC) |
required |
wallet
|
str | None
|
Wallet address (defaults to config wallet) |
None
|
Returns:
| Type | Description |
|---|---|
JupiterLendTransactionResponse
|
JupiterLendTransactionResponse with base64-encoded unsigned transaction |
Raises:
| Type | Description |
|---|---|
JupiterLendAPIError
|
If the API request fails |
repay
¶
Build a repay transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vault
|
str
|
Vault address to repay into |
required |
amount
|
str
|
Amount in token units (e.g., "50.0" for 50 USDC) |
required |
wallet
|
str | None
|
Wallet address (defaults to config wallet) |
None
|
Returns:
| Type | Description |
|---|---|
JupiterLendTransactionResponse
|
JupiterLendTransactionResponse with base64-encoded unsigned transaction |
Raises:
| Type | Description |
|---|---|
JupiterLendAPIError
|
If the API request fails |
withdraw
¶
Build a withdraw transaction.
Use amount=U64_MAX ("18446744073709551615") to withdraw all.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vault
|
str
|
Vault address to withdraw from |
required |
amount
|
str
|
Amount in token units, or U64_MAX for withdraw-all |
required |
wallet
|
str | None
|
Wallet address (defaults to config wallet) |
None
|
Returns:
| Type | Description |
|---|---|
JupiterLendTransactionResponse
|
JupiterLendTransactionResponse with base64-encoded unsigned transaction |
Raises:
| Type | Description |
|---|---|
JupiterLendAPIError
|
If the API request fails |
JupiterLendConfig
dataclass
¶
JupiterLendConfig(
wallet_address: str,
base_url: str = "https://api.jup.ag/lend",
timeout: int = 30,
)
Configuration for Jupiter Lend client.
Attributes:
| Name | Type | Description |
|---|---|---|
wallet_address |
str
|
Solana wallet public key (Base58) |
base_url |
str
|
Jupiter Lend API base URL |
timeout |
int
|
Request timeout in seconds |
JupiterLendAPIError
¶
JupiterLendAPIError(
message: str,
status_code: int,
endpoint: str | None = None,
error_code: str | None = None,
error_data: dict | None = None,
)
Bases: JupiterLendError
Exception raised for errors in the Jupiter Lend API response.
Attributes:
| Name | Type | Description |
|---|---|---|
message |
Error message |
|
status_code |
HTTP status code of the response |
|
endpoint |
The API endpoint that was called |
|
error_code |
Jupiter Lend-specific error code |
|
error_data |
Parsed error data from the response |
JupiterLendConfigError
¶
Bases: JupiterLendError
Exception raised for configuration errors.
Attributes:
| Name | Type | Description |
|---|---|---|
message |
Error message |
|
parameter |
Name of the configuration parameter that caused the error |
JupiterLendError
¶
Bases: Exception
Base exception class for all Jupiter Lend connector errors.
JupiterLendValidationError
¶
Bases: JupiterLendError
Exception raised for validation errors.
Attributes:
| Name | Type | Description |
|---|---|---|
message |
Error message |
|
field |
Name of the field that failed validation |
|
value |
The invalid value |
JupiterLendTransactionResponse
dataclass
¶
JupiterLendTransactionResponse(
transaction: str,
action: str = "",
raw_response: dict[str, Any] = dict(),
)
Response from a Jupiter Lend transaction endpoint.
The Jupiter Lend API returns a base64-encoded unsigned VersionedTransaction ready for signing and submission.
Attributes:
| Name | Type | Description |
|---|---|---|
transaction |
str
|
Base64-encoded unsigned Solana VersionedTransaction |
action |
str
|
The lending action (deposit, borrow, repay, withdraw) |
raw_response |
dict[str, Any]
|
Full API response for debugging |
from_api_response
classmethod
¶
Create from Jupiter Lend API transaction response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict[str, Any]
|
Jupiter Lend API response dict |
required |
action
|
str
|
The lending action (deposit, borrow, repay, withdraw) |
''
|
Returns:
| Type | Description |
|---|---|
JupiterLendTransactionResponse
|
Parsed JupiterLendTransactionResponse |
JupiterLendVault
dataclass
¶
JupiterLendVault(
address: str,
name: str = "",
token_symbol: str = "",
token_mint: str = "",
max_ltv: str = "0",
borrow_apy: str = "0",
supply_apy: str = "0",
total_supply: str = "0",
total_borrow: str = "0",
total_supply_usd: str = "0",
total_borrow_usd: str = "0",
utilization: str = "0",
)
A Jupiter Lend isolated vault.
Attributes:
| Name | Type | Description |
|---|---|---|
address |
str
|
Vault account public key (Base58) |
name |
str
|
Human-readable vault name |
token_symbol |
str
|
Underlying token symbol (e.g., "USDC", "SOL") |
token_mint |
str
|
SPL token mint address (Base58) |
max_ltv |
str
|
Maximum loan-to-value ratio (e.g., "0.85" = 85%) |
borrow_apy |
str
|
Current borrow APY as decimal string |
supply_apy |
str
|
Current supply APY as decimal string |
total_supply |
str
|
Total supplied amount (in token units) |
total_borrow |
str
|
Total borrowed amount (in token units) |
total_supply_usd |
str
|
Total supplied in USD |
total_borrow_usd |
str
|
Total borrowed in USD |
utilization |
str
|
Current utilization ratio as decimal string |
from_api_response
classmethod
¶
Create from Jupiter Lend API vault response.
JupiterLendReceiptParser
¶
Receipt parser for Jupiter Lend transactions.
Uses balance-delta approach: compares pre/post token balances in the Solana transaction receipt to extract the actual amounts deposited, borrowed, repaid, or withdrawn.
Initialize JupiterLendReceiptParser.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Any
|
Keyword arguments from receipt_registry (e.g., chain). |
{}
|
parse_receipt
¶
Parse a receipt for ReceiptParser protocol compatibility.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
receipt
|
dict[str, Any]
|
Solana transaction receipt dict |
required |
action
|
str
|
The lending action (deposit, borrow, repay, withdraw). If provided, only that extraction is performed. |
''
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dict with parsed lending data |
extract_supply_amounts
¶
extract_supply_amounts(
receipt: dict[str, Any], token_mint: str | None = None
) -> LendingAmounts | None
Extract supply (deposit) amounts from receipt.
Supply = tokens leaving the wallet (pre > post).
extract_borrow_amounts
¶
extract_borrow_amounts(
receipt: dict[str, Any], token_mint: str | None = None
) -> LendingAmounts | None
Extract borrow amounts from receipt.
Borrow = tokens arriving at the wallet (post > pre).
extract_repay_amounts
¶
extract_repay_amounts(
receipt: dict[str, Any], token_mint: str | None = None
) -> LendingAmounts | None
Extract repay amounts from receipt.
Repay = tokens leaving the wallet (pre > post).
extract_withdraw_amounts
¶
extract_withdraw_amounts(
receipt: dict[str, Any], token_mint: str | None = None
) -> LendingAmounts | None
Extract withdraw amounts from receipt.
Withdraw = tokens arriving at the wallet (post > pre).