Peerplays > metanode > hummingbot #320

Closed
opened 2022-03-15 13:42:26 +00:00 by bobinson · 7 comments
bobinson commented 2022-03-15 13:42:26 +00:00 (Migrated from gitlab.com)

Tracking task for reviewing metanode + peerplays integration enabling hummingbot support

https://github.com/litepresence/hummingbot/

Tracking task for reviewing metanode + peerplays integration enabling hummingbot support https://github.com/litepresence/hummingbot/
bobinson commented 2022-03-15 13:42:26 +00:00 (Migrated from gitlab.com)

assigned to @bobinson

assigned to @bobinson
bobinson commented 2022-03-15 13:43:24 +00:00 (Migrated from gitlab.com)
[README.md](/uploads/ee7c0d0fb1e66961f4faa1d3b2c60f9d/README.md)
bobinson commented 2022-03-15 13:44:44 +00:00 (Migrated from gitlab.com)

High Level Overview of Graphene >> Metanode >> Hummingbot Connector

Graphene is a blockchain which provides specific public api calls.   
Many of these calls rely upon the user holding cached information from other calls to decipher.   
We use the following api calls:

network_broadcast/

    broadcast_transaction_with_callback

history/

    get_fill_order_history
    get_relative_account_history

database/

    get_account_by_name
    get_chain_properties
    get_dynamic_global_properties
    get_full_accounts
    get_named_account_balances
    get_objects
    get_order_book
    get_required_fees
    get_ticker
    get_trade_history
    get_transaction_hex
    lookup_asset_symbols


Metanode is an API layer that exists between Graphene Public API Nodes and the user.

It provides streaming statistically validated data from Graphene blochchain public API nodes.

This data resides in a SQL database.   

Where pertinent information is cached once,
if the data is streaming it is updated as frequently as possible,
given network and statistical confirmation restraints.

The Metanode API is designed to act more like a "Centralized Exchange" than dealing with a blockchain.

the api is used by accessing @property methods of the GrapheneTrustlessClient class

metanode = GrapheneTrustlessClient() # exposes the following properties which make discrete SQL db queries:

    metanode.chain -> dict: ["id", "name"]

    metanode.account -> dict: ["id", "name", "fees_account", "ltm", "cancels"]

    metanode.assets -> dict: ["id", "fees_asset", "balance", "precision", "supply"]

    metanode.objects -> dict: ["name", "precision"]

    metanode.pairs -> dict: ["id", "last", "book", "history", "ops", "fills", "opens"]

    metanode.nodes -> dict: ["ping", "code", "status", "handshake"]

    metanode.timing -> dict: ["ping", "read", "begin", "blocktime", "blocknum", "handshake"]

    metanode.whitelist -> list: ["wss://", "wss://", ...]

The Metanode also provides transaction signing for limit_order_create and limit_order_cancel

auth = GrapheneAuth() # exposes the following property which allow for order headers and execution

    # create an order dictionary with appropriate header
    order = auth.prototype_order()

    # add edicts to the order demanding buy/sell/cancel/login
    # sample login
    order1["edicts"] = [{"op": "login"}]
    # sample cancel all
    order2["edicts"] = [{"op": "cancel", "ids": ["1.7.X"]}]
    # sample place two limit orders
    order3["edicts"] = [
        {"op": "buy", "amount": 10, "price": 0.2, "expiration": 0,},
        {"op": "sell", "amount": 10, "price": 0.7, "expiration": 0,},
    ]
    # then execution occurs in a parallel process using the broker method
    result = broker(order)


The Hummingbot Connector is an execution engine which provides:

    cli for bot creation
    a recurring "tick" loop which allows for automated trading
    live orderbooks 
    account balances
    orderbook post processing in cython
    buy/sell/cancel authenticated ops
    order tracking with both client ID and exchange ID
        as logical translation from graphene opens/fills/creates/cancels
        and with respect to known buy/sell/cancel attempts


``` High Level Overview of Graphene >> Metanode >> Hummingbot Connector Graphene is a blockchain which provides specific public api calls. Many of these calls rely upon the user holding cached information from other calls to decipher. We use the following api calls: network_broadcast/ broadcast_transaction_with_callback history/ get_fill_order_history get_relative_account_history database/ get_account_by_name get_chain_properties get_dynamic_global_properties get_full_accounts get_named_account_balances get_objects get_order_book get_required_fees get_ticker get_trade_history get_transaction_hex lookup_asset_symbols Metanode is an API layer that exists between Graphene Public API Nodes and the user. It provides streaming statistically validated data from Graphene blochchain public API nodes. This data resides in a SQL database. Where pertinent information is cached once, if the data is streaming it is updated as frequently as possible, given network and statistical confirmation restraints. The Metanode API is designed to act more like a "Centralized Exchange" than dealing with a blockchain. the api is used by accessing @property methods of the GrapheneTrustlessClient class metanode = GrapheneTrustlessClient() # exposes the following properties which make discrete SQL db queries: metanode.chain -> dict: ["id", "name"] metanode.account -> dict: ["id", "name", "fees_account", "ltm", "cancels"] metanode.assets -> dict: ["id", "fees_asset", "balance", "precision", "supply"] metanode.objects -> dict: ["name", "precision"] metanode.pairs -> dict: ["id", "last", "book", "history", "ops", "fills", "opens"] metanode.nodes -> dict: ["ping", "code", "status", "handshake"] metanode.timing -> dict: ["ping", "read", "begin", "blocktime", "blocknum", "handshake"] metanode.whitelist -> list: ["wss://", "wss://", ...] The Metanode also provides transaction signing for limit_order_create and limit_order_cancel auth = GrapheneAuth() # exposes the following property which allow for order headers and execution # create an order dictionary with appropriate header order = auth.prototype_order() # add edicts to the order demanding buy/sell/cancel/login # sample login order1["edicts"] = [{"op": "login"}] # sample cancel all order2["edicts"] = [{"op": "cancel", "ids": ["1.7.X"]}] # sample place two limit orders order3["edicts"] = [ {"op": "buy", "amount": 10, "price": 0.2, "expiration": 0,}, {"op": "sell", "amount": 10, "price": 0.7, "expiration": 0,}, ] # then execution occurs in a parallel process using the broker method result = broker(order) The Hummingbot Connector is an execution engine which provides: cli for bot creation a recurring "tick" loop which allows for automated trading live orderbooks account balances orderbook post processing in cython buy/sell/cancel authenticated ops order tracking with both client ID and exchange ID as logical translation from graphene opens/fills/creates/cancels and with respect to known buy/sell/cancel attempts ```
bobinson commented 2022-03-16 06:40:04 +00:00 (Migrated from gitlab.com)
[metanode_overview.md](/uploads/601fd2bbcdd370852d6459dca1ed0c20/metanode_overview.md)
bobinson commented 2022-03-17 07:37:14 +00:00 (Migrated from gitlab.com)

sudo apt install libsecp256k1-dev is required to get metanode installed on ubuntu machines

`sudo apt install libsecp256k1-dev` is required to get metanode installed on ubuntu machines
bobinson commented 2022-03-17 12:11:31 +00:00 (Migrated from gitlab.com)

installation steps for Hummingbot + metanode

  1. conda and python is installed
  2. installed metanode (sudo apt install libsecp256k1-dev ; pip install metanode)
  3. followed hummingbot's installation + running instructions as per https://hummingbot.org/installation/source/#linuxubuntu
installation steps for Hummingbot + metanode 1. conda and python is installed 2. installed metanode (`sudo apt install libsecp256k1-dev` ; `pip install metanode`) 3. followed hummingbot's installation + running instructions as per https://hummingbot.org/installation/source/#linuxubuntu
bobinson commented 2022-05-02 10:45:59 +00:00 (Migrated from gitlab.com)
https://github.com/litepresence/Graphene-Metanode/blob/master/TUTORIAL.pdf [TUTORIAL.pdf](/uploads/ad33e398fbbe9447be5798029c36c418/TUTORIAL.pdf)
bobinson (Migrated from gitlab.com) closed this issue 2022-05-02 10:46:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Peerplays_Blockchain/peerplays_migrated#320
No description provided.