1
0
forked from kodorvan/stcs

version 1 STCS

This commit is contained in:
Kirill Strelnikov
2025-07-21 13:40:33 +07:00
parent 14088503ea
commit ed67ed78c0
20 changed files with 976 additions and 110 deletions

View File

@@ -21,6 +21,25 @@ class User_Telegram_Id(Base):
tg_id = mapped_column(BigInteger)
class User_Bybit_API(Base):
__tablename__ = 'user_bybit_api'
id: Mapped[int] = mapped_column(primary_key=True)
tg_id = mapped_column(ForeignKey("user_telegram_id.tg_id"))
api_key = mapped_column(String(18), default='None')
secret_key = mapped_column(String(36), default='None')
class User_Symbol(Base):
__tablename__ = 'user_symbols'
id: Mapped[int] = mapped_column(primary_key=True)
tg_id = mapped_column(ForeignKey("user_telegram_id.tg_id"))
symbol = mapped_column(String(18), default='PENGUUSDT')
class Trading_Mode(Base):
__tablename__ = 'trading_modes'
@@ -105,7 +124,7 @@ async def async_main():
logger.info("Заполение таблицы режима торговли")
await conn.execute(Trading_Mode.__table__.insert().values(mode=mode))
types = ['Изолированный', 'Кросс']
types = ['Isolated', 'Cross']
for type in types:
result = await conn.execute(select(Margin_type).where(Margin_type.type == type))
if not result.first():