Overview of changes in Aspis smart-contracts v2

Aspis upgrade

1. Abstraction of Oracle-Specific Logic into Adapters

Previously, in AspisLiquidityCalculatorV2, the logic for interacting with different oracles (like Redstone, Chainlink, etc.) was embedded directly within the contract. This meant that the contract itself was responsible for both fetching the data and processing it.

Now, in AspisLiquidityCalculatorV3, we’ve simply moved the logic to separate oracle adapters. The core logic of how prices are derived and converted is largely unchanged. Instead of embedding the logic for interacting with Redstone or Chainlink directly within the calculator, we’ve abstracted these tasks into adapters.

Key Points:

This separation into adapters does not change the core logic; it only improves how we interact with external data sources, making the system more scalable and flexible.


2. Flexibility in Upgrading and Adding New Oracles

One of the primary benefits of this update is the separation of concerns. By moving the oracle-specific logic into external adapters, we now have greater flexibility to:


3. Code Review and Auditing Simplification

With the introduction of adapters, the system has become easier to review and audit. The logic for different components (e.g., Redstone, Chainlink) is now isolated into their respective adapters. This reduces complexity and makes it easier for auditors to follow and verify the code for each individual component.

4. Minimal Functional Changes - Core Logic is Intact

The underlying logic in AspisLiquidityCalculatorV3 is almost identical to that of V2, but it is now modularized for improved scalability. Here’s what has changed: