# Smart Contracts

- [Protocol (V2) Contract Architecture](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/protocol-v2-contract-architecture.md): This section of the Sommelier docs outlines the Smart Contract Architecture and its details. The docs are under continuous revision, so some sections are not published yet.
- [Smart Contract Architecture Walk-Through](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/protocol-v2-contract-architecture/smart-contract-architecture-walk-through.md): Onboarding page outlining key smart contract architecture oriented for people who prefer text-based learning
- [Roles & Permissions](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/roles-and-permissions.md)
- [External Protocol Integration](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/external-protocol-integration.md): These are the typical integration development opportunities that would enable more Cellar capabilities with more external protocols.
- [Building Adaptors](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/external-protocol-integration/building-adaptors.md)
- [BaseAdaptor](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/external-protocol-integration/building-adaptors/baseadaptor.md)
- [Protocol-Specific Functionality](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/external-protocol-integration/building-adaptors/protocol-specific-functionality.md)
- [Adaptor Configuration](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/external-protocol-integration/building-adaptors/adaptor-configuration.md)
- [Security Considerations](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/external-protocol-integration/building-adaptors/security-considerations.md)
- [Debt Adaptors](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/external-protocol-integration/building-adaptors/debt-adaptors.md)
- [Adaptor Uses to Keep in Mind](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/external-protocol-integration/building-adaptors/adaptor-uses-to-keep-in-mind.md)
- [Building Pricing Extensions](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/external-protocol-integration/building-pricing-extensions.md)
- [Smart Contracts & Governance](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/smart-contracts-and-governance.md)
- [Smart Contract Addresses](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/smart-contract-addresses.md)
- [Advanced Smart Contracts](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/advanced-smart-contracts.md): This section covers extraneous smart contract details and topics.
- [Registry Details](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/advanced-smart-contracts/registry-details.md): A detailed breakdown of the Registry.sol contract.
- [Registry.sol API](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/advanced-smart-contracts/registry-details/registry.sol-api.md): An API of the Registry.sol contract.
- [PriceRouter Details](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/advanced-smart-contracts/pricerouter-details.md): A detailed breakdown of the PriceRouter.sol contract.
- [Oracle Usage and Asset Pricing](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/advanced-smart-contracts/pricerouter-details/oracle-usage-and-asset-pricing.md)
- [PriceRouter.sol API](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/advanced-smart-contracts/pricerouter-details/pricerouter.sol-api.md): An API of the PriceRouter.sol contract.
- [Cellars (aka ERC 4626 Vaults)](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/advanced-smart-contracts/cellars-aka-erc-4626-vaults.md): A detailed breakdown of the Cellar.sol contract.
- [Cellar.sol API](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/advanced-smart-contracts/cellars-aka-erc-4626-vaults/cellar.sol-api.md): An API of the Cellar.sol contract.
- [Adaptors](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/advanced-smart-contracts/adaptors.md): A detailed breakdown of the BaseAdaptor.sol contract.
- [BaseAdaptor.sol API](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/advanced-smart-contracts/adaptors/baseadaptor.sol-api.md): An API of the BaseAdaptor.sol contract.
- [Fees And Reserves](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/advanced-smart-contracts/fees-and-reserves.md)
- [Portfolio (V1.5) Contract Architecture](https://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts/advanced-smart-contracts/portfolio-v1.5-contract-architecture.md)


---

# 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://sommelier-finance.gitbook.io/sommelier-documentation/smart-contracts.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.
