-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
345 lines (316 loc) · 25.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<!DOCTYPE html>
<html>
<head>
<title>Steak For Numer.ai on Kovan Test Network</title>
<link href='bootstrap.css' rel='stylesheet' type='text/css'>
<script src="jquery-3.1.1.slim.min.js"></script>
<script src="web3.1.3.4.min.js"></script>
<script src="bootstrap.3.4.1.min.js"></script>
<script src = "bignumber.js"></script>
<script src="./index.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="icon" href="favicon_32.png" type="image/icon type">
</head>
<body class="container-fluid" style = "margin-top: -4vh;">
<div class="row">
<div class="col-sm-4">
<h3 class="page-header" >
View Contract </h3>
<form class="form-inline" role="form">
<div class="form-group">
<table>
<tr>
<td>
<label for="newInfo">Address:</label>
</td>
<td>
<input class="form-control" id="newInfo"> </td>
</tr>
</table>
</div> <a onclick="retreiveContract()" class="btn btn-primary">Retrieve</a><i class="btn btn-primary" data-toggle="modal" data-target="#emailSubscribeModal" style="margin-left:0.5vw"><i class="fa fa-bell" ></i></i></form>
<br/>
<div style="height:85vh;
">
<ul class="list-group">
<li class="list-group-item" id="addressLabel">Contract Address: <a data-container="body" data-toggle="tooltip" data-placement="top" title="Copy Shareable Steak View Link" style = "float:right" onclick ="shareableLink()"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-link" viewBox="0 0 16 16">
<path d="M6.354 5.5H4a3 3 0 0 0 0 6h3a3 3 0 0 0 2.83-4H9c-.086 0-.17.01-.25.031A2 2 0 0 1 7 10.5H4a2 2 0 1 1 0-4h1.535c.218-.376.495-.714.82-1z"/>
<path d="M9 5.5a3 3 0 0 0-2.83 4h1.098A2 2 0 0 1 9 6.5h3a2 2 0 1 1 0 4h-1.535a4.02 4.02 0 0 1-.82 1H12a3 3 0 1 0 0-6H9z"/>
</svg></a></li>
<li class="list-group-item" id="sellerModelNameLabel">Data Scientist Model Name:
<a ></a>
</li>
<li class="list-group-item" id="costETHLabel">Contract Cost:</li>
<li class="list-group-item" id="sellerStakePromiseLabel">Promised Data Scientist Stake:</li>
<li class="list-group-item" id="lockedLabel">Locked:</li>
<li class="list-group-item" id="birthStampLabel">Birth Date:</li>
<li class="list-group-item" id="startStampLabel">Start Date:</li>
<li class="list-group-item" id="endStampLabel">End Date:</li>
<li class="list-group-item" id="buyerModelNameLabel">Buyer Model Name:
<a ></a>
</li>
</ul>
</div>
</div>
<div class="col-sm-2">
<h3 class="page-header">Actions</h3>
<ul class="nav nav-tabs">
<li class="active"><a href="#buyer" data-toggle="tab">Buyer</a></li>
<li><a href="#owner" data-toggle="tab">Seller</a></li>
<li><a href="#deploy" data-toggle="tab">Deploy</a></li>
</ul>
<div class="tab-content">
<div id="buyer" class="tab-pane fade in active">
<form class="form-inline" role="form">
<ul class="list-group">
<li class="list-group-item"><a onclick="registerBuyerName()" class="btn btn-primary">Register Your Model</a>
<br/>
<br/>
<label>Model Name: </label>
<input class="form-control" id="buyerModelNameInput">
</li>
<li class="list-group-item"><a onclick="reclaim()" class="btn btn-primary">Reclaim</a></li>
<li class="list-group-item"><a onclick="contest()" class="btn btn-primary">Contest</a></li>
</ul>
</form>
</div>
<div id="owner" class="tab-pane fade">
<form class="form-inline" role="form">
<ul class="list-group">
<li class="list-group-item"><a onclick="kick()" class="btn btn-primary">Kick</a></li>
<li class="list-group-item"><a onclick="lock()" class="btn btn-primary">Lock</a></li>
<li class="list-group-item"><a onclick="claim()" class="btn btn-primary">Claim</a></li>
</ul>
</form>
</div>
<div id="deploy" class="tab-pane fade">
<form class="form-inline" role="form">
<ul class="list-group">
<li class="list-group-item"><a onclick="deploy()" class="btn btn-primary">Deploy</a></li>
<li class="list-group-item"><a onclick="initialize()" class="btn btn-primary">Initialize</a>
<br/>
<br/>
<label>Model Name: </label>
<input class="form-control" id="dataScientistModelNameInput">
<br/>
<br/>
<label>ETH Cost: </label>
<input class="form-control" id="costETHInput">
<br/>
<br/>
<label>NMR Stake Promise:</label>
<input class="form-control" id="dataScientistStakePromiseInput"> </li>
</ul>
</form>
</div>
</div>
<h3 class="sub-header">Transaction Log</h3>
<div style="height:52vh;
overflow-y: scroll;">
<ul class="list-group" id="transactionLog"> </ul>
</div>
</div>
<div class="col-sm-6">
<div><h3 class="page-header">How to Use Steak<a href = "https://github.com/benschreyer/Steak" target = "_blank"><svg style ="float:right" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-github" viewBox="0 0 16 16">
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></a><i style = "float:right;margin-right:1vw">Steak for <a href = "https://numer.ai/" target = "_blank">Numer.ai</a></i></h3></div>
<ul class="nav nav-tabs">
<li class="active"><a href="#overviewTut" data-toggle="tab">Overview</a></li>
<li ><a href="#sellerTut" data-toggle="tab">Seller</a></li>
<li><a href="#buyerTut" data-toggle="tab">Buyer</a></li>
</ul>
<div class="tab-content">
<div id="overviewTut" class="tab-pane fade in active" style="height:38vh;
overflow-y: scroll;">
<h3 class="sub-header">Overview</h3>
<br/>
<h4 class="sub-header">What is Steak?</h4>
<p>Steak is a web interface and smart contract that allow data scientists competing in the <a href = "https://numer.ai/" target ="_blank">Numer.ai</a> tournament to sell their submissions for <a href="https://coinmarketcap.com/currencies/ethereum/" target = "_blank">Ethereum</a> to other holders of Numeraire. Contracts are created by sellers on a quarterly basis in line with Numer.ai's weekly submission structure and resolve after twelve weeks (see calendar). Steak is differentiated from any other private agreement to sell Numer.ai submissions in that it uses <a target = "_blank" href = "https://chain.link/">Chainlink</a> calls to Numerai's API to verify that the seller has upheld their promise to upload the correct predictions on time and stake a certain amount of their own <a href = "https://coinmarketcap.com/currencies/numeraire/" target="_blank">Numeraire</a> on the same model. If the seller fails to uphold their promise not only will their reputation be reduced but a fraction or all of the Ethereum you paid for their submission will be refunded to your account(see specifics on other pages) if you choose to contest the contract and the Numer.ai data interface confirms that the seller has failed to keep up their end of the contract.</p>
<br/>
<h4 class="sub-header">Why not Steak?</h4>
<p>There is a 1% fee on the Ethereum you get paid as the seller, so you do not get all of Ethereum the buyer pays. Ethereum gas prices are also very high which may make it hard for setting these contracts up to be worthwhile. Holding Numeraire like holding any crypto currency is highly risky and exposes you to a large amount of volatility (Numeraires prices have essentially doubled and then been cut in half over the past few weeks as I am writing this). This applies even more so for Numeraire since a company controls a large amount of the available Numeraire and gives the coin most of its value as a tool for datascientists. If Numerai the company was to fail or lose the trust of data scientists it would probably be enough to destroy almost all value Numeraire holds. On top of currency risk you must trust the modeling ability of a seller and the amount of stake (amount of Numeraire they are willing to lose) they put on their model. Numerai can destroy up to 25% of your staked Numeraire in one week if your submission performance is bad enough (this has happened to many stakers). Not only is the risk of entering the tournament high, but your knowledge to asses that risk is limited by what the seller discloses to you about their model and how honest they are about their confidence in it. Finally the Steak platform and smart contract have so far not been heavily tested, and could easily have bugs or exploits that could result in total loss of a buyer's refund or a seller's payment, or allow a buyer or a seller to completely scam the other party with damage only to their online (and possibly anonymous) reputation at risk. I could also give up on this project at any time and stop updating it, leaving you to hold your Numeraire speculatively, try to find a different way to buy submissions, or sell your Numeraire.</p>
<br/>
<h4 class="sub-header">Why Steak?</h4>
<p>If you can stomach that entire last paragraph (losing your entire investment in an instant etc), then you may want to use Steak. I wont do the math since the numbers will change over time and there is plenty of subjectivity to be had, but Numerai continues to attract data scientists submissions and stakes due to the "crypto returns" (high risk high reward) they provide to stakers. For data scientists, you may choose to use Steak to supplement your own staking Numeraire, or to get an extra stream of income from your models in Ethereum.</p>
<br/>
<h4 class="sub-header">Getting Started</h4>
<p> Visit the <a href = "https://docs.numer.ai/tournament/learn" target = "_blank">Numer.ai Docs</a> aswell as their forums or Rocket Chat to ask questions, and learn about how Numerai works. Then move to the "Buyer" or "Seller" tab to learn about using the Steak interface.</p>
</div>
<div id="sellerTut" class="tab-pane fade" style="height:38vh;
overflow-y: scroll;">
<h3 class="sub-header">Submission Seller</h3>
<br/>
<h4 class="sub-header">Setting up MetaMask</h4>
<p>Click <a data-toggle="modal" data-target="#metaMaskRequiredModal">here</a></p>
<br/>
<h4 class="sub-header">Finding a Buyer</h4>
<p>Sellers cannot acheive the sale of a model's submission using this page alone, instead they must first find a buyer who wishes to buy their model submission in a secure manner through Steak. The buyer and seller must make contact and exchange information through an external platform. A buyer needs an upload only API key for the seller's Numer.ai account so that they can submit their model's predictions on the seller's account.</p>
<br/>
<h4 class="sub-header">Required External Tools</h4>
<p>To create a Steak contract listing you must have the MetaMask extension installed for your browser and have an account that is funded with enough ETH and CHAIN to deploy a contract. 0.6 CHAIN must sent to the Steak contract before it is locked so it is able to perform the contest function which audits the state of round submissions and issues a partial refund(based on fraction of contract weeks elapsed) to the buyer if the seller has failed to hold up their end of the deal.</p>
<br/>
<h4 class="sub-header">Parameters When Deploying</h4>
<p> There are three parameters that go into deploying a Steak contract, Model Name (the name of the model whos submissions are being sold), ETH Cost (how much Ethereum the buyer will pay to have you submit on their behalf), and NMR Stake Promise (The minimum amount of NMR the buyer wants you to stake on the same submission).</p>
<br/>
<h4 class="sub-header">Timing Considerations</h4>
<p> Steak contracts are long term agreements, they are for facilitating purchase of 12 rounds of Numerai submissions from a data scientist. You must get your buyer registed between Saturday 18:00 UTC and Sunday 24:00 UTC, so that you can lock the contract or kick someone who has signed up(only valid before Monday 14:00 UTC the same week the contract is entered). Below is a calendar of when different contract actions are valid for reference.</p>
<br/>
<h4 class="sub-header">Seller Contract Actions</h4>
<p> The seller Deploys the contract initially as discussed above. The seller has three actions they can take on a deployed contract that are all time sensitive and require that a buyer has registered to partake in the contract.
<h4 class="sub-header">Kicking</h4> The first is <b>Kicking</b>, Kicking ejects the currently registered buyer from the contract opening up the contract to a new buyer incase a different buyer mistakenly registers for the wrong contract. Kicking must occur between Sunday 00:00 UTC and Monday 14:00 UTC and must happen before 44 hours have elapsed since the buyer registered (called the Start Date).
<h4 class="sub-header">Locking</h4> <b>Locking</b> is the second of three actions, and confirms that the seller will be submitting predictions on the buyer's Numerai account and claiming their payment in ETH specified at the Deployment of the contract along with confirming that the contract has been paid 0.6 LINK tokens to facilitate a contract contest by the buyer in the case that you do not hold up your end of the deal. You will get any unused LINK tokens back once you have claimed the contract or it has been successfully contested.You cannot kick a buyer once a contract has been locked. Locking must occur between Sunday 00:00 UTC and Monday 14:00 UTC and must happen before 44 hours have elapsed since the buyer registered (called the Start Date).
<h4 class="sub-header">Claiming</h4> Finally, <b>Claiming</b>, Claiming occurs twelve weeks after contract was deployed and rewards the seller with their specified ETH. If you did not honor the contract the buyer may trigger a contest, which will check to confirm that you did not submit, submitted late, submitted the wrong predictions or did not stake enough, then pays you according to how many weeks elapsed before the contract was contested. The remaining ETH goes back to the buyer's wallet.</p>
</div>
<div id="buyerTut" class="tab-pane fade" style="height:38vh;
overflow-y: scroll;">
<h3 class="sub-header">Submission Buyer</h3>
<br/>
<h4 class="sub-header">Setting up Meta Mask</h4>
<p>Click <a data-toggle="modal" data-target="#metaMaskRequiredModal">here</a></p>
<br/>
<h4 class="sub-header">Finding a Seller</h4>
<p>A buyer must seek out sellers on places like the Numer.ai forum, Numer.ai rocketchat, or platforms like Twitter to discuss pricing, how much you want to see the seller stake on their own model, send a model ID(found in the models menu of Numer.ai) and send a public and private API key with upload permissions only, so the seller can fullfil you predictions. </p>
<br/>
<h4 class="sub-header">Required External Tools</h4>
<p>To enter a Steak contract listing you must have the MetaMask extension installed for your browser and have an account that is funded with enough ETH to pay for gas fees and the reward given to the seller upon completion of the contract.</p>
<br/>
<h4 class="sub-header">Timing Considerations</h4>
<p>Steak contracts are quarterly agreements which means you should be doing alot of work verifying you have a good understanding of the model and modeler you are paying for. You can attempt to cancel the contract (called contesting) at any time if something goes wrong like the seller stops submitting, doesnt stake on their model, or submits the wrong predictions (See the bell button to get notified by email when your contract becomes invalid). If you successfully contest a contract all some fraction of the Ethereum you paid will be refunded that is equal to the amount of weeks since the contract started divided by 12, so if you successfully contest the contract after one month, you will receive 2/3 of your ETH back and the seller will receive 1/3 of your ETH (ignoring the 1% fee taken for the developers when the contract begins) </p>
<br/>
<h4 class="sub-header">Buyer Contract Actions</h4>
<p> The buyer can pay in the ETH cost to register their model name with a sellers contract so that the contract knows which models should be checked for equality in the case a contest of the contract is needed. If the seller does not submit equivalent predictions on their model and your model on time you may contest to receive a refund of a fraction or all of your ETH funds back into your MetaMask wallet as specified above. The buyer can also reclaim a contract if it is not locked by Monday 14:00 UTC following the weekend you entered the contract, which will refund you all the ETH you paid in minus the 1% fee, since the contract was never confirmed by the seller.</p>
</div>
</div>
<div class="col-sm-6" style="margin-left:-1vw">
<div class = "container">
<h3 class="page-header">Contract Calendar<b style = "margin-left:18vw" id = "UTCclock">Clock Broken</b></h3>
</div>
<table class="table">
<thead>
<tr>
<th scope="col" class="bg-primary">First Week Valid Actions</th>
<th scope="col" calendarColumn = "0">Saturday After 18:00 UTC</th>
<th scope="col" calendarColumn = "1">Sunday Full UTC</th>
<th scope="col" calendarColumn = "2">Monday Before 14:00 UTC</th>
<th scope="col" calendarColumn = "3">Tuesday Full UTC</th>
<th scope="col" calendarColumn = "4">Wednesday Full UTC</th>
<th scope="col" calendarColumn = "5">Thursday Full UTC</th>
<th scope="col" calendarColumn = "6">Friday Full UTC</th>
<th scope="col" calendarColumn = "7">Saturday Before 18:00 UTC</th>
<th scope="col" calendarColumn = "8">12 Weeks out</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">For Buyer</th>
<td class="success" calendarColumn = "0nb" >Register Your Model</td>
<td class="success" calendarColumn = "1nb" >Register Your Model</td>
<td class="danger" calendarColumn = "2nb" >Register Your Model/Round Close</td>
<td class = "success" calendarColumn = "3nb" >Reclaim becomes valid if contract wasnt locked</td>
<td class = "success" calendarColumn = "4nb" ><b>Reclaim is valid forever if contract not locked</b></td>
<td class="danger" calendarColumn = "5nb" >First Scores</td>
<td class="success" calendarColumn = "6nb" >Contest<br/><b>(Valid any week)</b></td>
<td class="success" calendarColumn = "7nb" >Contest<br/><b>(Valid any week)</b></td>
<td calendarColumn = "8nb" ></td>
</tr>
<tr>
<th scope="row">For Seller</th>
<td calendarColumn = "0nb"></td>
<td class="info" calendarColumn = "1nb">Kick</td>
<td class="info" calendarColumn = "2nb">Kick</td>
<td calendarColumn = "3nb"></td>
<td calendarColumn = "4nb"></td>
<td calendarColumn = "5nb"></td>
<td calendarColumn = "6nb"></td>
<td calendarColumn = "7nb"></td>
<td calendarColumn = "8nb" class = "info">Claim</td>
</tr>
<tr>
<th scope="row"></th>
<td calendarColumn = "0"></td>
<td calendarColumn = "1" class="info">Lock</td>
<td calendarColumn = "2" class="info">Lock</td>
<td calendarColumn = "3"></td>
<td calendarColumn = "4"></td>
<td calendarColumn = "5"></td>
<td calendarColumn = "6"></td>
<td calendarColumn = "7"></td>
<td calendarColumn = "8"></td>
</tr>
</tbody>
</table>
<h5>*After twelve weeks, sellers can claim their Ethereum payment using the claim functionality</h5>
</div>
</div>
</div>
</div>
</div>
<div id="emailSubscribeModal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button>
<h5 class="modal-title">Subscribe to Email Notifications?</h5>
</div>
<div class="modal-body">
<p>Subscribing to email notifications will alert you when a contract has possbily been breached, this is checked every Friday the day after scores are released</p>
<label>Email to Notify:</label><input class="form-control" id="email">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<a class="btn btn-primary" data-dismiss="modal" onclick="requestSubscribe()">Subscribe Contract</a>
</div>
</div>
</div>
</div>
<div id="gasEstimationFailedModal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Gas Estimation for Action Failed </h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button>
</div>
<div class="modal-body">
<p>Execution will likely fail, expending ETH and not acheiving desired result. Do you want to continue anyway?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" onclick="modalPrimary()">Cancel Action</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal" onclick="modalSecondary()">Attempt Action Anyway</button>
</div>
</div>
</div>
</div>
<div id="metaMaskRequiredModal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">MetaMask Kovan Test Network Connection Required </h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button>
</div>
<div class="modal-body">
<p>Chain transactions are sent through the <a href="https://metamask.io/download" target= "_blank"
>MetaMask</a> browser extension, you need the MetaMask extension to view contracts, and an account and currency to interact with them. Make sure to refresh the page after you have setup MetaMask. To get Kovan Test Network Ethereum and Chainlink (has no value and is only for testing) visit <a href="https://app.mycrypto.com/faucet" target="_blank">here(ETH)</a> and <a href="https://kovan.chain.link/" target="_blank">here(LINK)</a>. See a video of how to get setup on Chrome <a href="https://www.youtube.com/watch?v=sOykdVIrJ_U" target="_blank">here</a></a>
</p>
<div class="row text-center"> <img src="correctnetwork.jpg"> </div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#metaMaskRequiredModal">Close</button>
</div>
</div>
</div>
</div>
<div id="contractRequiredModal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">No Contract Loaded</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button>
</div>
<div class="modal-body">
<p>Use the retreive contract menu to load a contract to interact with before attempting to call functions.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#contractRequiredModal">Close</button>
</div>
</div>
</div>
</body>
</html>