Game Mechanics

for GoodGhosting v2
We use game-design elements to reward users who hit their savings target (i.e. winners) more so than users who do not. This happens transparently on a public blockchain.

🕹️ Game mechanics

For each game, a new savings pool smart contract is deployed by the GoodGhosting team. Each game (also referred to as pool) runs for a fixed amount of time. There are always one or more deposit rounds - where you deposit a specific asset into the savings pool - followed by a single waiting round.
To win, players need to complete all deposits. Aka: they need to make a deposit into the pool smart contract every round, prior to the round’s deadline. At the end of the game, all players can withdraw their initial deposit (minus any impermanent loss), irrespective whether they won or not.
Winners earn a slice of the pool’s rewards. This includes any interest generated through decentralized finance platforms as well as additional incentives and sponsorship (see Yield strategies). The rewards are proportional to how much and when a user deposited. Typically, winners earn more than when they would save by themselves.

⚙️ Technical

Deposit tokens
Deposit amounts
Game duration

Rewarding early depositors (Rewards calculation)

Reward distributions are taking into account the total time (and amount) a user has funds deposited into a savings pool. Thereby increasing fairness to all depositors. The sooner a player deposits in each segment, the bigger their share of the pool's generated interest and rewards in that segment - assuming they are considered winners at the end of the pool. Typically, a winning ulinkser (who deposits during the very first block of a deposit segment) can earn up to a factor of 2 more the rewards compared to another user (who deposits during the very last block of a deposit segment). On the smart contract level, this is tracked using cumulativePlayerIndexSum and playerSharePercentage. This is updated for every new deposit for each segment. For the waiting round, rewards are calculated according to the total amount of funds a user has deposited (since each user starts this round at the same time).
See Yield strategiesto learn more about how rewards are generated.

Smart contract code

Smart contract overview

In order to make the contracts modular, the contracts are divided into two types:
  1. 1.
    The pool contract that holds all the core game/pool logic (Pool.Sol) It is the main contract through which players are able to make deposits into the underlying yield strategy contract and withdraw funds.
  2. 2.
    The yield strategy contracts that hold the logic to integrate with the external protocols. The strategy contract is owned by the pool contract. Thereby only the pool contract can directly interact with the strategy contract, not players or any other external actors.
There are multiple yield strategy contracts available, but each pool contract can only be coupled to one strategy at a time. This is determined at the time the pool contract is deployed. Hence, the yield source becomes fixed at the time of pool deployment.

Flow of funds

Flow of user funds in GodGhosting v2

Public functions

Commonly used functions by users

Admin functions

Our pool smart contract contain multiple administrative functions, that are only accessible to the admin (owner) of the contract.
General admin functions
Who is the admin?