Package Logo
kamino-finance-events
kamino-finance-events@v1.0.1
Total Downloads
42
Published
yesterday
Network
solana solana
Publisher
User Avatar PaulieB14
Total Downloads
42
Published
yesterday
Network
solana solana
Publisher
User Avatar PaulieB14

Readme

Kamino Finance Substreams

A comprehensive Substreams package for extracting and transforming Kamino Finance events on Solana blockchain.

Overview

This package provides real-time extraction of all Kamino Finance protocol events including:

  • Lending Operations: Deposit, withdraw, borrow, repay, liquidate
  • Liquidity Management: Add/remove liquidity, swaps
  • Vault Strategies: Deposit, withdraw, harvest, rebalance
  • Multiply Positions: Open/close leveraged positions, adjust leverage

Features

🏦 Lending Program Events

  • Deposit: Users deposit collateral into lending pools
  • Withdraw: Users withdraw collateral from lending pools
  • Borrow: Users borrow against their collateral
  • Repay: Users repay borrowed amounts
  • Liquidate: Liquidate undercollateralized positions

💧 Liquidity Program Events

  • Add Liquidity: Add liquidity to trading pools
  • Remove Liquidity: Remove liquidity from pools
  • Swap: Execute token swaps between assets

🏛️ Vault Program Events

  • Deposit: Deposit into yield farming strategies
  • Withdraw: Withdraw from strategy vaults
  • Harvest: Harvest accumulated yield
  • Rebalance: Rebalance strategy allocations

⚡ Multiply Program Events

  • Open Position: Open leveraged positions
  • Close Position: Close leveraged positions
  • Adjust Leverage: Adjust position leverage ratios

Usage

Quick Start

# Start streaming with GUI
substreams gui kamino-finance-events@v1.0.0

# Run with specific parameters
substreams run kamino-finance-events@v1.0.0 kamino_events \
  -e mainnet.sol.streamingfast.io:443 \
  --start-block 300000000 \
  --stop-block +10

Output Format

The package outputs structured events in the following format:

message KaminoEvents {
  repeated LendEvent lend_events = 1;
  repeated LiquidityEvent liquidity_events = 2;
  repeated VaultEvent vault_events = 3;
  repeated MultiplyEvent multiply_events = 4;
}

Event Data Structure

Each event includes:

  • Transaction Signature: Unique transaction identifier
  • Slot: Solana slot number
  • Timestamp: Block timestamp
  • User: User account address
  • Event Type: Specific operation type
  • Asset Information: Token details and amounts
  • Market Data: Rates, health factors, APY
  • Address Tracking: Program, vault, and strategy addresses

Program IDs

The package monitors the following Kamino program IDs:

  • Lend Program: GzFgdRJXmawPhGeBsyRCDLx4jAKPsvbUqoqitzppkzkW
  • Liquidity Program: E35i5qn7872eEmBt15e5VGhziUBzCTm43XCSWvDoQNNv
  • Vault Program: Cyjb5r4P1j1YPEyUemWxMZKbTpBiyNQML1S1YpPvi9xE
  • Multiply Program: KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD

Network

  • Blockchain: Solana
  • Network: Mainnet
  • Initial Block: 300000000

Examples

Lending Event Example

{
  "signature": "5J7X8K9L2M3N4O5P6Q7R8S9T0U1V2W3X4Y5Z6A7B8C9D0E1F2G3H4I5J6K7L8M9N0O1P2Q3R4S5T6U7V8W9X0Y1Z2A3B4C5D6E7F8G9H0I1J2K3L4M5N6O7P8Q9R0S1T2U3V4W5X6Y7Z8A9B0C1D2E3F4G5H6I7J8K9L0M1N2O3P4Q5R6S7T8U9V0W1X2Y3Z4A5B6C7D8E9F0G1H2I3J4K5L6M7N8O9P0Q1R2S3T4U5V6W7X8Y9Z0A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6Q7R8S9T0U1V2W3X4Y5Z6A7B8C9D0E1F2G3H4I5J6K7L8M9N0O1P2Q3R4S5T6U7V8W9X0Y1Z2A3B4C5D6E7F8G9H0I1J2K3L4M5N6O7P8Q9R0S1T2U3V4W5X6Y7Z8A9B0C1D2E3F4G5H6I7J8K9L0M1N2O3P4Q5R6S7T8U9V0W1X2Y3Z4",
  "slot": 300000001,
  "timestamp": "2024-01-01T12:00:00Z",
  "user": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
  "event_type": "deposit",
  "market": "Kamino Market",
  "asset": "SOL",
  "amount": "1000000000",
  "collateral_amount": "1000000000",
  "borrow_rate": "0.05",
  "supply_rate": "0.03",
  "health_factor": "1.5",
  "market_address": "GzFgdRJXmawPhGeBsyRCDLx4jAKPsvbUqoqitzppkzkW",
  "reserve_address": "E35i5qn7872eEmBt15e5VGhziUBzCTm43XCSWvDoQNNv"
}

Development

Building from Source

# Clone the repository
git clone <repository-url>
cd kamino-finance-substreams

# Build the package
substreams build

# Test locally
substreams run substreams.yaml kamino_events --start-block 300000000 --stop-block +1

Dependencies

  • Rust 1.70+
  • Substreams CLI
  • Solana toolchain
  • Protobuf compiler

License

MIT License - see LICENSE file for details.

Support

For issues and questions:

Changelog

v1.0.0

  • Initial release
  • Complete Kamino Finance event extraction
  • Support for all major protocol operations
  • Comprehensive protobuf schemas
  • Production-ready package

Documentation

Modules

Maps icon
Maps

map
kamino_events

fd922b28a911d3930b11c255d48cd3f904850015
map kamino_events (
blocksf.solana.type.v1.Block
)  -> kamino.v1.KaminoEvents

Extracts and transforms Kamino Finance events from Solana blocks.

Monitors the following Kamino program IDs:

  • Lend Program: GzFgdRJXmawPhGeBsyRCDLx4jAKPsvbUqoqitzppkzkW
  • Liquidity Program: E35i5qn7872eEmBt15e5VGhziUBzCTm43XCSWvDoQNNv
  • Vault Program: Cyjb5r4P1j1YPEyUemWxMZKbTpBiyNQML1S1YpPvi9xE
  • Multiply Program: KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD

Event Types:

  • Lend: deposit, withdraw, borrow, repay, liquidate
  • Liquidity: add_liquidity, remove_liquidity, swap
  • Vault: deposit, withdraw, harvest, rebalance
  • Multiply: open_position, close_position, adjust_leverage
substreams gui kamino-finance-events@v1.0.1 kamino_events
Protobuf

Protobuf Docs Explorer

kamino.v1