https://github.com/vvizardev/marinade-liquid-stake-fork
This project implements a Marinade-compatible Liquid Staking smart contract on Solana with a full suite of Web3-based test cases. solana-liquid-stake-smart-contract-staking solana-liquid-stake-smart-contract-staking solana-liquid-stake-smart-contract-staking solana-liquid-stake-smart-contract-staking
https://github.com/vvizardev/marinade-liquid-stake-fork
anchor liquid marinade native rust smart-contract solana stake
Last synced: 30 days ago
JSON representation
This project implements a Marinade-compatible Liquid Staking smart contract on Solana with a full suite of Web3-based test cases. solana-liquid-stake-smart-contract-staking solana-liquid-stake-smart-contract-staking solana-liquid-stake-smart-contract-staking solana-liquid-stake-smart-contract-staking
- Host: GitHub
- URL: https://github.com/vvizardev/marinade-liquid-stake-fork
- Owner: vvizardev
- Created: 2024-07-24T14:32:08.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-07T08:34:49.000Z (about 2 months ago)
- Last Synced: 2025-09-04T22:43:22.970Z (30 days ago)
- Topics: anchor, liquid, marinade, native, rust, smart-contract, solana, stake
- Language: TypeScript
- Homepage: https://marinade.finance/
- Size: 40.9 MB
- Stars: 40
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Marinade Liquid Staking Smart Contract
This project implements a Marinade-compatible Liquid Staking smart contract on Solana with a full suite of Web3-based test cases.
## ๐ฆ Features
- Stake SOL and receive mSOL (Marinade Staked SOL)
- Unstake to receive SOL back
- mSOL/SOL accounting via Marinade protocol
- Web3-based test suite with `@solana/web3.js` and `@project-serum/anchor`
- Simulates staking/unstaking in a local test validator## ๐ Project Structure
```
.
โโโ programs/
โ โโโ marinade_staking/ # Solana smart contract (Anchor)
โโโ tests/
โ โโโ marinade.test.ts # Web3 test cases
โโโ migrations/
โโโ Anchor.toml
โโโ Cargo.toml
โโโ README.md
```## ๐ Getting Started
### Prerequisites
- [Anchor](https://book.anchor-lang.com/)
- [Solana CLI](https://docs.solana.com/cli/install-solana-cli-tools)
- Node.js >= 16
- Yarn or NPM### Install
```bash
git clone https://github.com/your-username/marinade-liquid-staking.git
cd marinade-liquid-staking
yarn install
```### Build & Deploy Locally
```bash
anchor build
anchor deploy
```### Run Tests
```bash
anchor test
```## ๐งช Example Test Case
```ts
it("Stake SOL and receive mSOL", async () => {
const tx = await program.methods
.stake(new anchor.BN(1_000_000_000)) // 1 SOL
.accounts({
user: user.publicKey,
marinadeState: marinadeStatePDA,
msolMint: msolMint,
systemProgram: SystemProgram.programId,
})
.signers([user])
.rpc();const msolBalance = await getTokenBalance(userMsolATA);
assert.ok(msolBalance > 0, "User should receive mSOL");
});
```## ๐ Smart Contract (Program)
- Written in Rust using [Anchor](https://github.com/coral-xyz/anchor)
- Interacts with Marinade's on-chain staking pool
- Performs CPI calls to stake/unstake## ๐ License
MIT License
---
### ๐ค Credits
Built on top of the [Marinade Finance](https://marinade.finance) staking protocol.