Skip to main content
SV · Shrey Vats

Navigate Portfolio

Jump to pages, project details, or toggle theme

Back to projects
Solanashreyvats01/solana-programs

Solana On-Chain Programs

A set of Rust programs on Solana covering a tokenized vault (ERC-4626 style), a two-party token escrow, and delegated spending allowances.

RustSolanaAnchorSPL Token

Overview

To understand how Solana handles state and account permissions on-chain, I implemented several core financial primitives in Rust. The repository includes a vault program modeled after Ethereum's ERC-4626 standard, an escrow program for atomic token swaps, and an allowance program for delegated token transfers.

How it works

Tap or hover stages to inspect
Vault & Escrow PDAsAnchor / SPL Token

Implementation details

01.

PDA vault custody

Each vault and escrow state account uses deterministic Program Derived Addresses (PDAs) as token authority, so only the program itself can sign outgoing SPL token transfers.

02.

Checked integer math for vault shares

Calculating deposit shares and withdrawal amounts uses checked arithmetic in Rust to prevent integer overflow or rounding bugs.

03.

Explicit account constraints

Every instruction verifies token mint ownership, signer privileges, and account relationships before modifying balances.