Giter Site home page Giter Site logo

zktoken's Introduction

zkToken (WIP)

zkToken is a ERC20 Monitor based on zkGraph. It used to monitor whether there is any selling or pumping behavior in the whale account, and then issue an alert signal.

Getting Start

Through the following steps, locally test zkToken.

1. Prepare environment

npm install
vim config.js # Fill in the private key and endpoint in the configuration file.

Please fill in the last configuration item "whale" in the configs as the whale account you want to monitor.

2. Obtain the balance of the whale account.

npm run whale

3. Compile && Run at the specified block height.

npm run compile-local && npm run exec-local -- 18370576

At this point, zkgraph returns a boolean value indicating whether the user can be liquidated.

You can modify the block height 18370576 in the above command to any value for further testing.

Project Layout

zkToken project is broken down into three sections:

  • src - The core logic of zkToken.
  • builds - Compiled WASM Binary file.
  • static - whale account state file and abi json for scripts.
  • APIs - Some zkgraph-api like compiling\execution\deploy etc.
  • scripts - scripts for obtaining hard-coded whale status.

core logic of zkToken

  1. Fetch Tokens Transfer events on the mainnet.

The default tokens to be followed include compound v2 underlyings tokens.

You can modify static/tokens.ts to customize the tokens you want to follow.

  1. Determine the market sentiment corresponding to Transfer.

If the amount of token transferred out is greater than half of the balance, it is considered a bearish signal with selling implications.

If the amount of token transferred is greater than half of the balance, it is considered a bullish signal with the meaning of price increase.

Other situations are considered neutral signal.

  1. Combined result bytes

Market signals are defined as Enum Signal and will eventually be converted into an array of Bytes with i32.

zktoken's People

Contributors

liriu avatar

Stargazers

Sunny Sun avatar  avatar

Watchers

 avatar  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.