Skip to content

virjilakrum/Q3T_Sol_Baturalp

Repository files navigation

Turbin3 Q3 Sol Cohort Portfolio

turbin3

Solana Notes

Solana Account Model

On Solana, all data is stored in "accounts," similar to a key-value store where each entry is an account. Account

Key Points

  • Account Storage: Up to 10MB of data, including executable code or program state.
  • Rent: Accounts require a SOL deposit proportional to data size, refundable upon account closure.
  • Account Ownership: Only the owning program can modify an account's data or reduce its lamport balance. Anyone can increase the balance.
account-2

Account Structure

  • Address: A unique 32-byte Ed25519 PublicKey.

The address of a normal account in Solana is a Base58-encoded string of a 256-bit ed25519 public key. Not all bit patterns are valid public keys for the ed25519 curve, so it is possible to ensure user-supplied account addresses are at least correct ed25519 public keys.

  • Data: Byte array storing account state or executable code.
  • Executable: Flag indicating if the account is a program.
  • Lamports: Account balance in lamports (1 SOL = 1 billion lamports).
  • Owner: PublicKey of the owning program.

Types of Accounts

  • Program Accounts: Stateless accounts storing executable code.
program accounts
  • Data Accounts: Store and manage program state, created by programs.

  • Native Programs: Built-in programs with core functionalities, e.g., System Program and BPF Loader. Native program

  • Sysvar Accounts: Store network cluster state.

Key Programs

  • System Program: System program

    • Creates new accounts.
    • Allocates data space.
    • Assigns program ownership.
    • Manages wallet accounts.
  • BPF Loader Program:

    • Deploys, upgrades, and executes custom programs.

Custom Programs (Smart Contracts)

  • Program Account: Stores program's executable data and update authority.
  • Program Executable Data Account: Contains executable byte code.
  • Buffer Account: Temporary storage during deployment/upgrades.

Creating Data Accounts

  1. System Program: Creates the account and transfers ownership.
  2. Custom Program: Initializes account data.

Primitive II: Automated Market Makers — AMM

Objectives: 24/7 Liquidity | Stable Buy & Sell Spreads | Transparent & Universal MM Incentives

The scope of Uniswap Labs’ first working AMM model (K = x*y) cannot be understated in the history of DeFi, as the working application of liquidity pools instantaneously made standalone orderbook DEXes, on both Ethereum (Etherdelta, IDEX) and other chains (Bitshares, Waves, Cryptobridge) obsolete, almost overnight. Uniswap was a truly revolutionary addition to the future of DeFi, and demonstrated the legitimacy and potential of the DEX/AMM financial primitive as the bedrock for transparent, trustless commerce. Solana’s current DEX/AMM infrastructure and prospective DeFi product suite stands on the shoulders of invaluable contributions by the Ethereum Foundation, Uniswap Labs, & the greater DeFi community.

Solana’s high-throughput, low-latency, processing capabilities provide the means for a vast suite of sophisticated AMM applications for decentralized operations, such as high-frequency trading, central limit order books(CLOB), derivatives, cloud computing, and cloud storage. These financial instruments and Web3 interfaces are rapidly being built on Solana, with seamless scaling to support over 1 billion user accounts on a single state machine.

Solana DEX/AMM Suite I: Raydium

Raydium is an on-chain order book and automated market maker (AMM) that enables lightning-fast trades, shared liquidity and new features for earning yield. Initially offered as a standalone DEX/AMM product, Raydium offers a suite of services to its users such as launchpads, accelerators, and yield farming.

Note: Currently, there are two supported operations for trading on Raydium. Users can transact through the Orderbook (Trading tab) or through the AMM (Swap tab).

Documentation: https://raydium.gitbook.io/raydium/ How to use Raydium: https://raydium.gitbook.io/raydium/

Turbin3 Prerequisites and Projects on Solana Devnet

This portfolio showcases my work and progress within the Turbin3 Q3 Sol Cohort program. Below are the detailed steps, scripts, and outcomes of my projects on the Solana blockchain.

Table of Contents

  1. Transaction Links
  2. Project Setup
  3. Scripts and Commands
  4. File Descriptions
  5. WBA-solana-starter

Transaction Links

Description Transaction Link
Airdrop Transaction View Transaction
Transfer Transaction View Transaction
Enroll Transaction View Transaction

Project Setup

  1. Environment Setup:

    • Ensure Node.js and Yarn are installed.
    • Initialize project directory:
      mkdir airdrop && cd airdrop
      yarn init -y
  2. Package Installation:

    • Install required packages:
      yarn add @types/node typescript @solana/web3.js bs58
      yarn add -D ts-node
  3. TypeScript Configuration:

    • Generate TypeScript configuration:
      yarn tsc --init --rootDir ./ --outDir ./dist --esModuleInterop --lib ES2019 --module commonjs --resolveJsonModule true --noImplicitAny true

Scripts and Commands

Creating Keypair

  • Generate a new Solana wallet keypair:
    yarn keygen

Claiming Airdrop

  • Request 2 SOL airdrop from Solana Devnet:
    yarn airdrop

Making a Transfer

  • Transfer 0.1 SOL to another wallet:
    yarn transfer

Enrolling in Program

  • Submit your GitHub account to the Solana program:
    yarn enroll

File Descriptions

File Name Description
keygen.ts Script to generate a new Solana wallet keypair.
airdrop.ts Script to request SOL tokens from Solana Devnet to the generated wallet.
transfer.ts Script to transfer SOL from the generated wallet to another specified wallet.
enroll.ts Script to interact with the Solana program and submit your GitHub account.

WBA-solana-starter

Turbin3 Qohort Homework-1 & Homework-2

Case 1: Rug Day Task Completion

Participated in a collaborative task development session, creating and managing token accounts.

Commands & Tx Links

  • Create Mint Account:

    ts-node ./cluster1/spl_init.ts
    Success! Your mint address is: 2sZ4ZHHTHeB3wSbNvnZeD27FLUrmMx8hzQa18EfyKjKX
  • Create Token Account:

    ts-node ./cluster1/spl_mint.ts
    Your ata is: BAJaTUTE3eyyeQs7g4eBbhZBPtyG2aYYRX3yycWZnj7Z
    Success! Your mint transaction is: 3JSEffd5kXeKTXduzeVVRixNmdfeqEkqruX5LTpv1FqbBkJzyw84gCC96TsBvAU3EPBvCjFkd7tNpuMfkc9fcfjL
  • Mint Tokens:

    Your ata is: BAJaTUTE3eyyeQs7g4eBbhZBPtyG2aYYRX3yycWZnj7Z
    Success! Your mint transaction is: 3TUxcfvZFseFyo4JndcprzLtJkPAREvEzoNqnCzX6j3uZ7MLyBgdUDiKRvP7sQsPyxEKatgywtaXJCPrJWvQS2y4

Case 2: Presentation on Blinks

Watched a recorded presentation by Nick Frostbutter about Blinks.

Case 3: Additional Tasks

Commands & Tx Links

  • Complete spl_transfer:
    yarn spl_transfer
    yarn
    

run v1.22.21 $ ts-node ./cluster1/spl_transfer.ts Transaction signature: NzCn6uC7oNNWupmm4gLNtujncTEvQG9igodmfB2SK6ah2oz1oWjd7NooyoCPzmJ8ZnEsfeVwtL7siEjsj1CJpaT ✨ Done in 2.93s.


- **Complete `sql_metadata`**:
```bash
➜  ts git:(master) ✗ yarn nft_metadata
yarn run v1.22.21
$ ts-node ./cluster1/nft_metadata.ts
Your image URI:  https://arweave.net/IgUpys1136O9Uf-A08Rc20_eP6_FWIAqx4TA3D2_DYI
  • Random Rugs: Generate Random Rugs

  • Initialized NFT:

    yarn nft_mint
    yarn run v1.22.21
    $ ts-node ./cluster1/nft_mint.ts
    Succesfully Minted! Check out your TX here:
    https://explorer.solana.com/tx/3Cqz37kLDgzAtihx3gspHMiqvgqXPyT19t5wmWCWydUn8PCJt5N7KemWWB8KaeUcfTfFJotw735oqgJ48XihTDAS?cluster=devnet
    Mint Address:  4iDK7p4n3G5C66zhSCcSoVB9nTZfSUy3j88jdZpA8222
    ✨  Done in 3.28s.
  • RUG NFT Address: RUG NFT Address


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published