File tree Expand file tree Collapse file tree 4 files changed +15
-16
lines changed
handlers/loan_states/vesu Expand file tree Collapse file tree 4 files changed +15
-16
lines changed Original file line number Diff line number Diff line change 1
1
""" This module contains all the models used in the database. """
2
2
from .base import Base
3
3
from .liquidable_debt import HealthRatioLevel , LiquidableDebt
4
- from .loan_states import (
5
- InterestRate ,
6
- LoanState ,
7
- ZkLendCollateralDebt ,
8
- )
4
+ from .loan_states import InterestRate , LoanState , ZkLendCollateralDebt
9
5
from .order_book import OrderBookModel
6
+ from .vesu import VesuPosition
10
7
from .zklend_events import (
11
8
AccumulatorsSyncEventModel ,
12
- LiquidationEventModel ,
13
- WithdrawalEventModel ,
14
9
BorrowingEventModel ,
15
- RepaymentEventModel ,
16
- DepositEventModel ,
17
10
CollateralEnabledDisabledEventModel ,
11
+ DepositEventModel ,
12
+ LiquidationEventModel ,
13
+ RepaymentEventModel ,
14
+ WithdrawalEventModel ,
18
15
)
Original file line number Diff line number Diff line change 1
- from sqlalchemy import Column , BigInteger , String
1
+ from sqlalchemy import BigInteger , Column , String
2
2
from sqlalchemy .ext .declarative import declarative_base
3
3
4
4
Base = declarative_base ()
5
5
6
+
6
7
class VesuPosition (Base ):
7
8
__tablename__ = "vesu_positions"
8
9
Original file line number Diff line number Diff line change 5
5
"""
6
6
7
7
from decimal import Decimal
8
- from sqlalchemy import select
9
8
10
- from shared .starknet_client import StarknetClient
11
- from shared .db import session
12
- from apps .data_handler .models import VesuPosition
9
+ from sqlalchemy import select
13
10
from starknet_py .hash .selector import get_selector_from_name
14
11
12
+ from apps .data_handler .db .crud import DBConnector
13
+ from apps .data_handler .db .models import VesuPosition
14
+ from apps .shared .starknet_client import StarknetClient
15
+
15
16
16
17
class VesuLoanEntity :
17
18
"""
@@ -26,8 +27,8 @@ class VesuLoanEntity:
26
27
def __init__ (self ):
27
28
"""Initialize Starknet client and storage."""
28
29
self .client = StarknetClient ()
29
- self .session = session
30
- # self.mock_db = {}
30
+ self .db_connector = DBConnector ()
31
+ self .session = self . db_connector . Session ()
31
32
self ._cache = {}
32
33
self .last_processed_block = 654244 # First VESU event block
33
34
You can’t perform that action at this time.
0 commit comments