NightMarket is an esports market for fully onchain games. It aims to enhance the excitement and engagement of SkyStrife gameplay by integrating a betting feature to the game.
- Choose a Market: Select a market for a specific SkyStrife match.
- Pick Your Winner: Choose the player or team you believe will win.
- Place Your Bet: Enter the amount of ETH you want to bet and click "Bet" to confirm.
Check your bets in the "MyPosition" section.
NightMarket is deployed on Redstone Chain.
You can bridge ETH from the official Redstone website: https://redstone.xyz/deposit
- Resolve the Market: After the match, go to the market page and click the red 'Resolve' button to execute the resolution..
- Claim Winnings: If you bet on the winning option, click "Claim" to receive your winnings.
The cash back value for a player is calculated as:
(Total pool amount) x {(Amount the player bet on the correct choice) / (Total amount bet on the correct choice)}
*A 0.5% fee applies to all bets
- Click Create Tab: Fill out the market details, including title, betting period, and players' wallet addresses.
- Create Market: Click "Create Market" to finalize.
- Earnings: Market creators earn 0.5% of all bets made on their markets.
Notes:
- The betting period must be in epoch timestamp format. Refer to this link for more information.
- Use players' wallets connected to SkyStrife, not session wallets.
Users can withdraw their full bet amount if the market resolution has not been executed and 30 days have passed since the betting deadline.
Market creators earn 0.5% of all bets. This fee is transferred to the creator’s wallet when the market is resolved.
Execute 2 Arguments from Frontend:
-
_roundId: Identifies which market resolution to perform in NightMarket
-
matchEntity: Specifies the SkyStrife match for executing the resolution
(A fully on-chain search is computationally expensive and potentially infeasible)
set your env under packages>betting-client
VITE_CHAIN_ID=31337
terminal1
pnpm i
anvil
terminal2 (contract deploy)
pnpm betting-market:build-contracts
pnpm betting-market:contracts-dev
terminal3 (contract deploy)
pnpm betting-market:client-build
pnpm betting-market:client-dev
The contract has already been deployed and can be used as is.
set your env under packages>betting-client
# 17069 is garnet, 31337 is local test
VITE_CHAIN_ID=690
pnpm i
pnpm betting-market:client-build
pnpm betting-market:client-dev
[Core] Kohei: https://github.com/kohhnagata LIB: https://github.com/libdefi
[Supporter] Kooshaba: https://github.com/Kooshaba