BitShares Forum

Main => General Discussion => Topic started by: Elias on October 21, 2019, 11:52:23 am

Title: D*Match betting in chain
Post by: Elias on October 21, 2019, 11:52:23 am
Hello, Elias here.
I wish to experiment how long can i reach in develop a betting app with BitShares prediction markets.

Intro

There is almost nothing definitive but the tech:

Vision

* Transparent betting app.
* Node companion server to avoid bloating core-api.
* Manager for betting setups, storing status in asset description.
* Hierarchical dependency of prediction market assets to allow multi-choice bets.

Work notes

* My work is based on design aproach "bi-directional top-down", being "top" the user experience and "down" the tech ground.
* Multiple programing patterns. Although i always begin with procedural with gradual refactor to oop when the code matures.
* Python centric. Always can be a time for C migration, although not in my interest.
* Aside note: Too wide opened mind and prone to break things. Thus bad core developer.



Short introduction of me:
* Member of community since 2017. Fall in love with a mature project that just works.
* My first personal project failed by not being able to get in sync with the blockchain and unclear goals.
* The second project (monotoken (smartasset wallet)) failed for not being according to locals laws.
* This is my third project.   :D



This post along screenshot post will be refreshed periocally in order to reflect status.

v.0.next
* talking with nodes
* market setups
* etc....

v.0.1.1.
* Observable pattern done in brython (Mirroring UI with atributes changes).
* Selecting bets and adding to the betslip.
 
v.0.1
* Foundation for API tech
* Foundation for UI tech
Title: Re: D*Match betting in chain
Post by: Elias on October 21, 2019, 12:04:49 pm
screenshots

(https://i.imgur.com/SKiGpdR.png)

(https://i.imgur.com/RGq9dve.gif)   (https://i.imgur.com/FpBdnMG.gif)
 

Title: Re: D*Match betting in chain
Post by: bench on October 21, 2019, 12:45:33 pm
Hi Elias, welcome to the board.

This is a great initiative to bring the functions of the prediction market to the average users!

Does the PM allow a different betting ratio than 1:1?

You are setting up a own full node only for PM?
Title: Re: D*Match betting in chain
Post by: clockwork on October 21, 2019, 01:51:11 pm
Hello, Elias here.
I wish to experiment how long can i reach in develop a betting app with BitShares prediction markets.

Intro

There is almost nothing definitive but the tech:
  • UI will be a mobile app, with Cordova, MobileUI, Javascript and Brython
  • Development backend server with Python, UVIcorn, Starlette, FastAPI(
  • Backend will facilitate the managing of markets

Vision

* Transparent betting app.
* Node companion server to avoid bloating core-api.
* Manager for betting setups, storing status in asset description.
* Hierarchical dependency of prediction market assets to allow multi-choice bets.

Work notes

* My work is based on design aproach "bi-directional top-down", being "top" the user experience and "down" the tech ground.
* Multiple programing patterns. Although i always begin with procedural with gradual refactor to oop when the code matures.
* Python centric. Always can be a time for C migration, although not in my interest.
* Aside note: Too wide opened mind and prone to break things. Thus bad core developer.



Short introduction of me:
* Member of community since 2017. Fall in love with a mature project that just works.
* My first personal project failed by not being able to get in sync with the blockchain and unclear goals.
* The second project (monotoken (smartasset wallet)) failed for not being according to locals laws.
* This is my third project.   :D



This post will be refreshed periocally in order to reflect status.

v.0.1
* Foundation for API tech
* Foundation for UI tech

Good stuff!

Great to see more devs jumping in to make use of all the tools we have
Title: Re: D*Match betting in chain
Post by: Elias on October 21, 2019, 02:23:39 pm
Hi Elias, welcome to the board.

This is a great initiative to bring the functions of the prediction market to the average users!

Does the PM allow a different betting ratio than 1:1?

You are setting up a own full node only for PM?

Hi!   
The ratio comes from the market operations: As i'm going forward i'll make some assumptions (some may be wrong). At this moment i understand that buying an option at 0.1 is like back x10 while the inverse is borrowing and selling at 0.9, thus an x1.9 ratio for lay (and x1.1 for back at the buyer side).
For the lay bet (betting a result of 0), more than x1.9 would require another asset representing the inverse side. Thus two markets, one for back and another for lay.

As i don't have nor the hardware neither the ability to operate a node, i have to develop having in mind to be a good companion for a node. The idea is to bring a new interpretation of the blockchain data rather than modify the protocol to adapt to this use case.

cheers
Title: Re: D*Match betting in chain
Post by: pc on October 21, 2019, 04:55:42 pm
I wish to experiment how long can i reach in develop a betting app with BitShares prediction markets.
[...]
* The second project (monotoken (smartasset wallet)) failed for not being according to locals laws.

Erm, did you check that betting apps are in line with your local laws?


 i don't have nor the hardware neither the ability to operate a node,

You don't *have* to run a node yourself. You should start on testnet. I'm sure someone has a public API node there.

The idea is to bring a new interpretation of the blockchain data rather than modify the protocol to adapt to this use case.

Keep in mind that the chain and the original interpretation are still there. In particular, your assets can be traded, which should be aligned with your new interpretation.
Title: Re: D*Match betting in chain
Post by: Elias on October 21, 2019, 05:19:05 pm
I wish to experiment how long can i reach in develop a betting app with BitShares prediction markets.
[...]
* The second project (monotoken (smartasset wallet)) failed for not being according to locals laws.

Erm, did you check that betting apps are in line with your local laws?

The wallet don't have a value as i perceive value, so went to trash (two test accounts harcoded and unable to properly show memo (don't have motivation to complete)).
A betting house cannot operate without license, but this is only tech and will be opensourced.


 i don't have nor the hardware neither the ability to operate a node,

You don't *have* to run a node yourself. You should start on testnet. I'm sure someone has a public API node there.

Sure!  Was a response to "You are setting up a own full node only for PM?"

The idea is to bring a new interpretation of the blockchain data rather than modify the protocol to adapt to this use case.

Keep in mind that the chain and the original interpretation are still there. In particular, your assets can be traded, which should be aligned with your new interpretation.

I wanted to say that, for example, memo can contain metadata which can assist UI clients to recover extra data, like images and so on. (Like watching through colored glasses   8) )

Title: Re: D*Match betting in chain
Post by: Victor118 on October 23, 2019, 03:24:11 pm
Great !
Is a prediction asset can be reusable ?
It's too expensive to create one for every NBA match for example !!

Envoyé de mon WAS-LX1A en utilisant Tapatalk

Title: Re: D*Match betting in chain
Post by: pc on October 23, 2019, 05:25:45 pm
Is a prediction asset can be reusable ?
It's too expensive to create one for every NBA match for example !!

Unfortunately they aren't. This is a known problem.
Title: websocktes broadcast
Post by: Elias on November 02, 2019, 11:27:09 pm
(https://i.imgur.com/0zDv4Hc.png)

* listener app sends updates to d*match node
* node broadcasts to connected clients
* client send signed ops to btshares node

added video in screenshots post with a live session although random data.
Title: Re: D*Match betting in chain
Post by: bench on November 03, 2019, 01:18:05 am
Unfortunately they aren't. This is a known problem.

Is here a update considered ?
Title: Re: D*Match betting in chain
Post by: pc on November 03, 2019, 08:10:44 am
Is here a update considered ?

BSIP-17 describes a possible solution. IIRC it was never voted on, because BSIP-18 was a much easier to do, but for MPAs which were more in focus back then.
Title: Re: D*Match betting in chain
Post by: Elias on November 03, 2019, 09:21:00 pm
(https://i.imgur.com/fDjmM32.png)

Bet odds and their equivalence with a typical market.
Title: Re: D*Match betting in chain
Post by: Elias on November 15, 2019, 08:42:07 am
Byproduct of the websockets comm with nodes:
https://gitlab.com/vanissoft/profit-way

Takes every market in a token list and prints the profitable ones.
In the code there is also a seminal bot.

Making use of Litepresence's manualSIGNING to try async operative.
Title: Re: D*Match betting in chain
Post by: sschiessl on November 15, 2019, 08:58:58 am
Byproduct of the websockets comm with nodes:
https://gitlab.com/vanissoft/profit-way

Takes every market in a token list and prints the profitable ones.
In the code there is also a seminal bot.

Making use of Litepresence's manualSIGNING to try async operative.

Cool for arbitrage? Related to betting how? :)
Title: Re: D*Match betting in chain
Post by: Elias on November 15, 2019, 10:04:48 am
Byproduct of the websockets comm with nodes:
https://gitlab.com/vanissoft/profit-way

Takes every market in a token list and prints the profitable ones.
In the code there is also a seminal bot.

Making use of Litepresence's manualSIGNING to try async operative.

Cool for arbitrage? Related to betting how? :)

jejeje. i wanted the engine to be async, thus i tested server-node comms with queue like pattern.
There are some ops missing in manualSIGNING, like tokens creation/modification, i would like to be implemented with the help of litepresence.
Title: diagram of main components
Post by: Elias on December 10, 2019, 11:34:21 am
(https://i.imgur.com/ifmN9nf.png)

Functions:
* Client Servers:
  * onboarding, account management
  * feeds clients with data extracted from network (BitShares nodes).
* Admin Servers:
  * create and aprove match proposals
  * keep settings and inject them into op memos
    * settings include child tokens for each match and trusted feeders
    * feed prices

Due the need of multiple tokens for each match, meaning the need to keep dozens of them running concurrently, i'm embrace the idea of reusing of tokens and to use normal market operations combined with GS mechanism. There will be time to retract and switch to prediction markets if they turn to be a better solution. (another reason to use normal tokens is to avoid blockchain polution with past matches ).