. The essence of AlphaSwap : Speculate on anything anywhere.
For the test contract,
1 epoch = 10 minutes (from XX:X0:XX ~ XX:X9:59).
For example, assume current epoch is from 08:30:00 ~ 08:39:59. In this epoch, you put your stakes on the difference of:
1. the TWAP (time-weighed average price) between
[the last trade before 08:30:00] and
[the last trade before 08:40:00].
2. the TWAP (time-weighed average price) between
[the last trade before 08:40:00] and
[the last trade before 08:50:00].
3. the XX:X0:00 time might be delayed for a few seconds, because someone needs to call [sync] to fix the price.
If you think 2 > 1, you are bullish. If you think 1 > 2, you are bearish. Winners take all stakes pro rata. If 1 = 2, then everyone gets their stakes back.
Note: the contract reads uniswap TWAP only when [sync] or [payoff] is called.
This only need to happen once at the beginning of each epoch. Traders have incentive to do it.
Note: there shall be at least 1 trade in each epoch. Or you cannot [sync] because there is no change in price.
So do some trades.
Hint:
you can bet both sides, or use multiple accs to do so. Good for testing.
Switch Metamask to Ropsten Testnet, and: