Giter Club home page Giter Club logo

cyber-markets's Introduction

We are sovereign self-funded community of scientists, developers, engineers and craftsmen.

Currently focused on creating a planet-scale superintelligence: Cyber

The plan is simple:

Teach Bostrom bootloader to develop type I civilization in greenfield on the Moon. While we stabilize and comprehend him we will launch Cyber superintelligence for the Earth from Bostrom bootloader. Then we aim to move physical Bostrom infrastructure to the Moon becoming the first sovereign blockchain in space.

The problem is attacked by self fulfilling prophecy in massively collaborative open source game:

Age of Superintelligence

in 6 epsiodes

7 years of r&d, but still we are young and released Episdode 1: A new hope

Everyone can get cheap moon citizenship for a while in portal.

70% of genesis gifted to ~5M addresses in Ethereum and Cosmos ecosystems. So the chances you can claim your BOOT in portal are high.

We are cyberian civilization of 10k+ citizens and growing thanks to our products:

cyber

Your superintelligence. Focus on soft3 applications. Vision. Repos:

Your immortal robot for the great web.

Cyb is a pure web3 and soft3 browser.

use it at cyb.ai

Help us build a better future

May the code be with you

cyber-markets's People

Contributors

abitrolly avatar asadovka avatar cyberadmin avatar cyborgshead avatar hleb-albau avatar irus avatar mastercyb avatar mgergalov avatar olga584 avatar savetheales avatar vbloher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cyber-markets's Issues

[spark] create live time trades ticker calculation

Implement simple windowed algorithm for calculation tickers for 1h, 3h, 6h, 24h tickers with 5 sec precision.

Implementation variants:

  1. Using apache spark
  2. Own jvm implementation
  • Read kafka trades channels
  • Calculate tickers (for this task just hold all info in memory, no storage required)
  • Push tickers to kafka

Save trades to db

  • [+] Understand cassandra tables( partition key, composite key)
  • [+] Chose cassandra partition key for trades
  • [+] Chose cassandra composite key for trades
  • [+] Add table difinition to devops/elassandra/bootstrap.cql

C* query examples.
select * from markets.trades where date=[date], exchange=[exchange1,exchange2], pair=[pair1,pair2]
select * from markets.trades where date=[date], exchange=[exchange1,exchange2]
select * from markets.trades where date=[date], pair=[pair1,pair2]

Description of configuration parameters

For cybernode docs I need to reference cyber-markets parameters such as ENV['DEEPSTREAMURL'], so when anything changes/breaks, cybernode admins knew where to look for.

Format of market data

There are couple of format of data which we get from exchanges
There is proposal for general format of markets data for cyber-markets

  • tradeId (trade id from exchange)
  • timestamp
  • exchange (need a convention about naming)
  • type (only sell/buy, converting partial fill and other to this 2 types)
  • baseToken (example: BTC, token in which we measure and buy other tokens - quote tokens)
  • quoteToken (example: ETH, token which we buy/sell with baseToken)
  • baseAmount (example: 1)
  • quoteAmount (example: 10)
  • spotPrice (example: 0.1 baseToken per one quoteToken)

For Poloniex there are only for base tokens BTC, ETH, XMR, USDT
total = baseAmount
amount = quoteAmount
rate = spotPrice

Impossible to sync 2(two) kafka topics to same cassandra table

lensesio/stream-reactor#284

It's impossible to sync two kafka topics(trades-a,trades-b) in one cassandra table (trades).
If i try to sync it's separately (for example trades-a to trades) it work perfect.

that is props for separetely attemp:
connector.class=com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraSinkConnector connect.cassandra.key.space=markets topics=TRADES-a tasks.max=1 connect.cassandra.kcql=INSERT INTO trade SELECT * FROM TRADES-a; connect.cassandra.fetch.size=5000 connect.cassandra.max.retries=20 connect.progress.enabled=false connect.cassandra.error.policy=throw connect.cassandra.contact.points=docker.for.mac.localhost connect.cassandra.port=9042 connect.cassandra.threadpool.size=10 name=CassandraSinkConnector connect.cassandra.retry.interval=30000 connect.progress.enabled=true connect.cassandra.consistency.level=LOCAL_ONE value.converter=org.apache.kafka.connect.json.JsonConverter key.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false key.converter.schemas.enable=false

As I Say it’s work fine.
And if i delete this connector and create TRADES-b to trade connector it’s work fine too!

but If I try to create this

connector.class=com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraSinkConnector connect.cassandra.key.space=markets topics=TRADES-a,TRADES-b tasks.max=1 connect.cassandra.kcql=INSERT INTO trade SELECT * FROM TRADES-a;INSERT INTO trade SELECT * FROM TRADES-b; connect.cassandra.fetch.size=5000 connect.cassandra.max.retries=20 connect.progress.enabled=false connect.cassandra.error.policy=throw connect.cassandra.contact.points=docker.for.mac.localhost connect.cassandra.port=9042 connect.cassandra.threadpool.size=10 name=CassandraSinkConnector connect.cassandra.retry.interval=30000 connect.progress.enabled=true connect.cassandra.consistency.level=LOCAL_ONE value.converter=org.apache.kafka.connect.json.JsonConverter key.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false key.converter.schemas.enable=false

It’s doesn’t work..

`TRACE:

org.apache.kafka.connect.errors.ConnectException: No tables found in Cassandra for topics trades,trades
at com.datamountaineer.streamreactor.connect.cassandra.utils.CassandraUtils$.checkCassandraTables(CassandraUtils.scala:61)
at com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter.(CassandraJsonWriter.scala:54)
at com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraWriter$.apply(CassandraWriter.scala:43)
at com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraSinkTask.start(CassandraSinkTask.scala:58)
at org.apache.kafka.connect.runtime.WorkerSinkTask.initializeAndStart(WorkerSinkTask.java:232)
at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:145)
at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:146)
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:190)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)`

Strange log..

I repeat, the error is obtained only if I make the insertion into the same table from different topics.
If I do an insertion into different tables from different topics, this works well

Data quality roadmap

Provider quality

  • LVL 1 no guarantee / no history recovery
  • LVL 2 guaranteed gap detection / no history recovery
  • LVL 3 gap detection / gap recovery
    Need to think about this functionality in cyber-markets

Supply dev-kafka

Current Kafka + Kafka manager combination do not allow to measure topics loads.

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.