<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Degens on Medium]]></title>
        <description><![CDATA[Stories by Degens on Medium]]></description>
        <link>https://medium.com/@degens?source=rss-cddcc4f60514------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*8Dj2WiS-uBd43OXjuE5-eA.png</url>
            <title>Stories by Degens on Medium</title>
            <link>https://medium.com/@degens?source=rss-cddcc4f60514------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:46:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@degens/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Degens v2 Roadmap]]></title>
            <link>https://degens.medium.com/degens-v2-roadmap-b671d168c220?source=rss-cddcc4f60514------2</link>
            <guid isPermaLink="false">https://medium.com/p/b671d168c220</guid>
            <dc:creator><![CDATA[Degens]]></dc:creator>
            <pubDate>Thu, 29 Oct 2020 02:51:57 GMT</pubDate>
            <atom:updated>2020-10-29T02:51:57.780Z</atom:updated>
            <content:encoded><![CDATA[<p>Thank you for the support and excitement around the new <a href="https://degens.medium.com/degens-token-airdrop-34a6f6d4075b">$DEGENS</a> token. We are thrilled to reward our early users, who have been our most important stakeholders wagering over $3 million in volume and $750,000+ in October alone! We couldn’t do this without you! We’d like to announce a roadmap for <a href="https://degens.com/">Degens</a>. Degens v2 will push the boundaries on blockchain based betting and create the ultimate, community based betting experience. Our goal is to roll out Degens v2 in four phases, ending with the protocol being completely in the hands of the $DEGENS community.</p><p><strong>Phase 0: Staking</strong></p><p>We will enable the staking of $DEGENS tokens in return for fees that the protocol generates. Specifically, 75% of protocol fees will go directly to token holders who stake their $DEGENS in the upcoming contract. The other 25% is held in the treasury for development and recurring maintenance costs. This is the first step before phase 1 community based grading goes live, where stakers will also help decentralize and secure the protocol.</p><p>For reference, there is currently an average 0.5% fee on winning wagers (0.25% of total claim amount).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*49luKIQNWV31bXBe" /><figcaption><em>All time Degens volume (excluding SportCrypt)</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/0*Moib5HgVviI_xBES" /><figcaption><em>2020 month by month volume</em></figcaption></figure><p><strong>Phase 1: Community Based Grading</strong></p><p>To date, grading has been completed through various APIs and independently verified through a multi-sig across team members. This approach has allowed us to maintain an appropriate compromise between speed and accuracy. We are in active research on delivering a system that would further decentralize the grading process while maintaining speedy resolution times.</p><p><strong>Phase 2: Layer 2</strong></p><p>We can’t stand when the demand for applications causes gas fees to spike. While gas fees are less meaningful to large bettors, it can be painful for smaller gamblers. Degens v2 will use layer 2 scaling techniques to decrease gas for all users. Importantly, we will not sacrifice decentralization or permissionless access to the platform.</p><p><strong>Phase 3: Community Governance</strong></p><p>When the protocol is sufficiently decentralized, protocol fees will be fully controlled and governed by token holders, allowing token holders themselves to vote for the fee rate distribution path. At this point, the Degens protocol and treasury will be completely in control of and governed by the $DEGENS community.</p><p>We hope this has helped you understand our future plans for Degens. We appreciate any suggestions, feedback, or questions. Please find us on <a href="https://twitter.com/DegensBet">Twitter</a> or in the <a href="https://t.me/joinchat/H9VK_xKZrN_WTlBTVowpCg">Telegram</a> channel.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b671d168c220" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DEGENS Token Airdrop]]></title>
            <link>https://degens.medium.com/degens-token-airdrop-34a6f6d4075b?source=rss-cddcc4f60514------2</link>
            <guid isPermaLink="false">https://medium.com/p/34a6f6d4075b</guid>
            <dc:creator><![CDATA[Degens]]></dc:creator>
            <pubDate>Sat, 24 Oct 2020 20:50:03 GMT</pubDate>
            <atom:updated>2020-10-24T20:59:56.833Z</atom:updated>
            <content:encoded><![CDATA[<p>Since 2017, <a href="https://degens.com/">Degens</a> (previously known as SportCrypt) has been the #1 sports betting exchange on Ethereum. Players love that Degens never touches their money, betting happens directly from their Ethereum wallet using DAI and ETH, that we cannot censor winners, and that we have the industry lowest fees averaging 0.5% on winning wagers.</p><p>It has been a long-standing goal of ours to build up a community-based grading system. To do this, we’ve deployed an ERC-20 token named <strong>DEGENS</strong> at address <a href="https://etherscan.io/token/0xdd039990bd551ce7437d3bf54d155220b7988b71">0xdd039990bd551ce7437d3bf54d155220b7988b71</a>. To distribute the tokens we’re doing a uniswap-style airdrop to distribute tokens to everyone who has ever placed a bet on SportCrypt or Degens, or interacted with our smart contract via a bot or custom interface.</p><p>The DEGENS supply is fixed at 1,192,720 tokens, of which 269,185 (22.5%) are being airdropped. Everyone who used our smart contract prior to Ethereum block 11,111,111 can claim 20 tokens plus 5 tokens for every interaction, up to a maximum of 5,000. Go ahead and <a href="https://degens.com/my/tokens">claim your tokens today</a> in the degens.com interface!</p><p>The remainder of the tokens will be vested over 1–4 year periods and are owned by the founders, investors, and our growing team (most of whom started out as users of our platform). As these tokens vest, we will be contributing more of them to a market making rewards system, which will align participants with our platform’s goals moving forward:</p><ul><li>Great odds</li><li>Big markets</li><li>Accurate and timely grading</li></ul><p>We are not selling DEGENS tokens and we don’t consider them to have any inherent value, but they will be useful to participate in the growing Degens community, and allow token possessors to earn profit by helping to grade events.</p><p>Thank you to everyone who has supported the Degens project over the years!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34a6f6d4075b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Impact of the Istanbul hard-fork on a sports betting contract]]></title>
            <link>https://degens.medium.com/impact-of-the-istanbul-hard-fork-on-a-sports-betting-contract-ba5aeb738429?source=rss-cddcc4f60514------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba5aeb738429</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[sports-betting]]></category>
            <dc:creator><![CDATA[Degens]]></dc:creator>
            <pubDate>Fri, 10 Jan 2020 17:09:59 GMT</pubDate>
            <atom:updated>2020-01-10T17:09:59.832Z</atom:updated>
            <content:encoded><![CDATA[<p>The Ethereum network recently executed a non-controversial hard-fork named <a href="https://eips.ethereum.org/EIPS/eip-1679">Istanbul</a>. This was a fairly minor upgrade and didn’t make any user-visible changes, however it did change the gas costs for various operations.</p><p><a href="https://degens.com/">Degens</a> is a sports betting exchange built on Ethereum. Since our users are, well, degens, they like to place a lot of bets. We’d like to keep the gas costs as low as possible. This post will look at how Istanbul affected our smart contract, and tries to make a case for a potential future enhancement for Ethereum (which would require a new hard-fork).</p><p>TLDR: Using the Degens contract is slightly cheaper thanks to Istanbul, and in certain cases is considerably cheaper. If you’re interested in the technical explanation of why that is, keep reading.</p><h4>Calldata became cheaper</h4><p>Before the fork, transaction senders had to pay 68 gas for every byte in their calldata (except for 0 bytes, which only cost 4 gas each). Calldata is used when invoking functions on smart contracts, and it contains all the parameters to the smart contract call. In Degens, this includes the hash of the match you are betting on, how much you’d like to bet, and the signed orders created by your betting partner(s).</p><p>After the Istanbul fork, each calldata byte now costs 16 gas (except for 0 bytes, which remain 4).</p><p>This means that when you make a trade against a single order, you pay about 9k less gas, and for every additional order you add to the calldata, you save an additional 6k (yay!).</p><p>Why are 0 bytes handled differently than non-0 bytes? This is explained in the <a href="https://github.com/ethereum/wiki/wiki/Design-Rationale#gas-and-fees">Ethereum whitepaper</a>:</p><blockquote>we saw that most transaction data in contracts written by users was organized into a series of 32-byte arguments, most of which had many leading zero bytes, and given that such constructions seem inefficient but are actually efficient due to compression algorithms, we wanted to encourage their use in place of more complicated mechanisms which would try to tightly pack arguments</blockquote><p>Since the Istanbul fork, 0 bytes have become proportionally more expensive. Previously they cost about 6% of a non-0 byte, but now they cost 25%, which may cause some contract designers to re-evaluate the benefits of “tightly packing” arguments. For the Degens contract, our <a href="https://degensprotocol.github.io/docs/#/protocol?id=execution-packed">execution-packed encoding</a> and <a href="https://degensprotocol.github.io/docs/#/protocol?id=signature-packing">signature packing</a> save gas since unpacking is really just shifting and bitwise-ANDing, which is inexpensive compared to calldata (both pre and post Istanbul).</p><h4>SLOAD became more expensive</h4><p>The Istanbul changes are not all sunshine and roses though. Certain contracts are more expensive to use, particularly if they do a lot of storage reads, because the SLOAD operation increased from 200 to 800 gas.</p><p>The Degens contract does about 20 SLOAD operations per trade, meaning you are charged about 12k more gas (boo!). This eats up all the savings from calldata, and then some.</p><p>Why do we need to do so many SLOADs? The contract needs to read the current positions for each party to the trade and the current token balances and approvals for each party, whether the match has been finalized, the current fill status of the order, and whether the order creator has issued a cancelAll. In addition, it also redundantly re-reads many of these same storage slots again in order to update them, because most of the updates are adding onto the previous values (with+= ).</p><p>In some cases these redundant loads could be avoided by caching the values in memory (like with previous positions, filledAmount), but in others they are unavoidable since the additional SLOADs happen in the token contracts, not in Degens. Even in the avoidable cases, caching these values in memory would complicate the code and, as a consequence, might introduce security vulnerabilities. At the end of this article we will try to make the case for an modification to Ethereum that would improve this situation.</p><p>A note about expensive SLOADs: Most contracts that implement EIP712 compute the EIP712_DOMAIN in the constructor by hashing address(this) etc, and then writing it to storage. We do not do this. If you read our <a href="https://etherscan.io/address/0x8888888883585b9a8202db34d8b09d7252bfc61c#code">smart contract source code</a>, you’ll see that the source code includes the contract address as a hex literal, which is hashed into the domain at compile-time. This sometimes causes confusion, and we’ve even heard claims that it is impossible/will never work. Of course, contract addresses are deterministically generated from the deployer’s address and nonce so it’s easy to pre-compute them before deployment. But why did we choose to do it this somewhat convoluted way? Because, by embedding the pre-computed domain in the contract byte-code, we avoid performing an SLOAD operation for each EIP712 signature verification, which now saves 800 gas per transaction (or, naively, per trade).</p><h4>SSTORE became cheaper (sometimes)</h4><p>Considering the previous two changes, Istanbul is so far a net-negative for us. Fortunately, there is one other relevant update in Istanbul. Previously, each storage write operation would cost a significant amount of gas. It would either cost 20k (for changing a value from zero to non-zero) or 5k (for “re-setting” an already non-zero value). There is also a gas refund available for clearing storage, but we’ll ignore that for now.</p><p>Often contracts will write to the same storage slot multiple times within a single transaction. For example, consider a simple smart contract function that sends some amount of a token to 2 separate addresses. It will do this by calling transfer() for the first recipient, which decreases its balance storage slot in the token contract, and then calling transfer() again for the second recipient, which again decreases the same storage slot in the token contract.</p><p>Because storage writes are expensive, some contracts would cache values in memory and only write them out at the very end, so that they only execute a single SSTORE. Unfortunately, this complicates the smart contract code and thus can result in bugs (<a href="https://medium.com/@mcateer/compounds-self-liquidation-bug-829d6571c2df">as was the case in Compound</a>).</p><p>To improve the situation, Istanbul changes how SSTORE accounting works. Instead of each SSTORE operation being accounted for independently, the total number of storage slots modified in the transaction is tracked, and this determines the cost (actually each individual SSTORE does still cost 800 gas, but this is down from 5k). This discount is referred to as “net metering”. In other words, you’re only charged for the number of storage slots that are actually different at the end of the transaction from what they were at the beginning.</p><p>In the Degens contract, the simple case of two parties entering into a bet requires that tokens are moved by calling transferFrom() twice, once for each party. This results in two separate modifications to the smart contract’s balance inside the token contract’s storage. Because of net-metering, we save 5000 – 800=4200 gas (yay!). For a simple trade, this final reduction brings us about 1k gas under where we were pre-Istanbul.</p><p>But it gets better: As transactions get more complicated, the savings due to net-metering SSTORE increase. For example, consider this bet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*CoKdYIjZTfnyq0EHeALwYg.png" /><figcaption>Trade against 2 orders</figcaption></figure><p>Because the first order wasn’t large enough to satisfy the desired bet size, the light green guy included 2 orders in the transaction, which resulted in 2 separate trades. This is depicted as 1 entry in the Degens activity history, but you can see that it is in fact 2 trades because there are two Blockie identicons on the right side of the handshake.</p><p>In this case, we pay only 5000 + 800*3 = 7400 gas to update the Degens balance whereas before it would cost 5000*4 = 20000, for a savings of 12600 gas. Not only that, but the light green guy’s position and token balance are also updated twice (one for each trade) which gives us another 8400 in savings. These savings scale as we include more orders, and fortunately they scale faster than the offsetting increase in SLOAD prices.</p><p>We get an even better savings when orders are matched by an arbitrageur. For example, take a look at the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*z7iQlYKrDVV1MuHq-mBvWg.png" /><figcaption>Matching 2 orders</figcaption></figure><p>In the above, the running guy took two orders with opposite directions and overlapping odds and matched them together. The way this works under the hood is that the runner makes a trade against the first order, and then another against the second order. Because the first trade results in a position, and the second results in that position being sold off, not only do we get the benefits described previously, but we also put the runner’s position back to what it was before, which means we hardly pay anything for the intermediate position storage writes!</p><h4>A case for net-metering of SLOAD</h4><p>As described above, our contract redundantly re-reads storage locations. In some cases, we could cache these values at the expense of a more complicated smart contract. But in other cases we could not, either because the SLOAD is done by another contract, or because another contract (that we called) may have modified it since.</p><p>The phenomenon of “recently read data will probably be re-read soon” shows up often enough to have a name: <a href="https://en.wikipedia.org/wiki/Locality_of_reference">temporal locality</a>. Generally, it is optimized for by using a cache.</p><p>An improvement I think we could make to Ethereum would be to implement a sort of “net-metering” for SLOAD as well as SSTORE operations. In this case, transactions would be billed for the number of distinct storage locations they access, as opposed to the number of SLOAD operations they perform (though probably each SLOAD itself would have a minimal cost, as with SSTORE).</p><p>Although I haven’t examined the various EVM implementations closely, I believe it shouldn’t be difficult to cache values previously read in a transaction in case they are read again. Successive SLOAD operations of the same addresses should then be quite inexpensive, and gas prices could reflect that.</p><p>In the case of Degens, a net-metering of SLOAD operations would save about 6k gas per trade. I imagine many other contracts would benefit also.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba5aeb738429" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Betting without ETH: DAI’s new permit feature]]></title>
            <link>https://degens.medium.com/betting-without-eth-dais-new-permit-feature-5517293f3246?source=rss-cddcc4f60514------2</link>
            <guid isPermaLink="false">https://medium.com/p/5517293f3246</guid>
            <category><![CDATA[sports-betting]]></category>
            <category><![CDATA[makerdao]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[dai]]></category>
            <category><![CDATA[meta-transactions]]></category>
            <dc:creator><![CDATA[Degens]]></dc:creator>
            <pubDate>Wed, 04 Dec 2019 15:10:10 GMT</pubDate>
            <atom:updated>2020-03-22T04:29:34.253Z</atom:updated>
            <content:encoded><![CDATA[<p>When starting out on <a href="https://degens.com/">Degens</a>, a common point of confusion is the concept of “gas”. Since space in each block of the Ethereum blockchain is a limited resource, transactions must pay a certain amount of ETH as a gas fee in order for them to be processed.</p><p>But what happens when somebody sends DAI tokens to a new user who has no ETH? Unfortunately this user is unable to use these tokens on most dApps because they are required to create transactions, and this requires ETH to pay for the transaction’s gas usage.</p><h4>Meta-transactions</h4><p>Some dApps, such as Degens, allow other parties to process transactions on behalf of users. Instead of having to create regular transactions, users are requested to sign messages, which doesn’t require any gas. As long as the contracts understand these signed messages, other parties can create the actual transactions that will be sent to the blockchain.</p><p>The common name for a message of this type is a <a href="https://medium.com/@austin_48503/ethereum-meta-transactions-90ccf0859e84">meta-transaction</a>. You may have already used this feature on Degens. You can simply press the “Make” button on your betslip instead of “Take”, and then you are prompted to sign a message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*cd0M2l7QSs0r1n3IX4CQ_g.png" /><figcaption>Click “Make” to bet without paying gas</figcaption></figure><h4>Approvals</h4><p>The above works nicely if you have a balance in DAI and have approved the contract to access this balance. That’s the catch though! In order to approve the contract, you need to create an ethereum transaction, which requires ETH.</p><h4>Permit</h4><p>Thankfully the folks at MakerDAO realized that this step is a big speed bump in terms of user on-boarding, and have added meta-transaction support to the DAI contract in the form of a new function called permit (<a href="https://github.com/makerdao/dss/blob/b1fdcfc9b2ab7961bf2ce7ab4008bfcec1c73a88/src/dai.sol#L114-L138">see the code here</a>). This new feature allows the approval process to be done by a separate party, same as our bet on the Rams above — no ETH needed!</p><p><strong>WARNING: </strong>When you approve a contract, either by sending a transaction or using the new permit meta-transaction method, you are allowing that contract total access to your DAI funds. You should always make sure that any contract you approve is verified on etherscan and has been audited by a reputable auditing organization. For Degens, you can see <a href="https://etherscan.io/address/0x8888888883585b9a8202db34d8b09d7252bfc61c">our contract on etherscan</a>, and read <a href="https://medium.com/@Degens/degens-smart-contract-be3704bf186d">our Quantstamp audit results</a>.</p><p>A new user’s approving experience is really simple. All they need to do is click the unlock button in the Account drop-down, and sign the Permit message in the Metamask pop-up:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pug5L74bQvdAJp_VOeRfEQ.png" /><figcaption>Approve the Degens contract — no ETH needed!</figcaption></figure><h4>Simplifed betting flow</h4><p>Users who have 0 ETH can’t click the Take button because this will try to create a new transaction. So in this case we just show a single “Bet” button to avoid confusion:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*qgFP990uPfdmZCKTNLTLYQ.png" /><figcaption>Simplified betting flow: No Make/Take, just Bet</figcaption></figure><p>For users who <em>do</em> have ETH, what is the difference between making and taking?</p><ul><li><strong>Make/Bet: </strong>This creates a new order and is the easiest way to get started. You don’t need to pay any gas fees, but you also don’t have control over how quickly your bets will be confirmed. You always receive exactly the odds you specify in the odds input.</li><li><strong>Take: </strong>This creates a new transaction and is for more advanced users. Although you will have to pay gas fees, you can control how quickly your transaction is mined by increasing the gas price, and you may receive slightly better odds.</li></ul><p>Meta-transaction (“make”) bets work almost exactly the same as “take” bets. While you are waiting for a bet to be confirmed, “make” bets will appear in the Orders tab, and “take” bets will appear in pending section of the Transactions tab. After a bet is confirmed, there is no difference at all — a position is a position.</p><h4>What does it look like?</h4><p>One of our core principles in Degens is transparency. In the activity screen you can see exactly who is betting on what, with who, and (if applicable) who fulfilled the meta-transaction. For example, here is a bet on the Recent Activity screen (click on the volumes at the top of the website):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OIRmLJAC1f9GL6ZmN8mJow.png" /><figcaption>Recent Activity (click on the volume numbers at the top of <a href="https://degens.com/">degens.com</a>)</figcaption></figure><ul><li>The dark green guy on the left of the hand-shake is somebody who made a “make” bet.</li><li>The bet was matched between orders previously created by redman and the purple guy.</li><li>The light green “runner” is the address who submitted the meta-transaction to the blockchain (and may earn an arbitrage profit for doing so).</li></ul><p>You can click on any of the icons to visit the etherscan page for that address.</p><h4>Use permit in your own dApps!</h4><p>Because we think many other dApps would benefit from implementing similar functionality, we have pushed the javascript code that implements the permit feature to <a href="https://github.com/degensprotocol/degens-jslib/blob/master/PermitToken.js">our github repository</a>. Come on <a href="https://t.me/joinchat/H9VK_xKZrN_WTlBTVowpCg">our telegram</a> and let us know if it was useful to you, or if you need extra integration help!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5517293f3246" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DAI Migration]]></title>
            <link>https://degens.medium.com/dai-migration-ea54d3461e5b?source=rss-cddcc4f60514------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea54d3461e5b</guid>
            <category><![CDATA[dai]]></category>
            <category><![CDATA[degen]]></category>
            <category><![CDATA[migrate]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Degens]]></dc:creator>
            <pubDate>Mon, 18 Nov 2019 21:53:24 GMT</pubDate>
            <atom:updated>2019-11-19T14:39:42.779Z</atom:updated>
            <content:encoded><![CDATA[<h3>DAI Migration, step-by-step with screenshots</h3><p>Today, MakerDAO has released the next version of their USD-pegged stable-coin. This release has some exciting new features:</p><ul><li>DAI will now be backed by multiple assets, not just ETH</li><li>You can now earn interest on your DAI when you’re not using it by locking it into the <a href="https://defipulse.com/blog/dsr-dai-savings-rate/">DAI Savings Rate</a> contract</li><li>A new way to approve a contract without needing any ETH (coming soon to degens: DAI-only onboarding and trading!)</li></ul><p>As a DAI holder, here is what you should know about the transition:</p><ul><li>The old token is being renamed to SAI, so your existing balance is now denominated in SAI</li><li>A new DAI contract has been created, and everyone should start using this one instead</li><li>Your old SAI tokens can be swapped one-to-one for new DAI tokens at the <a href="https://migrate.makerdao.com/">MakerDAO DAI Migration site</a></li></ul><h4>Migration Walk-Through</h4><p>In case it helps, we’ve create a quick screenshot walk-through to help you through the process. We’re using Metamask, but the process should be similar on any wallet.</p><p>First, on <a href="https://degens.com/">degens.com</a>, you’ll notice that your old balance is now in SAI tokens (S), and there is a new DAI entry:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ys2ODnXzDSYplaDO6k6Uvg.png" /><figcaption>Degens account drop-down</figcaption></figure><p>Click on the <a href="https://migrate.makerdao.com/">Convert your SAI to DAI</a> and it will take you to the official MakerDAO migration tool:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o0PN_xMupBt8j1H6Gj4dzQ.png" /><figcaption>Choose a wallet</figcaption></figure><p>Select MetaMask and you should see a list of migrations that you can do. Most users will just see Single-Collateral SAI Upgrade:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*yOqz3hUsQo5CEPw1P6L7HA.png" /><figcaption>SAI upgrade</figcaption></figure><p>Next you should choose how much of your SAI you’d like to migrate. Usually you’ll want to migrate it all, so click “Set Max” and then the Continue button:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F8Qh5KL_RRGV3bhJLgVSOg.png" /><figcaption>How much to migrate?</figcaption></figure><p>Next you’ll see a confirmation screen. You will probably need to Unlock SAI, so click that slider to approve the migration contract access to your funds. It will open a MetaMask dialog:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQ_RVpiycy8xaReXbRnUog.png" /><figcaption>Approve the SAI migration contract</figcaption></figure><p>Once that transaction confirms, click the Terms of Service checkbox and press the Continue button. Another MetaMask pop-up will appear:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O2wCUTHaGtSK4IKOIVrjTA.png" /><figcaption>Actually migrating your funds!</figcaption></figure><p>Once that transaction confirms, you’re all done:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jb3pc7IHLadmuiJwIJEogA.png" /><figcaption>All done!</figcaption></figure><p>Last step is to go back to degens and unlock the DAI contract:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LfyQl_kkoN2Xvbg6n7yWuQ.png" /><figcaption>Unlock DAI in Degens</figcaption></figure><p>You’re all set!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jT1IETnDhSPDBggp6T_PjA.png" /><figcaption>Grinding it out, all DAI long</figcaption></figure><p>Come check us out at <a href="https://degens.com/">degens.com</a> and experience the most fun way there is to use your DAI!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea54d3461e5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Degens: The Ethereum Betting Exchange]]></title>
            <link>https://degens.medium.com/degens-the-ethereum-betting-exchange-4004b99d4281?source=rss-cddcc4f60514------2</link>
            <guid isPermaLink="false">https://medium.com/p/4004b99d4281</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[degen]]></category>
            <category><![CDATA[sports-betting]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Degens]]></dc:creator>
            <pubDate>Wed, 02 Oct 2019 18:58:57 GMT</pubDate>
            <atom:updated>2019-10-02T18:58:57.403Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve been following this blog, you know we’ve been working hard on our new protocol. Thanks to a generous grant from MakerDAO, our new site is now live and ready for beta testing! More on that below, but first we’d like to take a quick look back at the history of our project.</p><h4>SportCoin</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*pe2lcFP4igaCkfDG-5m9mQ.png" /><figcaption>2012: SportCoin</figcaption></figure><p>Little known fact: In 2011–2012 we built a system called SportCoin. It had several of what we consider <a href="https://medium.com/@Degens/desirable-aspects-of-sports-betting-dapps-6aef34a0713a">the fundamental features</a> of crypto betting exchanges. Users could bet with cryptocurrency, post their own odds, earn and withdraw realized profits before games even started, and trade conveniently from a web interface.</p><p>However, SportCoin had one enormous flaw: It was entirely centralized. Users would have to send us bitcoin, which we would store in our wallet. When a user would like to withdraw, they’d just have to trust that we were securely holding their funds and would honestly fulfil their request.</p><p>Really SportCoin was no better than incumbent exchanges like BetFair, except for the fact that users could use Bitcoin instead of fiat currency. This was an incremental improvement over the status quo, but not a categorical leap of any sort. Because of this we didn’t have much enthusiasm for the project and stopped work on SportCoin sometime mid-2012.</p><h4>SportCrypt</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*AV_OGrs-xZPV4-SAvjpqRA.png" /><figcaption>2017: SportCrypt</figcaption></figure><p>After Ethereum launched, we realized that it is the solution to many of the problems we saw in SportCoin. Rather than us being responsible for holding our users’ funds, this could be handled by a special program known as a “smart contract”. With a smart contract, even if we wanted to we would be unable to steal user funds held in balance.</p><p>The mental model we like to use for smart contracts is to consider our database open and publicly accessible. Unlike centralized systems where access to the database must be diligently guarded, decentralized applications (“dapps”) turn this model inside-out. The database is accessible to everyone because it lives on a shared infrastructure known as the blockchain. Furthermore, users can interact with the database on their own terms, using their own software if they so prefer.</p><p>This <em>is</em> a categorically new way of building systems and requires re-thinking many assumptions. For example, the entire concept of having accounts with passwords and recovery emails goes away, which greatly improves privacy (something often important for sports bettors). Similarly, because we aren’t accepting customer funds, it is no longer necessary to collect payment information or deal with chargebacks, fund transfer delays, payment processor freezes, compliance requirements, or the many other pitfalls of handling money.</p><p>When we launched SportCrypt in 2017, we weren’t sure if anyone was going to use it. We had a clunky user interface, the way we handled data flow was slow and inefficient, and we had next to no tools for market makers, white-labels, arbitrageurs, or pro-users.</p><p>But what happened exceeded our expectations. We’ve had millions of dollars worth of ETH traded, and have a growing set of users, many of whom really like the product. To all of you reading: THANK YOU! Your encouragement and feedback has kept us moving forward.</p><h4>Degens</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*9kbygtr2w5rxAlwu8ug8ww.png" /><figcaption>2019: Degens</figcaption></figure><p>We’ve learned a lot from building SportCrypt. First of all, the brand name isn’t ideal. Often it’s mis-typed as Sport<strong><em>s</em></strong>Crypt or SportCrypt<strong><em>o</em></strong>. What’s worse, there are tons of other sites named some combination of the words “Sports”, “Crypto”, and “Bet”.</p><p>To help differentiate ourselves, we decided to create a new brand: <strong>Degens.</strong> This is a <a href="https://www.urbandictionary.com/define.php?term=Degen">humorously self-deprecating term</a> (short for “degenerates”) that originated in the poker and sports betting communities, and we feel it is a unique, fresh and fun name that will help our product stand out.</p><p>Our new brand also comes with a fun new mascot! Say hello to Fat Tony:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*FyGX-abszS6O0Fdtzi_yLA.png" /></figure><h4>MakerDAO</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*5WgYA2aAGHYOJgfBuhm8-g.jpeg" /><figcaption>MakerDAO — These guys rock</figcaption></figure><p>To help us realize our vision, <a href="https://makerdao.com/">MakerDAO</a> has generously provided us seed funding through their <a href="https://community-development.makerdao.com/">community grant program</a>. This has allowed us to do a major update of the SportCrypt infrastructure:</p><ul><li>Users can now bet with <strong>DAI</strong>, the leading stable-coin asset</li><li>Our smart contract has been <a href="https://medium.com/@Degens/degens-smart-contract-be3704bf186d">audited by Quantstamp</a>, a highly respected blockchain security firm</li><li>We’ve developed a “mesh” protocol that allows us to distribute the orderbook across many nodes around the world</li><li>We’ve upgraded our servers and are distributing their locations geographically for better performance for our global user-base</li><li>Mobile-first: Our website has been reconfigured to provide first-class support to mobile browsers such as Trust Wallet and MetaMask Mobile</li><li>Language translations: Our interface will soon be translated into several languages so we can be accessible to a wider audience</li><li>New market making tools are in the works which will make it much easier to run market making businesses on top of the protocol</li></ul><p>Big <strong>thank you </strong>to MakerDAO for your support. It has been a pleasure and privilege to be working with you guys!</p><h4>Timeline for 2019</h4><ul><li>Oct 1st (today): <a href="https://degens.com/">degens.com</a> is live on mainnet! Adventurous users can give it a try right now. Please report any bugs or other suggestions, and excuse us while we iron out the issues that will inevitably come up.</li><li>Oct 15th: We will release the source code for “bookie-kit”, a program for market making on top of the degens protocol. It will include a base class and examples for connecting to odds providers, adding/reducing mark-ups, and posting your own orders to the degens network. In addition there is also a web interface that makers can use to control and monitor their books.</li><li>Nov 1st: We will release the code for “degens mesh”. This will allow anyone to mirror the orderbook for improved latency, archival purposes, or to participate in the network in other ways. For instance, arbitrage bot operators and matching-mode relayers will likely choose to run their own specially-configured nodes.</li><li>Dec 1st: We will release the code for “whitelabel-kit”. This is a set of javascript files and react components that will allow anyone to make a custom-branded interface that uses the degens protocol as a liquidity and hedging source.</li></ul><h4>Three-Pronged Strategy</h4><ul><li><strong>Supply-side</strong>: In order to create a vibrant market, there needs to be liquidity. This is where bookie-kit comes in. With it, users can run bookmaking businesses on top of the degens protocol. They can either take advantage of the open-source plug-ins we provide or, if they are technically inclined, develop their own proprietary rate-source connectors and/or trading algorithms.</li><li><strong>Distribution: </strong>The degens mesh software will allow low-risk business models to be built on top of the protocol. These can be based on arbitrage, or by implementing various <a href="https://degensprotocol.github.io/degens-contract/protocol.html#provider-strategies">provider strategies described in our protocol documentation</a>. In addition to improving market efficiency, this will help to decentralize and strengthen the network.</li><li><strong>Demand-side</strong>: The <a href="https://degens.com/">degens.com</a> web interface should be familiar to anybody who has used betting exchanges such as BetFair or Matchbook. However, not everybody will be comfortable with such a design. With our whitelabel-kit, entrepreneurs will be able to focus on building great front-end interfaces and tap into the degens protocol as a liquidity source to collect risk-free profits by atomically hedging user orders.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4004b99d4281" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Degens Smart Contract]]></title>
            <link>https://degens.medium.com/degens-smart-contract-be3704bf186d?source=rss-cddcc4f60514------2</link>
            <guid isPermaLink="false">https://medium.com/p/be3704bf186d</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[quantstamp]]></category>
            <dc:creator><![CDATA[Degens]]></dc:creator>
            <pubDate>Wed, 11 Sep 2019 23:38:36 GMT</pubDate>
            <atom:updated>2019-09-11T23:38:36.402Z</atom:updated>
            <content:encoded><![CDATA[<p>Today we’re releasing the smart contract for the Degens betting exchange platform:</p><ul><li><a href="https://github.com/degensprotocol/degens-contract/blob/master/contracts/Degens.sol">Solidity source code</a></li><li><a href="https://github.com/degensprotocol/degens-contract">Github repo</a></li><li><a href="https://degensprotocol.github.io/degens-contract/protocol.html">Documentation</a></li></ul><p>We genuinely believe in openness and transparency, so will be open sourcing a lot more stuff in the near future, as well as launching the Degens dApp, naturally!</p><h4>Audit</h4><p>In addition to a <a href="https://www.reddit.com/r/SportCrypt/comments/c6ihhp/audit_of_sportcrypt_performed_by_callisto_network/">pro-bono community audit</a> of the original SportCrypt contract, we have now completed an audit by a respected security auditing firm, Quantstamp:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/236/1*5WMEr4GJY_2SAUU7BCdMLA.png" /></figure><blockquote>Quantstamp considers the quality of the code high</blockquote><p>For full details, please read <a href="https://certificate.quantstamp.com/view/degens">Quantstamp’s audit report of the Degens contract</a>.</p><p>Our experience with Quanstamp was very good. They were professional and thorough, even on the short-timeframe deadlines we requested. As a consequence of the audit, we’ve developed<a href="https://github.com/degensprotocol/degens-contract/blob/master/t/z3/exposureDelta.py"> a test using the Z3 constraint solver</a> to verify some aspects of the contract execution.</p><h4>New features</h4><p>Although it’s based heavily on SportCrypt, there are a few new features in the Degens contract that we will use to improve the performance, user experience, and other aspects of the system:</p><ul><li><strong>ERC-20 token support</strong>: One of our most common feature requests has been to add support for betting in tokens other than ETH. In particular, DAI from MakerDAO has been a common request, since people are worried about the price volatility that comes along with ETH. The Degens contract does not hard-code token addresses anywhere, so we won’t require any contract upgrades when multi-collateral DAI is deployed, and also gives us the option to support related tokens such as cDAI, if there is sufficient user demand.</li><li><strong>Decentralized contract</strong>: The SportCrypt contract has trusted “owner” and “admin” addresses. While these addresses could never do nefarious things like steal user balances, they still represented a point of centralization in the system. We’ve gotten rid of them in Degens. Now the contract gives no special privileges to us, or any other address. There is still an aspect of trust in selecting trusted graders that will decide the outcomes of matches, but the smart contract itself can be used on equal terms by anybody, even potentially competing exchange or sportsbook platforms. You can read more about how this works in our protocol <a href="https://degensprotocol.github.io/degens-contract/protocol.html#oracles">documentation</a>.</li><li><strong>Batched trades</strong>: In SportCrypt, when you clicked “take” you could only attempt to trade against a single order per transaction. While it was technically possible for sophisticated users to use a proxy smart contract to batch trades, this is something that we want to allow everyone to do through the UI. Now, you can specify multiple orders to be traded on in the same transaction. By ordering them by price, you’ll ensure you get the best possible odds by filling the best orders first.</li><li><strong>Order matching</strong>: Occasionally, the SportCrypt orderbook would have “crossed prices,” meaning that a bid is actually for a higher price than an ask. This could happen due to a market maker making a mistake (which we are working on preventing with a smarter UI), but most commonly it happens just as a natural course of events when two users price an event differently. In SportCrypt, an arbitrage bot could execute both trades (even atomically, using a proxy smart contract), but it would require sufficient collateral to execute one of the trades. The Degens contract provides a way to do this without needing any collateral. This should result in a more efficient market, as well as allowing us to implement some improved types of UI experiences such as “gas-less bets”.</li><li><strong>Cancel All</strong>: In SportCrypt, it was impossible to cancel multiple orders in a single transaction, requiring users to execute multiple transactions to do so. Now this can be done in a single transaction, and the next version of our GUI has a button labelled “Cancel All”, but affectionately known as the “panic button”.</li></ul><h4>The Future</h4><p>We’re really excited to show everyone the next iteration of SportCrypt, so please subscribe to our Medium/Twitter/Reddit, and keep checking <a href="https://degens.com/">degens.com</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be3704bf186d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Odds Formats]]></title>
            <link>https://degens.medium.com/odds-formats-7f3379b4716?source=rss-cddcc4f60514------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f3379b4716</guid>
            <category><![CDATA[sports-betting]]></category>
            <category><![CDATA[odds-and-betting]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Degens]]></dc:creator>
            <pubDate>Wed, 21 Aug 2019 22:52:39 GMT</pubDate>
            <atom:updated>2019-08-21T22:52:39.412Z</atom:updated>
            <content:encoded><![CDATA[<p>Degens and SportCrypt allow you to choose how your odds are displayed amongst several possible formats. This article will describe the different odds formats we offer, and will hopefully help you pick which one you prefer to use.</p><h4>What are odds?</h4><p>First of all, although most of our readers will know this, we’ll quickly describe what odds actually represent and why they are so important to understand when betting.</p><p>Odds represent the amount of money you stand to win relative to how much you must risk. On a betting exchange like Degens, odds are offered by users and it is up to other users to decide whether they would like to accept these offers.</p><p>Because users are competing to provide the best offers, the offers at the top of the orderbook are usually close to what the market believes to be a fair value for an event. The fair value should reflect the underlying probability of an event, because most users are trying to maximise their long-term profit.</p><p>This is very similar to what happens on a stock exchange, for example, which is why sites like BetFair and Degens are called betting exchanges. For this reason, we sometimes call odds “prices”.</p><h4>Fractional odds</h4><p>Also known as traditional odds, this is usually what is assumed in day-to-day speech, as in “I’d give 10 to 1 against him showing up”. When the first number is bigger than the second number, the outcome is considered unlikely.</p><p>Although if you pick large enough numbers you can get pretty much any corresponding probability, in practice a relatively restricted set of odds is memorised and bookmakers will choose the closest available odds (rounding in their favour, naturally):</p><pre>50.0%  1-1<br>52.4%  11-10<br>54.5%  6-5<br>55.6%  5-4<br>57.9%  11-8<br>60.0%  6-4<br>61.9%  13-8<br>...</pre><p>Except for UK bookmakers and certain horse race bets, fractional odds are not commonly used today by betting sites. Because it is rarely used in betting exchanges, and also because it is difficult to display nicely in a user interface, fractional odds are not offered by Degens.</p><h4>Hong Kong odds</h4><p>However, we do offer the Hong Kong odds format, which is closely related to fractional odds.</p><p>The idea behind Hong Kong odds is to fix the second number of fractional odds to always be 1 (and omit it), and allow the first number to have decimal places. Given fractional odds, just divide the two numbers together and you have the corresponding Hong Kong odds.</p><p>So, for example, 1–1 (even money) odds simply become “1”, 2–1 odds become “2”, 3–2 become “1.5”, and 2–3 become “0.667”.</p><p>Because they are not represented as fractions, with Hong Kind odds you don’t need to memorise or mentally compare fractions. For example, do you know off the top of your head which is better: 11–4 or 10–3?</p><h4>Decimal odds</h4><p>Most European users will feel more comfortable with what are known as decimal odds. The way that decimal odds are usually explained is that they represent the total amount that you will claim (including your stake) in the event that you win. For example, if you bet $10 at the decimal odds of 2.5, you will receive $25 back (your original stake of $10 plus $15 of winnings). Similarly, if you bet $10 at decimal odds of 1.5, you will receive only $15 back ($10 + $5).</p><p>Decimal odds of 2 represent even money. Numbers less than 2 represent likely events and numbers greater than 2 represent unlikely events. Note that it doesn’t make sense for decimal odds to be ≤ 1 since this would represent a no-win situation for the bettor. So, the odds are bounded in one direction, but not bounded in the other.</p><p>A very useful property of decimal odds is that they are the inverse of their implied probability. For example, given decimal odds of 2, we can calculate the probability of 1/2 = 0.5. Similarly, odds of 3 imply probability of 1/3 = 0.333.</p><p>In order to convert Hong Kong odds to/from decimal odds, simply add/subtract 1. So, for instance, 1.5 (HK) is equivalent to 2.5 (decimal).</p><h4>American odds</h4><p>In America it is most common to express odds in terms of how much must be staked to win 100 units or how much 100 units will win, in the cases of unlikely and likely events respectively. These two cases are distinguished by prefixing the number with either a “-” or a “+” sign respectively.</p><p>For example, american odds of -150 require 150 units to be bet to win 100 units. And odds of +150 will win 150 units given a 100 unit bet. Even money bets are usually expressed as +100 (although -100 would be the same thing).</p><p>A nice aspect of american odds is that they are symmetric. For instance, if you make a bet at +150, the person you are betting with is making a bet at -150. Contrast that to decimal odds where the values are 2.5 and 1.667.</p><p>American odds are usually not expressed with numbers after the decimal point.</p><h4>Indonesian odds</h4><p>Indonesian odds are identical to American odds, except that they represent the amount required to win 1 unit, or will be returned with a 1 unit bet.</p><p>Because of the smaller unit amount, Indonesian odds must be expressed with decimals.</p><h4>Malaysian odds</h4><p>Malaysian odds are based on a 1 unit stake, however the sign means the opposite of American/Indonesian. Negative numbers represent unlikely events and positive numbers represent likely events. Additionally, Malaysian odds are scaled such that they go from 1 to 0 or -1 to 0.</p><p>Malaysian odds are quite elegant, being symmetric and bounded in both directions.</p><h4>Implied probability</h4><p>The final odds type available on Degens is implied probability. As described above, this is just the inverse of the decimal odds.</p><p>Although not common on today’s betting exchanges, implied probability is what the <a href="https://degensprotocol.github.io/degens-contract/protocol.html#prices-and-odds">Degens protocol uses internally</a>, so if you are writing a market making or trading bot, you’ll need to convert your odds to this format when making orders or trades.</p><h4>Choose odds right for you</h4><p>All the odds formats above are just different ways of expressing the same thing. Each has different advantages and disadvantages, but mostly it comes down to personal preference and what you’re used to, so make sure you change your odds preference on your account settings page so you can see the orders available in your preferred format.</p><h4>Tick sizes</h4><p>Recall that with fractional odds bookmakers restrict themselves to a set of practical odds values (and round to the nearest one in their favour). This imposes what is called in financial markets a <a href="https://www.investopedia.com/terms/t/tick-size.asp">tick size</a>, in other words the minimum possible incremental change in odds/prices. In a similar way, the lack of decimals in American odds provides a natural tick size limit.</p><p>Tick size is a sometimes overlooked but important parameter when designing markets. A tick size that is too small will result in less price competition, since you can get to the top of the orderbook with an inconsequential difference in price relative to the current best offer. On the other hand, a tick size that is too large prevents users from making offers at what they believe to be optimal values, and therefore can reduce liquidity. The minimum “spread” between the best bid and best ask (back/lay) is also limited by tick size.</p><p>Tick sizing can often have other second-order effects. For example, large-batch electronics component pricing often must be calculated in increments of 1/7th of an American penny, due to the smallest unit of Chinese currency and a pegged exchange rate.</p><p>Because of the above reasons, many stock markets were converted to a “decimal” pricing system around the turn of the millenium, having previously quoted instruments in 1/16ths of a dollar. Going further back, this was enabled by most currencies themselves being converted to decimal-based currencies, divided into sub-units of 100. Betting markets have similarly followed suit, pioneered by BetFair which since its inception chose to present decimalized odds by default.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f3379b4716" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The true benefit of wallet-to-wallet trading]]></title>
            <link>https://degens.medium.com/the-true-benefit-of-wallet-to-wallet-trading-eea31a58a12d?source=rss-cddcc4f60514------2</link>
            <guid isPermaLink="false">https://medium.com/p/eea31a58a12d</guid>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Degens]]></dc:creator>
            <pubDate>Tue, 09 Jul 2019 20:01:04 GMT</pubDate>
            <atom:updated>2019-07-09T20:01:04.584Z</atom:updated>
            <content:encoded><![CDATA[<p>Wallet-to-wallet trading is a feature of decentralized exchanges where an asset can be transferred directly from one user’s wallet to another user’s wallet within a single transaction. This is an important feature, but, I believe, often misunderstood. Rather than being primarily about security of funds (since this can be achieved in other ways), the true benefit lies elsewhere.</p><h4>Approvals</h4><p>The <a href="https://theethereum.wiki/w/index.php/ERC20_Token_Standard">ERC-20 token standard</a> is an interface to tokens on the Ethereum blockchain. It specifies the functions that a token must implement in order to be compatible with the Ethereum ecosystem.</p><p>The totalSupply() , balanceOf() , and transfer() functions allow users to, respectively: read the total number of tokens that exist, check how many of these tokens an address owns, and send a portion of their tokens to another address.</p><p>In this article we’ll focus on the other set of ERC-20 functions: approve() , allowance() , and transferFrom() . While transfer() provides a way to “push” funds to another address, sometimes instead you would like to authorize someone to “pull” funds from your address using transferFrom(). This can be accomplished by calling approve() with the address you are allowing to pull, and an “allowance” of how much they are allowed to pull (but be careful about <a href="https://ethereum.stackexchange.com/questions/28337/prevent-double-withdrawal-erc20-api-attack">double withdrawal attacks</a>).</p><p>If you approve() a regular Ethereum Externally Owned Account (“EOA”), it is entirely up to the owner of that account’s private key if they would like to pull funds. At any time they could withdraw some or all of the allowance, and you don’t necessarily have any insight into why they are doing this, or have any ability to add extra conditions or restrictions on them. Effectively, this is the same as if you had just sent them the funds with transfer() , except that you have a possibility to “claw back” the funds by reducing their allowance — so long as you get to it first!</p><h4>Smart contracts</h4><p>Ethereum is used to its full potential when we approve a smart contract address, rather than an EOA. By using a contract, rules and conditions can be added. For example, the EtherDelta token exchange requires that you approve() its smart contract to grant it access to your tokens prior to making an order or trade.</p><p>Before approving it, you should carefully review <a href="https://etherscan.io/address/0x8d12a197cb00d4747a1fe03395095ce2a5cc6819#contracts">its verified source code</a>. When you do, you will see that (excepting any bugs or backdoors) it is impossible for the contract, or anyone else, to pull your tokens without in turn providing you another amount of tokens in exchange, and the terms of this exchange are controlled by off-chain signed messages that you and only you are able to create.</p><p>So, as long as you are confident in the smart contract’s implementation, despite approving another address you still haven’t given up control over your tokens. If an issue is noticed with the smart contract, you can always send an Ethereum transaction to reduce your approval and hope that your transaction is mined before the issue is exploited.</p><p>So this is great, right? No third party ever has custody of funds, and token exchange can only happen given certain rules encoded in a smart contract. Yes, but this is only incidentally related to wallet-to-wallet trading, as we will explain in the next section.</p><h4>Deposit contracts</h4><p>Our SportCrypt smart contract has on occasion been criticized because users must deposit their ETH into our contract, rather than allowing it to be traded wallet-to-wallet, which is assumed to be more secure.</p><p>The reason we built it this way is because ETH is not an ERC-20 token, so it doesn’t support approvals, and our contract was created and deployed before <a href="https://weth.io/">Wrapped ETH</a> came into common use.</p><p>But is the way SportCrypt does it actually less secure? As with wallet-to-wallet trading, before you deposit to SportCrypt you should carefully review <a href="https://etherscan.io/address/0x37304b0ab297f13f5520c523102797121182fb5b#contracts">its verified source code</a>. You will see that (again, assuming no bugs/backdoors) users can deposit/withdraw their balance at any point in time by sending Ethereum transactions, and that any access to their balance by other parties can only be via signed messages, similar to EtherDelta.</p><p>So in summary, with both wallet-to-wallet and deposit contracts:</p><ul><li>You must review that a smart contract is written securely, with no bugs or backdoors</li><li>At any time you can credit your balance, either by approving (wallet-to-wallet contracts), or depositing (deposit contracts)</li><li>Nobody can stop you from getting sole access to your funds, either by reducing the approval (wallet-to-wallet contracts) or by calling withdraw (deposit contracts)</li><li>Funds can only be transferred between users according to rules set out in the smart contract</li></ul><p>An actual benefit of wallet-to-wallet trading is that you can see your token balances in your wallet software, up until the time they are “pulled” by an approved contract. But even this is sort of an illusion. ERC-20 token balances don’t actually live <em>in</em> your wallet, they are just entries in a smart contract, similar to a deposit contract. Your wallet software has been specially implemented to check balances in various token contracts, and in principle it could do that for any type of contract, including a deposit contract like SportCrypt, although of course with standards tools like wallets can work together more easily.</p><h4>Contract upgrades</h4><p>Some contracts, notably <a href="https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxyowner">0x protocol version 2+</a>, support upgrading the contract without requiring users to approve() the new code. To some extent this negates the trust-less purpose of smart contracts: Even though 0x’s contract implements wallet-to-wallet trading, the 0x development team has the ability to modify the contract without your permission. In principle, even if you diligently reviewed the 0x source code at the time of approval, they could later add a backdoor, defeating the no-custody feature that makes smart contracts so special.</p><p>That said, the 0x protocol contract requires that the developers give at least a 2 week warning prior to upgrading, which is a balance between granting developers the ability to improve the protocol, and giving users a chance to review the proposed modifications. The down-side for security-conscious users is that they need to constantly monitor the 0x contracts to see if new code updates have been proposed.</p><h4>The true benefit</h4><p>So, wallet-to-wallet trading is not inherently more secure than depositing into a smart contract (in fact, a token <em>is</em> a smart contract), and does not necessarily guarantee that third parties cannot steal your tokens (if an approved contract has a bug or backdoor, or is upgraded to one that does).</p><p><strong>The real reason that wallet-to-wallet trading is important is that multiple smart contracts can be simultaneously approved access to the same funds.</strong></p><p>Although <a href="https://ethereum.stackexchange.com/questions/28337/prevent-double-withdrawal-erc20-api-attack">not perfect</a>, the ERC-20 standard is implemented by many tokens, and used by diverse sets of smart contracts. So, as a user, you can use the same tokens to participate in several systems at the same time.</p><p>Why would you want to do this? Capital efficiency. Suppose you would like to make markets in 5 different illiquid markets, by offering to either buy or sell up to 100 DAI on each. If every order required full capital commitment, you would need to lock up 2*5*100 = 1000 DAI for as long as you want to keep these markets open, even if trades happen very infrequently. However, if a system is designed to allow collateral to be <em>shared </em>between all orders, you only need to lock-up 100 DAI, with the understanding that if somebody fully takes one of your orders, all the others will be suspended due to lack of funds.</p><p>By taking advantage of the ERC-20 approval mechanism, you can even share collateral between different smart contracts. For example, suppose you wanted to make markets on both EtherDelta and 0x protocol. Rather than being forced to lock-up collateral on each system separately, as you would with a deposit contract, wallet-to-wallet trading allows you to use a single base of collateral for both, even though the two smart contracts are implemented quite differently.</p><h4>Degens and SportCrypt</h4><p>As described above, SportCrypt uses a deposit contract. With the next iteration of our system, called <a href="https://medium.com/@Degens/happy-birthday-sportcrypt-48c928a3b19e">Degens</a>, we are switching to a wallet-to-wallet model. This is not for security reasons — both SportCrypt and Degens will have equivalent custody-free security properties — but for the capital efficiency reason described above.</p><p>In addition, SportCrypt and Degens both have features to make collateral even more flexible, some of which we <a href="https://medium.com/@Degens/desirable-aspects-of-sports-betting-dapps-6aef34a0713a">wrote about previously</a>. The Degens protocol will also support something we call order groups, which gives market makers more control over how their collateral is allocated. We will be releasing full details on this shortly, stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eea31a58a12d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Happy Birthday, SportCrypt]]></title>
            <link>https://degens.medium.com/happy-birthday-sportcrypt-48c928a3b19e?source=rss-cddcc4f60514------2</link>
            <guid isPermaLink="false">https://medium.com/p/48c928a3b19e</guid>
            <category><![CDATA[sports-betting]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Degens]]></dc:creator>
            <pubDate>Tue, 22 Jan 2019 17:41:20 GMT</pubDate>
            <atom:updated>2019-01-22T22:52:24.586Z</atom:updated>
            <content:encoded><![CDATA[<p>It was pointed out to us in our chat that our smart contract just had its first birthday!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tIUIbTiaI-R8X87ll5KvKA.png" /></figure><p>We’d like to take this opportunity to reflect a bit on the previous year and where we are going next.</p><p>Our mainnet contract <a href="https://etherscan.io/tx/0x4d854ce99933434aaeec01b74667e661861ff46546c2e75658469d2a5118e0e9">was created</a> on Jan 19th 2018, although we were on the testnet for a couple months before that which is why our site says “Established 2017”.</p><p>We launched just before SuperBowl LII and ran a promotion where we gave out a small amount of free ETH to anyone who tried out the site and left some feedback. Since then we haven’t really done any advertising other than some posts on our social media.</p><p>Today our contract has processed over 23k transactions, with more than 7000 ETH bet. We have a small but growing core of users, many of whom use the site regularly. <strong>Thank you so much, your support means a lot to us!</strong></p><p>As many of you have noticed, we haven’t been doing much (visible) work on the site lately. That’s because we’ve been focusing on the next version which is getting close to a release. It’s going to be like SportCrypt is now, but better. We’re going to improve the user experience, make it faster, and increase decentralization.</p><h3>What’s Next?</h3><h4>New Smart Contract</h4><p>We’re nearly done the next version of our smart contract. It will fix some minor issues we’ve noticed with the current contract and add some new features we’re looking forward to using:</p><ul><li><strong>Bet with any token, not just ETH</strong><em><br></em>This is a feature that has been requested often. Especially in times when the price of ETH is volatile, some people are uncomfortable holding positions in ETH and would prefer to bet with “stable coins” that are designed to hold their value against USD (for instance). In fact, the new version of the contract will support betting with any ERC-20 token. When we launch we will have betting available in DAI (one of the most popular stable coins) as well as ETH (wrapped ETH technically). Another side-effect of this is that you won’t need to deposit your tokens into our smart contract anymore — all bets will be “wallet to wallet”.</li><li><strong>EIP 712 signatures</strong><br>When you create an order on SportCrypt, MetaMask pops up with an unhelpful window full of a jumble of random characters and you don’t really have any idea of what you are signing. There is a new standard called EIP 712 that we will support to improve this experience. You can read more about it and see screenshots in <a href="https://medium.com/metamask/eip712-is-coming-what-to-expect-and-how-to-use-it-bb92fd1a7a26">MetaMask’s blog post</a>.</li><li><strong>Take multiple orders in a single bet<br></strong>Sometimes there are multiple orders at acceptable prices and it is a pain to individually create trades to take them all. With the new contract you’ll be able to submit a single bet that specifies all the orders you are willing to accept. The contract will try to fill them in the same transaction, in the order you specify, up to the trade limit you set. This should make betting easier and reduce “collisions” where multiple traders try to take the same orders.</li><li><strong>More granular odds<br></strong>Currently you can specify odds only at integer prices (in implied probability). So, for example, you can create an offer at 50 or 51 (+100 or +104 in american odds), but not in between. The new version of the contract will allow you to specify prices in between those. However, to encourage meaningful price competition, orderbooks may have policies on the prices of orders they will relay. More to come on that later.</li><li><strong>Merkleized oracle specification</strong><br>In the current smart contract, there are special addresses controlled by us known as the “owner” and “admin” addresses. No smart contract with such a setup can be described as fully decentralized. That’s why we’re getting rid of them. In the next version of the contract we will have absolutely no special privileges over anyone else. In order to specify which addresses have the power to act as oracles, “grader” addresses will be embedded into the match IDs via a merkle tree structure. In addition to improving decentralization, this will allow us to implement multi-sig oracles, where 2 or more parties must agree on the result of a match before it is considered finalized. Related to this, we will be introducing modest grading fees, but we intend to be extremely price competitive.</li><li><strong>Atomic order matching<br></strong>In some cases we’ve seen “crossed orderbooks” where the price to buy is lower than it is to sell. Smart traders have been quick to take advantage of these <a href="https://www.investopedia.com/terms/a/arbitrage.asp">arbitrage</a> opportunities for a quick profit. However, in order to do so they’ve needed at least some free capital available, and, more importantly, run the risk that one of the trades succeeds and the other fails, leaving them carrying a position. We’re fixing that. There will be a new method on the smart contract specifically designed for risk-free arbitrage. No capital will be required and there is no risk of a partial-fill. Not only will this help keep the orderbook consistent, but it will enable new ways to use the system. For instance, you could place an order at slightly worse odds than an existing order in the opposite direction and allow the arbitrage bots to fill your trade — at 0 gas cost for you! In fact, we plan to have completely gas-free front-ends to our system that exploit this (but the current transaction-based exchange functionality will continue to exist for advanced users).</li><li><strong>Batched claims<br></strong>Since you may have positions in multiple tokens, we wanted to make it as cheap and simple as possible to claim all your winnings. So, to support this you’ll be able to issue a single claim command that collects winnings for multiple tokens. In addition, you can issue claims for other people’s addresses if you feel like paying their gas costs for them. Normally users will probably not do this, but it allows for “betting agents” like the gas-free interfaces described above to submit claims on their users’ behalf.</li><li><strong>More cancellation options<br></strong>If you want to cancel orders now, you need to send transactions to the blockchain for each individual order. Not only is this expensive, but it can take a long time if you have many orders to cancel. We’re adding a few new options to manage your orders. First, there will be a way to send a single transaction that cancels all orders created before a certain time. Second, we’re introducing the concept of order groups, where multiple orders can share the same fill limit, and that fill limit can be cancelled in a single transaction. So, for example, you could limit your orders on NFL to a certain collateral limit. This would prevent you from being over exposed to NFL (while still sharing collateral) and allow you to cancel all your NFL orders immediately, without affecting your orders on other sports. This functionality is very generic and you are free to arrange your orders into any order groups you choose.</li><li><strong>Bugfixes and optimizations</strong><br>We’re fixing a few minor bugs in the contract, such as the annoying “0 value trades” that sometimes appear when there has been a trading collision or the market maker has run out of collateral. We’re also optimizing gas usage as much as possible without making the contract too complicated. For example, we’re “borrowing” a neat trick from the 0x protocol where we don’t bother to validate a signature (~5k gas) if the order has already been partially filled, because the signature was validated previously.</li></ul><h4>Orderbook</h4><p>Our current orderbook implements an ad-hoc websocket protocol that was basically built out just enough for our web client to use. Despite this, we’ve had at least 4 independent people figure out the protocol and build automated market making and trading bots on top of our platform!</p><ul><li><strong>Official API</strong><br>This has been something we’ve known we need for a while. Our users have spoken and we hear you. We are building a well-documented, easy to use API with full-featured examples in several languages.</li><li><strong>Peer-to-peer<br></strong>Our orderbook is currently quite centralized, and we’ve always wanted to get away from this. We’ll be taking our first steps in this direction soon by allowing our users to host their own orderbook replicas. Users may want to do this for efficiency, or may want to host their own private “dark pool” orderbooks.</li></ul><h4>User Interface</h4><p>To be honest, the current UI code is something of a mess and it is getting more and more difficult to add new features. We’re working on a big refactor that will use the new orderbook API, and cleanup the code which will allow us to roll out new features much more quickly.</p><ul><li><strong>Efficiency<br></strong>The new version of the UI will be much faster since we are reducing our dependency on infura. We want the full page download and render to happen in less than 1/2 a second for the majority of our users.</li><li><strong>Mobile<br></strong>From now on, mobile will be a high priority in all our user interface designs. Many of our users are already using Trust Wallet, Cipher, and FireFox Mobile with MetaMask. Although these do work, it’s a pretty sub-optimal experience that we plan to improve upon.</li></ul><p><strong>Re-branding</strong></p><p>As a bonus for those of you who are still reading, we’re going to let you know early about a new brand-name for SportCrypt.</p><p>Truth be told, we’ve never been 100% happy with the name SportCrypt. When we were starting this project we looked around a bit for a name that embodied what we were building, and SportCrypt was the best we could come up with at the time: It had references to sports betting and to cryptocurrency, was short and easy-to-type, and the .com domain name was available.</p><p>However, after we’ve got to know our users and market better, we’ve decided to go in another direction. Our favourite users aren’t sports fans, or occasional recreational bettors. They are the true, unrepentant <a href="https://www.urbandictionary.com/define.php?term=Degen">degens</a>.</p><p>Hunting for value on college basketball totals? Testing out a +EV model for Slovakian handball? Attractive line on the annual hotdog eating contest? Got a tip on the Airedale terrier at the Westminster dog show?</p><p>We’ve got you covered.</p><p>SportCrypt.com is becoming <strong>degens.com</strong> (Q1 or Q2 2019)</p><p>Looking forward to another awesome year and beyond!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48c928a3b19e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>