Skip to main content

DeFi Integrations

MAGMA routes backing capital and standalone deposits into a roster of Solana DeFi protocols. Each protocol is wired behind a common adapter interface, so the rest of the system treats every venue identically. This page documents the live protocol set, each protocol's mechanism, the tokens it accepts, and the receipt token MAGMA stores to track the position.

Devnet beta

Adapters are wired against Solana devnet. Several SDK calls execute real deposits on devnet; others are mainnet-gated and use stubbed APYs until mainnet. Per-protocol status is noted below.

The adapter interface

Every protocol implements the same interface. Adding a protocol means adding one service file and registering the adapter — nothing else in the system changes.

interface ProtocolAdapter {
id: string;
deposit(wallet: string, amountSol: number): Promise<TransactionSignature>;
withdraw(wallet: string, positionId: string): Promise<TransactionSignature>;
getPositions(wallet: string): Promise<Position[]>;
getCollateralValue(wallet: string): Promise<number>; // USD
getApy(): Promise<number>;
}

Protocol roster

ProtocolCategoryTokensReceipt tokenBorrow collateral
KaminoLendingSOL, USDCkToken (e.g. kSOL)Yes
SaveLendingSOL, USDCSave cTokenYes (when integrated)
JupiterLending (Fluid)USDC, JUP, PYTHFluid receiptWhen integrated
JitoLiquid stakingSOLjitoSOLNot yet (future)
MarinadeLiquid stakingSOLmSOLNot yet (future)
MeteoraDLMM liquidityBONK, RAY, WIF, MET, KMNODLMM LP positionNot planned
GuardianStaking (Seeker)SKRStaking receiptNo
P0Prime brokerMultiUnified margin accountMargin venue

The deposit/withdraw routing logic, receipt-token management, and unstaking cooldown handling are documented in Yield Routing.

Kamino

  • Category: Lending vault.
  • Mechanism: A user deposits SOL or USDC; Kamino lends to borrowers; the position earns yield.
  • Tokens: SOL, USDC.
  • Receipt token: a Kamino kToken (e.g. kSOL), stored as the position receipt and redeemed for principal + yield on withdrawal.
  • Borrow collateral: Yes — positions routed here count toward borrow capacity.
  • SDK: @kamino-finance/klend-sdk.
  • Notes: Kamino is the primary route for SOL and USDC and the highest-priority adapter. Devnet APY is a hardcoded stub (~9.2%); real execution is mainnet-gated.

Save

  • Category: Lending protocol (formerly Solend).
  • Mechanism: Deposit → lend → yield, identical in shape to Kamino.
  • Tokens: SOL, USDC.
  • Receipt token: a Save cToken representing the lending position.
  • Borrow collateral: Yes (planned — same aggregation logic as Kamino).
  • SDK: Save's SDK (@solendprotocol/solend-sdk lineage).
  • Notes: Routing detects protocol.id === 'save' and dispatches to the Save adapter.

Jupiter

  • Category: Money market — Jupiter Lend (Fluid).
  • Mechanism: Deposit into the Fluid lending pool; earn money-market yield.
  • Tokens: USDC, JUP, PYTH.
  • Receipt token: a Fluid lending receipt, stored and redeemed on withdrawal.
  • Borrow collateral: TBD — depends on a review of Jupiter Lend's collateral model.
  • SDK: Jupiter Lend SDK / REST API.
  • Notes: Full integration is scoped for the mainnet-prep phase.

Jito

  • Category: Liquid staking.
  • Mechanism: Stake SOL via the Jito stake pool; receive jitoSOL (a liquid staking token) plus MEV rewards.
  • Tokens: SOL.
  • Receipt token: jitoSOL — mint J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn. The jitoSOL amount is stored as the position receipt.
  • Borrow collateral: Not yet — jitoSOL as collateral is a future feature.
  • SDK: @jito-foundation/stake-pool-sdk.
  • Notes: Unstaking has a 1–2 epoch cooldown (~2–4 days). On resolution during cooldown, principal is returned immediately and the yield is paid when the cooldown completes. See Yield Routing. Because it is liquid staking (not silent background lending), Jito has additional mobile portfolio UI showing the jitoSOL balance, SOL value, and cooldown status.

Marinade

  • Category: Liquid (and native) staking.
  • Mechanism: Stake SOL via Marinade liquid staking; receive mSOL.
  • Tokens: SOL.
  • Receipt token: mSOL — mint mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So. The mSOL amount is stored as the position receipt.
  • Borrow collateral: Not yet — mSOL as collateral is a future feature.
  • SDK: @marinade.finance/marinade-ts-sdk.
  • Notes: On resolution, MAGMA uses the immediate unstake path (0.3% fee, instant) — never the delayed path, which would block payouts. APY is fetched live and surfaced in the staking UI. See Yield Routing.

Meteora

  • Category: DLMM (Dynamic Liquidity Market Maker) — concentrated liquidity.
  • Mechanism: Provide liquidity to DLMM bins; earn trading fees and yield.
  • Tokens: BONK, RAY, WIF, MET, KMNO (DLMM pool pairs).
  • Receipt token: a DLMM LP position receipt; liquidity is removed on resolution.
  • Borrow collateral: Not planned — LP positions are complex to value as collateral.
  • SDK: @meteora-ag/dlmm-sdk.
  • Notes: Higher complexity (impermanent-loss risk, bin-range management, rebalancing). Surfaced in the Strategies tab.

Guardian

  • Category: Seeker-native staking.
  • Mechanism: Stake the Seeker-native asset; the position earns staking yield.
  • Tokens: SKR.
  • Receipt token: a Guardian staking receipt.
  • Borrow collateral: No.
  • Notes: Guardian staking always applies a 0% deposit fee — this is hardcoded and must never change. Wiring activates once the Guardian staking program is confirmed on devnet. Where staking is performed via the external Seeker venue, MAGMA still displays balance and tier data fetched from its own backend.

P0 (Project Zero)

  • Category: Self-custodial prime broker.
  • Mechanism: Provides unified margin across multiple lending venues (Kamino, Jupiter Lend, and others) under a single health factor.
  • Tokens: Multi-asset.
  • Receipt token: a unified margin account position.
  • Borrow collateral: P0 is itself a margin venue — see Borrowing.
  • Notes: Unlocked at Core tier (600+) and Volcanic tier (900+).

Capital allocation

Deposited capital is routed across protocols according to the vault allocation model:

SegmentAllocation
Meteora DLMM35%
Kamino33%
Save20%
Jupiter Lend12%

API routes

GET  /v1/defi/apys                  — current APYs from all supported protocols
POST /v1/defi/deposit/prepare — prepare a deposit transaction
POST /v1/defi/deposit/confirm — confirm a deposit after signing
POST /v1/defi/withdrawal/prepare — prepare a withdrawal
POST /v1/defi/withdrawal/confirm — confirm a withdrawal after signing
GET /v1/defi/allocation/:wallet — current direct-deposit positions

The REST base is https://api.magmaprotocol.xyz. See the API Reference for schemas, and Yield Routing for the deposit/withdraw lifecycle.