# Smart Contracts and Documentation

Summer.fi's code is **fully open-source,** giving everyone in the community the ability to pressure test and audit the core technology. We built on top of heavily audited and long standing lending protocols.&#x20;

This page provides all relevant links and documentation as a reference. If you think you have found a bug or security issue you can report it on immunefi: <https://immunefi.com/bounty/summerfi/> and your report will be treated with the highest priority.

### High level Summer.fi Architecture

The architecture of Summer.fi consists of 5 layers:

1. Summer.fi webapp - <https://summer.fi/>
   * This is where the magic happens. Here you view & interact with your DeFi positions.
   * Code for the UI: <https://github.com/OasisDEX/oasis-borrow>
2. DeFi Smart Account Layer
   * To enable better UX, users first need to create a DeFi Smart Account. This is a proxy layer that manages positions on the blockchain.
   * Code for the contracts: <https://github.com/OasisDEX/oasis-earn-sc>
3. Summer.fi Automation contracts & Automation workers
   * If you wan to automate your position with a stop loss or other trigger, then those will be recorded in the automation trigger contracts, which get executed only when eligible by the Automation workers. &#x20;
   * Code for automation  <https://github.com/OasisDEX/automation-mono> , <https://github.com/OasisDEX/automation-workers>
4. Summer.fi Contract layer
   * The smart contracts that enable the Borrow, Multiply and Earn functionality.
   * Code for the contracts <https://github.com/OasisDEX/multiply-proxy-actions>, <https://github.com/OasisDEX/oasis-earn-sc>
5. The Defi protocols themselves, that Summer.fi users interact with through the above layers.

<figure><img src="/files/g7EtZysJ6kxlXU0TLioh" alt=""><figcaption><p>Summer.fi High level Architecture</p></figcaption></figure>

High level, this is how these layers fit together.

## Summer.fi Smart contracts & audits

All smart contracts that you can interact with through Summer.fi can be found on our Immunefi Bug bounty program here: <https://immunefi.com/bounty/summerfi/> including audits.

## Protocol smart contracts & documentations

### Maker

* These are the contract addresses for the Maker protocol which are used in Summer.fi: <https://changelog.makerdao.com/releases/mainnet/active/contracts.json>
* The maker protocol also has a documentation portal where you can find more information on how it works: <https://docs.makerdao.com/>

### Aave&#x20;

* The contracts for Aave v3 can be found here: <https://docs.aave.com/developers/deployed-contracts/v3-mainnet/ethereum-mainnet>
* Full documentation for Aave is here: [https://docs.aave.com/developers/](https://docs.aave.com/developers/deployed-contracts/v3-mainnet/ethereum-mainnet)

### Spark

*
* The contracts for Spark can be found here: <https://docs.sparkprotocol.io/developers/deployed-contracts/mainnet-addresses>
* Full documentation for Spark is here: <https://docs.sparkprotocol.io/hub/>

### Ajna

* The contracts for Ajna protocol can be fond here: <https://github.com/ajna-finance/ajna-core>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.summer.fi/summer.fi-pro/general/smart-contracts-and-documentation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
