Aspis Smart Contracts Documentation

Aspis Smart Contracts

This document describes the architecture of the smart-contracts of Aspis protocol.

Here are the major smart-contracts of the system:

  1. AspisRegistry.sol - the main configuration contract of the system.
  2. AspisPoolFactory.sol - the factory contract to create new Aspis vaults.
  3. AspisPool.sol - the main “vault” contract.
  4. AspisConfiguration.sol - the contract that is deployed for each vault and stores it’s parameters.
  5. AspisGuardian.sol - an access control smart-contract. Required for some critical actions.
  6. AspisLiquidityCalculatorV3.sol - The upgraded version of AspisLiquidityCalculator, which now delegates oracle interactions to separate adapters (Redstone, Chainlink, Uniswap). It retains the core functionality of price fetching, scaling, and conversions, but the logic is now modularized for easier updates and maintenance.
  7. Oracle Adapters:
    1. contracts/aspis/oracle-abstraction/adapters/base/BaseAdapter.sol
    2. contracts/aspis/oracle-abstraction/adapters/base/PullAdapter.sol
    3. contracts/aspis/oracle-abstraction/adapters/base/PushAdapter.sol
    4. contracts/aspis/oracle-abstraction/adapters/ChainlinkAdapter.sol
    5. contracts/aspis/oracle-abstraction/adapters/RedstonePullAdapter.sol
    6. contracts/aspis/oracle-abstraction/adapters/UniswapAdapter.sol
  8. Decoders - OdosV2Decoder.sol, OneInchV6Decoder.sol and UniswapUniversalDecoder.sol - help vaults to interact with exchanges.
  9. Aspis Upgrade: Comparing with the previous AspisLiquidityCalculatorV2 we’ve abstracted away adapters to make adding new oracles easier and standartized
  10. Legacy - contains AspisLiquidityCalculatorV2 which was upgraded to AspisLiquidityCalculatorV3

AspisRegistry

AspisPoolFactory

AspisConfiguration

AspisPool

AspisGuardian

AspisLiquidityCalculatorV3