> For the complete documentation index, see [llms.txt](https://syrup.gitbook.io/syrup/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://syrup.gitbook.io/syrup/technical-resources/overview.md).

# Protocol Overview

## Overview

Syrup is a layer built on top of [Maple](https://maplefinance.gitbook.io/maple), which is a protocol for a decentralized corporate credit market that provides capital to institutional borrowers on the Ethereum mainnet. Syrup's main contract, the SyrupRouter, is uniquely designed to allow authorized participants to securely access and benefit from the yields available in the ecosystem, abstracting all the complexities of the permissioning system inherent to Maple.

## Permissions System

The Maple Protocol is geared towards institutions and has a permissioning system that requires allowlisting for executing most functions. For pool deposits, in general, lenders need to have their wallet allowlisted in Maple's Pool Permission Manager. Aiming to abstract and simplify the process, the SyrupRouter integrates directly with the Pool Permission Manager to allow for valid users to self-authorize and deposit in a single transaction assuming the user meets eligibility requirements.

## Syrup Router Flow

There are 4 main entry points to interact and deposit in the Syrup router. The deciding factor for which entry point to use is whether the user has been allowlisted in the Pool Permission Manager (PPM). The following table summarizes the entry points:

|                      | With Pool Permission Manager Authorization | Without Pool Permission Manager Authorization |
| -------------------- | ------------------------------------------ | --------------------------------------------- |
| **Direct Approval**  | `deposit()`                                | `authAndDeposit()`                            |
| **Permit Signature** | `depositWithPermit()`                      | `authAndDepositWithPermit()`                  |

To help understand the execution and fund flows, here is a diagram for each of the 4 entry points:

### `deposit()`

![deposit()](https://github.com/maple-labs/syrup-router/assets/16119563/2e911fe4-cd81-4b58-a290-6809d7bba125)

### `depositWithPermit()`

![depositWithPermit()](https://github.com/maple-labs/syrup-router/assets/16119563/db8192f8-c9d3-42d9-9522-9a91df95fb5d)

### `authAndDeposit()`

![authAndDeposit()](https://github.com/maple-labs/syrup-router/assets/16119563/1c59065b-c1cb-4b55-9ab8-1d04ebb9fe83)

### `authAndDepositWithPermit()`

![authAndDepositWithPermit()](https://github.com/maple-labs/syrup-router/assets/16119563/c0e4d64f-e092-46b0-9b7f-00def236ace7)
