Пример #1
0
class Prices(db.Model):
    __tablename__ = "prices"

    id = db.Column(db.Integer, primary_key=True)
    symbol = db.Column(db.Text, index=True)
    price = db.Column(db.Float(precision=32))
    timestamp = db.Column(db.Float(precision=32), index=True)
Пример #2
0
class Indexes(db.Model):
    __tablename__ = "indexes"

    id = db.Column(db.Integer, primary_key=True)
    symbol = db.Column(db.VARCHAR(255), db.ForeignKey("index_metadata.symbol"))
    value = db.Column(db.Float(precision=32))
    timestamp = db.Column(db.Float(precision=32))
Пример #3
0
class Transactions(db.Model):
    __tablename__ = "order_status"

    id = db.Column(db.Integer, primary_key=True)
    order_id = db.Column(db.Integer, db.ForeignKey("orders.id"), nullable=True)
    timestamp = db.Column(db.Float(precision=32))
    status = db.Column(db.Enum(OrderStatusTypes))
    clear_price = db.Column(db.Float(precision=32), nullable=True)
Пример #4
0
class Winners(db.Model):
    __tablename__ = "winners"

    id = db.Column(db.Integer, primary_key=True)
    game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
    winner_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    benchmark = db.Column(db.Enum(Benchmarks))
    score = db.Column(db.Float(precision=32))
    start_time = db.Column(db.Float(precision=32))
    end_time = db.Column(db.Float(precision=32))
    payout = db.Column(db.Float(precision=32))
    type = db.Column(db.Enum(PayoutType))
    timestamp = db.Column(db.Float(precision=32))
Пример #5
0
class Games(db.Model):
    __tablename__ = "games"

    id = db.Column(db.Integer, primary_key=True)
    creator_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    title = db.Column(db.Text)
    game_mode = db.Column(db.Enum(GameModes))
    duration = db.Column(db.Integer)
    buy_in = db.Column(db.Float(precision=32))
    benchmark = db.Column(db.Enum(Benchmarks))
    side_bets_perc = db.Column(db.Float(precision=32))
    side_bets_period = db.Column(db.Enum(SideBetPeriods))
    invite_window = db.Column(db.Float(precision=32))
    stakes = db.Column(db.Enum(GameStakes), nullable=True)
Пример #6
0
class GameBalances(db.Model):
    __tablename__ = "game_balances"

    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    game_id = db.Column(db.Integer, db.ForeignKey("games.id"))
    order_status_id = db.Column(db.Integer, db.ForeignKey("order_status.id"))
    stock_split_id = db.Column(db.Integer, db.ForeignKey("stock_splits.id"))
    dividend_id = db.Column(db.Integer, db.ForeignKey("dividends.id"))
    timestamp = db.Column(db.Float(precision=32))
    balance_type = db.Column(db.Enum(GameBalanceTypes))
    balance = db.Column(db.Float(precision=32))
    symbol = db.Column(db.Text)
    transaction_type = db.Column(db.Enum(GameBalanceTransactionTypes))
Пример #7
0
class Dividends(db.Model):
    __tablename__ = "dividends"

    id = db.Column(db.Integer, primary_key=True)
    symbol = db.Column(db.Text)
    company = db.Column(db.Text)
    amount = db.Column(db.Float(precision=32))
    exec_date = db.Column(db.Integer)
Пример #8
0
class StockSplits(db.Model):
    __tablename__ = "stock_splits"

    id = db.Column(db.Integer, primary_key=True)
    symbol = db.Column(db.Text)
    numerator = db.Column(db.Integer)
    denominator = db.Column(db.Integer)
    exec_date = db.Column(db.Float(precision=32))
Пример #9
0
class GameStatus(db.Model):
    __tablename__ = "game_status"

    id = db.Column(db.Integer, primary_key=True)
    game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
    status = db.Column(db.Enum(GameStatusTypes))
    users = db.Column(db.JSON)
    timestamp = db.Column(db.Float(precision=32))  # When was the game opened
Пример #10
0
class IndexMetaData(db.Model):
    __tablename__ = "index_metadata"

    id = db.Column(db.Integer, primary_key=True)
    symbol = db.Column(db.VARCHAR(255))
    start_date = db.Column(db.Float(precision=32))
    avatar = db.Column(db.Text)
    name = db.Column(db.Text)
Пример #11
0
class GameInvites(db.Model):
    __tablename__ = "game_invites"

    id = db.Column(db.Integer, primary_key=True)
    game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
    user_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    status = db.Column(db.Enum(GameInviteStatusTypes))
    timestamp = db.Column(db.Float(precision=32))
Пример #12
0
class Payments(db.Model):
    """This table handles real payments -- this isn't virtual currency, but an actual record of cash liabilities vis-a-
    vis the platform=
    """
    __tablename__ = "payments"

    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    profile_id = db.Column(db.Integer, db.ForeignKey("payment_profiles.id"))
    game_id = db.Column(db.Integer, db.ForeignKey('games.id'), nullable=True)
    winner_table_id = db.Column(db.Integer,
                                db.ForeignKey("winners.id"),
                                nullable=True)
    type = db.Column(db.Enum(PaymentTypes))
    amount = db.Column(db.Float(precision=32))
    currency = db.Column(db.Enum(CurrencyTypes))
    direction = db.Column(db.Enum(PaymentDirection))
    timestamp = db.Column(db.Float(precision=32))
Пример #13
0
class PaymentProfiles(db.Model):
    __tablename__ = "payment_profiles"

    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    processor = db.Column(db.Enum(Processors), index=True)
    uuid = db.Column(db.VARCHAR(255), index=True)
    payer_email = db.Column(db.Text, nullable=True)
    timestamp = db.Column(db.Float(precision=32))
Пример #14
0
class StockBetsRating(db.Model):
    __tablename__ = "stockbets_rating"

    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer,
                        db.ForeignKey("users.id"),
                        nullable=True,
                        index=True)
    index_symbol = db.Column(db.VARCHAR(255),
                             db.ForeignKey("index_metadata.symbol"),
                             nullable=True)
    game_id = db.Column(db.Integer, db.ForeignKey('games.id'), nullable=True)
    rating = db.Column(db.Float(precision=32))
    basis = db.Column(db.Float(precision=32))
    total_return = db.Column(db.Float(precision=32))
    n_games = db.Column(db.Integer)
    update_type = db.Column(db.Enum(EventTypes))
    timestamp = db.Column(db.Float(precision=32))
Пример #15
0
class ExternalInvites(db.Model):
    __tablename__ = "external_invites"

    id = db.Column(db.Integer, primary_key=True)
    requester_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    invited_email = db.Column(db.Text)
    status = db.Column(db.Enum(ExternalInviteStatus))
    timestamp = db.Column(db.Float(precision=32))
    type = db.Column(db.Enum(ExternalInviteTypes))
    game_id = db.Column(db.Integer, db.ForeignKey('games.id'), nullable=True)
Пример #16
0
class Orders(db.Model):
    __tablename__ = "orders"

    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
    symbol = db.Column(db.Text)
    buy_or_sell = db.Column(db.Enum(BuyOrSell))
    quantity = db.Column(db.Integer)
    price = db.Column(db.Float(precision=32))
    order_type = db.Column(db.Enum(OrderTypes))
    time_in_force = db.Column(db.Enum(TimeInForce))
Пример #17
0
class Users(db.Model):
    __tablename__ = "users"

    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.Text, index=True)
    email = db.Column(db.Text, index=True)
    profile_pic = db.Column(db.Text)
    username = db.Column(db.Text, index=True)
    created_at = db.Column(db.Float(precision=32))
    provider = db.Column(db.Enum(OAuthProviders))
    resource_uuid = db.Column(db.Text, index=True)
    password = db.Column(db.Text, nullable=True)
Пример #18
0
class Friends(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    requester_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    invited_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    status = db.Column(db.Enum(FriendStatuses))
    timestamp = db.Column(db.Float(precision=32))