marginfi

Solid

Complete guide for Marginfi - Solana's decentralized lending protocol for lending, borrowing, leveraged positions(looping) and flash loans. Covers account creation, deposits, borrows, repayments, withdrawals, flash loans, and leveraged positions using the @mrgnlabs/marginfi-client-v2 SDK.

AI & Automation 126 stars 79 forks Updated 2 weeks ago Apache-2.0

Install

View on GitHub

Quality Score: 81/100

Stars 20%
70
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Marginfi Development Guide Build lending and borrowing applications on Solana with Marginfi - a decentralized, overcollateralized lending protocol offering deposits, borrows, flash loans, and leveraged positions. ## Overview Marginfi provides: - **Lending & Borrowing**: Deposit collateral to earn yield, borrow against your deposits - **Multiple Accounts**: Create multiple accounts per wallet with independent positions - **Risk Management**: Advanced health calculations using asset and liability weights - **Flash Loans**: Atomic, uncollateralized lending within a single transaction - **Looping**: Leverage positions by depositing and borrowing in a single transaction - **Multi-Asset Support**: SOL, USDC, LSTs (JitoSOL, mSOL), and more ## Quick Start ### Installation ```bash # Marginfi client SDK npm install @mrgnlabs/marginfi-client-v2 # Common utilities npm install @mrgnlabs/mrgn-common # Required peer dependencies npm install @solana/web3.js @coral-xyz/anchor ``` ### Environment Setup ```bash # .env file SOLANA_RPC_URL=https://api.mainnet-beta.solana.com WALLET_KEYPAIR_PATH=./keypair.json ``` ## Marginfi SDK (marginfi-client-v2) The SDK enables interaction with Marginfi's lending protocol for deposits, borrows, repayments, withdrawals, and advanced operations. ### Core Classes | Class | Purpose | |-------|---------| | `MarginfiClient` | Main client for loading groups and banks | | `MarginfiAccountWrapper` | User account management and lending operations | | `B...

Details

Author
sendaifun
Repository
sendaifun/skills
Created
7 months ago
Last Updated
2 weeks ago
Language
TypeScript
License
Apache-2.0

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category