₩$₿ÐÐ
wei stakes by decentralized degenerates

What is this?

A fully decentralized, blockchain-based web application in which anyone can participate on or create their own betting pools. There are no limits to what you can bet on; any website can be queried against and have the intended result parsed and uploaded to the blockchain.

Show me an example

I'm making things interesting by starting a bet with a 0.25 ETH initial pool. To put my money where my mouth is, and to honor the many hours and dollars I've lost browsing /r/wallstreetbets, I've created a simple starting bet: SPY_GUESS will query Investing.com to extract the price (without decimals) of the well-known S&P 500 index on Saturday, October 9th 2021, 22:00 UTC. You can place a bet on how much you think it will be worth on that date, the deadline to do so is Sunday, October 3rd, 13:00 UTC.

How do I sign up?

You can't! All server communication is delegated to the oracle contract, so using WSBDD is as simple as having MetaMask installed and some funds in your account.

How can I trust you?

You don't have to! The entire source code for the project is available on Github. If that's not enough, you can take a look at the contract's verified code in Etherscan. As for how the results are being fetched, WSBDD relies on Provable's blockchain oracle, one of the oldest and most well-known in the field. In the future, I'd like to further integrate with Provable's authenticity proofs so that anyone can verify that the results of each bet have not been tampered with.

How do I place a bet?

Simply search for the ID of the bet you want to participate in (check the bet's info to make sure everything looks good), write down your result and the amount you're betting, and click the "Bet" button. If you want to bet on more than one result, you can click on the "+" button to pack your bets into a single transaction, saving you time and money. There's a fixed commission for placing a bet of 0.0001 ETH, so don't get alarmed if the amount you placed is not the exact amount you put in. Take a look at the bet in the "Show me an example" section if you'd like to get started right away.

What happens if I win?

First of all, congratulations! After the bet has been executed and the result uploaded to the blockchain, all you need to do is lookup the bet's ID in WSBDD and click on the "Claim Bet" button. Your earnings will be dependent on two factors: your share of the winner's pool, and the bet's commission costs (fixed 0.0001 ETH + a custom % set by the bet's owner). For example, if SPY_GUESS ends up at 4,200 USD and you were the only one betting on that result with 0.001 ETH, you'd get the whole pool minus the 0.0001 ETH fixed commission and the 0.001% commission set by the bet's owner.

What happens if no one wins or if the bet fails to run?

In both cases you can simply reclaim your funds (minus the fixed 0.5% commission), the same way as if you had won the bet.

How do I create a bet?

Click the "New Bet" button and you'll be presented with all the information you need to fill when creating a bet. I recommend caution when adding descriptions, try to keep them short since they quickly increase the cost of the bet creation transaction. If you'd like to get people interested in your bet, a great way to do so is setting an initial pool. This money will be fully refunded to you if no one wins the bet, but it's not associated with any result. SPY_GUESS, for example, has a 0.25 Ethereum starting pool, along with a few example bets I made to demonstrate how everything looks.

How do I format my query when creating a bet?

Let's take a look at an example query: json(https://www.therocktrading.com/api/ticker/BTCEUR).result.0.last

We can divide this query into 3 parts:

  • json(...) - The schema, which specifies the content type of the response from the external service.
  • https://www.therocktrading.com/api/ticker/BTCEUR - The actual URL where we'll be getting our data from.
  • .result.0.last - The path that tells the oracle service how to parse the response and actually extract the result.
If you want to learn more about how to format your URL to extract the intended result, take a look at Provable's documentation. When you're creating a new bet or taking a look at an existing one, look for the "Test Query" button which will let you see how each result gets parsed. Special thanks to Provable for that one, since it's a simple wrapper over their more feature complete version..