Open pi0neerpat opened 4 months ago
Moving to contracts side since its likely not a frontend issue
The differences in the application of debt, interest, and tax between the Optimism and Arbitrum contracts have been identified and analyzed. Below are the key findings and conclusions:
Debt and Interest Calculation:
openLockTokenCollateralAndGenerateDebt
is executed, it calls _lockTokenCollateralAndGenerateDebt
._lockTokenCollateralAndGenerateDebt
immediately calls ITaxCollector(_taxCollector).taxSingle(_safeInfo.collateralType);
.modifySafeCollateralisation
.Function Call Stack:
Debt, Interest, and Tax Calculation:
openLockTokenCollateralAndGenerateDebt
is executed, it calls _lockTokenCollateralAndGenerateDebt
._lockTokenCollateralAndGenerateDebt
routes to _modifySAFECollateralization
._modifySAFECollateralization
calls ODSafeManager(_manager).modifySAFECollateralization(_safeId, _deltaCollateral, _deltaDebt, _nonSafeHandlerAddress);
.taxSingle
via TaxCollector.taxSingle
, applying tax at the end of the function call.Function Call Stack:
Optimism Contracts:
Arbitrum Contracts:
Optimism Transaction:
Arbitrum Transaction:
The primary difference between the Optimism and Arbitrum contracts lies in the timing and rate of tax application. On Optimism, the tax is applied at the beginning of the function call with a slightly lower rate, whereas on Arbitrum, the tax is applied at the end of the function call with a higher rate. This distinction, influenced by the deployment timing and collateral types, results in a notable difference in user costs between the two networks.
After opening a HAI vault with 1,000 HAI
After opening a OD vault with 1,000 OD
For some reason our app is showing additional debt. However 1.75% APR should not have accumulated this quickly