Skip to content

Local-DAO/kujira-trades-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Local Trades Index

A tool to analyze trading activity on Kujira's local trades contract. This tool fetches and analyzes transaction data from the Kujira blockchain, specifically focusing on release_escrow events.

Features

  • Fetches transaction data from Kujira API with pagination
  • Processes release_escrow events
  • Generates detailed statistics about trading activity
  • Creates CSV exports of trade data
  • Provides summary of trading activity by denomination and trader

Requirements

  • Python 3.6+
  • requests library

Installation

  1. Clone the repository
  2. Create a virtual environment:
    python3 -m venv venv
    source venv/bin/activate  # On Unix/macOS
  3. Install dependencies:
    pip install -r requirements.txt

Usage

  1. Fetch transaction data:

    python fetch_trades.py

    This will create JSON files containing transaction data.

  2. Parse and analyze trades:

    python parse_trades.py

    This will generate:

    • release_escrow_events.csv: Detailed trade data
    • trade_summary.json: Summary statistics including:
      • Total amounts by denomination
      • Number of unique traders
      • Most active traders
      • Average trades per trader

Output Format

CSV Fields

  • trade_id: Unique identifier for the trade
  • trade_denom: Token denomination
  • total_amount: Amount of tokens traded
  • sender: Address of the trader

Summary JSON Structure

{
  "denom_totals": {
    "denom1": amount1,
    "denom2": amount2
  },
  "unique_traders": number,
  "total_trades": number,
  "avg_trades_per_trader": number,
  "most_active_traders": [
    {
      "address": "trader_address",
      "trades": number
    }
  ]
}

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages