Giter Site home page Giter Site logo

solanastocksim's Introduction

solanastocksim

Fun stock simulator integrated with Solana blockchain

Structure

Whole thing consists from several parts:

  • faststock.py, strats.py, safeacc.py - parts of stock exchange model. They stand for trade simulation
  • rust_client - wrapper of Solana's RPC client & Python interface generated by pyo3 Rust crate for stock model to track transactions on Solana's blockchain
  • client.py - Python RPC client wrapper with SolanaPy python package, just a python implementation of rust_client (it was created to study API)
  • sender, setter, messenger - on-chain programs, that are to be deployed on a localnet Solana's blockchain

Run

Ready-to-use docker image:
https://hub.docker.com/r/vadimpy/solexample

First terminal (run localnet Solana blockchain):

$ solana-test-validator -r

Second terminal (listen its logs):

$ solana logs

Third terminal (deploy on-chain programs and run exmaples notebook):

$ cd solanastocksim/stock_backend
$ ./deploy.sh
$ jupyter-notebook

Run example.ipynb cell-by-cell
Be careful! Recommended system requirements for Solana's localnet are 24 logical CPUs and 64GB of memory

Build

Build client:

$ cd solanastocksim/stock_frontend/rust_client
$ cargo +nightly build --target-dir ../build

Build on-chain programs:

$ cd solanastocksim/stock_backend
$ cargo +nightly build-bpf --bpf-out-dir build

Configure paths in solanastocksim/cfg.yml (for Docker it is already configured)

Docker commands:

Run Jupyter notebook

sudo docker run --name vadimpy/solexample -it -p 8888:8888 -a stdin -a stdout -i -t vadimpy/solexample:latest /bin/bash
cd solanastocksim
jupyter notebook --ip 0.0.0.0 --allow-root

solanastocksim's People

Contributors

vadimpy avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.