Gearbox-protocol / core-v3

Other
28 stars 4 forks source link

IncreaseDebt and decreasedebt events are removed they are used by backend . #292

Open harsh-98 opened 4 days ago

harsh-98 commented 4 days ago
image
lekhovitsky commented 4 days ago

@harsh-98 they were always coming in pair with nearly identical events in the pool:

borrowedAmound and repaidAmount here, however, refer to debt principal, so interest etc. is not included. Exact transfer amounts can be extracted from Transfer events if the underlying token.

harsh-98 commented 3 days ago

One pool can have many credit managers. And pools and credit managers are synced separately in backend. Since we have events for withdraw/addcollateral in multicall, it will be nice to still have increase/decrease debt to keep events consistent for all creditfacade operations. The backend already supports.

lekhovitsky commented 3 days ago

The code is frozen so can't add them anyways.

lekhovitsky commented 3 days ago

One pool can have many credit managers.

Still can map pool events uniquely to multicalls since they are emitted in the same tx (between StartMulticall and FinishMulticall events, in an extreme case if one tx performs multiple multicalls).

harsh-98 commented 3 days ago

frozen for security audit?

can u add later?

lekhovitsky commented 3 days ago

The audit is completed, so more like terminally frozen unless we discover a critical security vulnerability.

harsh-98 commented 3 days ago

One pool can have many credit managers.

Still can map pool events uniquely to multicalls since they are emitted in the same tx (between StartMulticall and FinishMulticall events, in an extreme case if one tx performs multiple multicalls).

Can do. But all four application(gearbox-ws,go-liquidator,third-eye,gpointbot) already supports increaseDebt/decreaseDebt. It will be messy to track on pools and send the info to credit manager logic.

harsh-98 commented 3 days ago

There is another problem, that i have mentioned in the governance repo. The creditFacade is not set on creditmanager initialization. https://github.com/Gearbox-protocol/governance/issues/11. Previously SetCreditFacade emit has emitted when cm was initialized and creditFacade was set. Now both are missing. Atleast creditFacade field should be set.

harsh-98 commented 2 days ago

One pool can have many credit managers.

Still can map pool events uniquely to multicalls since they are emitted in the same tx (between StartMulticall and FinishMulticall events, in an extreme case if one tx performs multiple multicalls).

Can do. But all four application(gearbox-ws,go-liquidator,third-eye,gpointbot) already supports increaseDebt/decreaseDebt. It will be messy to track on pools and send the info to credit manager logic.

This i will do, as it saves gas for the user. So, worth the effort. But consider the not-initialized creditFacade field on credit manager.