# Introduction

Astaria is a lending protocol that supports any ERC-20, ERC-1155, and ERC721. It enables users to create fixed-rate loans with unlimited durations.

## Astaria intents: What are they?

Astaria intents are just that: an **intent** to lend or borrow assets for predetermined collateral and interest rates. Users are able to publicly broadcast intents to the [intent feed](/user-guides/intent-feed) to be filled by prospective lenders or borrowers.

[Intents](/concepts/glossary#intents) work in an auction format, with a loan's [APY](/concepts/glossary#apy) gradually increasing continuously from 0% to a predefined amount over a 24 hour period. This continues until a lender accepts the loan terms, or the 24 hours pass and the intent expires.

## Why Astaria?

The primary goal of Astaria is to allow borrowers to optimize their [Loan-to-Value](/concepts/glossary#ltv-loan-to-value) ratio and[ APY](/concepts/glossary#apy-annual-percentage-yield) via inclining-rate auctions, while minimizing required user interaction.

When using pooled lending models such as Aave and Compound, users deposit capital, and the loan process is performed automatically alongside other lenders in the pool. This means that users are unable to independently choose which asset collateral their capital is being loaned against, opening the door for potential risk. For example, if a user were to deposit USDC, and the lending pool loans it against an asset that suddenly drops in value, the user (and all users who've deposited USDC) are left at a loss.&#x20;

Conversely, Astaria allows users to have full control over what their assets will be traded against, and at their own specified [APY](/concepts/glossary#apy-annual-percentage-yield). This cuts out the socialized risk of other lending platforms; allowing for optimized risk isolation, while still maintaining the benefits and ease of use that other lending applications offer.

On pooled lending protocols, a closed group of token holders are also charged with voting on which assets to list on their platform. Astaria removes the need for a "listing" process to accept new forms of collateral or debt, allowing for the support of virtually any asset pairing from the very beginning.&#x20;

This has all been achieved through the use of [Intents ](https://www.paradigm.xyz/2023/06/intents)and a novel design allowing for the recall and refinancing of existing debt positions, eliminating the need for a reliance on [oracles](/concepts/glossary#oracle).&#x20;


# Borrowing

Borrow intents are loan requests that can be automatically matched with prospective lenders.

## Introduction

In Astaria, users are able to create borrowing [intents](/concepts/glossary#intents) under specified parameters. These [intents](/concepts/glossary#intents) will be publicly broadcasted to the [intent feed](/user-guides/intent-feed) to be filled by prospective lenders.

It is possible to request loans using any ETH-based asset as collateral (ERC20s and NFTs), and borrow any ERC20 against it.&#x20;

### Step 1: Transmitting the borrow intent

Users will define the key parameters of the intent, specifying:

* **Collateral:** The amount and type of asset that will be used to secure the loan
* **Borrow amount:** The requested asset and total
* **Interest rate:** The maximum [APY](/concepts/glossary#apy-annual-percentage-yield) that a prospective lender will receive. This will begin the 24 hour period at 0%, and gradually increase up to the percentage specified in this field.
* **LTV:** The [LTV](/concepts/glossary#ltv-loan-to-value) will be automatically calculated based on the above fields; however, it can also be directly edited to adjust the borrow amount to meet a desired threshold.&#x20;

**The lower your LTV and the higher your interest rate, the more likely you are to have your intent filled by a lender.**

<figure><img src="/files/XSDkdqLaf2xE6tCxrgk9" alt="" width="375"><figcaption></figcaption></figure>

When the above information is submitted through the Astaria application, the user will sign an EIP-712 message off-chain through their connected wallet to confirm the [intent](/concepts/glossary#intents). This signed message is gas-free, though users will have to approve the collateral token before proceeding.&#x20;

### Step 2: Allow the loan auction to proceed

* The finalized intent will then enter the [intent feed](/user-guides/intent-feed), where potential lenders have 24 hours to fill the loan.
* Over this 24 hour period, the proposal will be live with a starting interest rate of 0%, and ending with an interest rate that matches the maximum interest rate requested.&#x20;
* The interest rate will increase continuously until a lender decides to accept the loan terms, or the 24 hour period ends and the intent expires.
* It is also possible for borrowers to cancel intents before they are filled via the Astaria UI.

### Step 3: Monitoring the loan

* If a lender accepts your loan terms, your loan will execute automatically. **The collateral will leave the wallet, and the borrowed token will be deposited back into the same wallet address.**
* Borrowers have the ability to repay their loan at any time throughout the loan's lifecycle.&#x20;
* Once a lender has been matched, the lender can hold a [recall auction](/user-guides/loan-recall-and-liquidation) after a 24 hour honeymoon period.&#x20;

### Additional notes

* **Open Term & Recall**: Loans in Astaria v1 are open term but can be recalled. Once a lender has been matched, the lender can hold a [recall auction](/user-guides/loan-recall-and-liquidation).&#x20;


# Intent feed

The Intent Feed allows lenders to instantly see what terms borrowers are asking for and immediately fill loans without waiting.

Intents are loan agreement proposals that a lender may choose to fill.&#x20;

It is possible to either fill a loan immediately, or watch the max interest rate tick up until it meets a desired threshold. Once a wallet has been connected to Astaria, simply click the **Fill** button to accept the indicated loan terms.

Using the Intent Feed to scan for loan requests is the *fastest* way to get your capital active.&#x20;

<figure><img src="/files/9ErkF628GdvAxlgvq8Oj" alt=""><figcaption><p>The intent feed, as seen through the Astaria application's UI.</p></figcaption></figure>

Intents are live for 24 hours. The interest rate will increase continuously until a lender decides to accept the loan terms, or the 24 hour period ends and the intent expires. If you have the necessary funds to fill a loan, keep an eye on the feed to fill it at an attractive interest rate.

If a lender accepts the terms, the loan will execute automatically. After 24 hours, a lender can hold a[ recall auction](/user-guides/loan-recall-and-liquidation).


# Lending offers

Lending Offers are proposed loan offers that can be automatically matched with prospective borrowers.

### Introduction

With Astaria, users are able to perform lending offers. A user looking for a loan that matches your desired parameters can have their borrow position filled automatically.

It is possible to offer loans using any ERC-20, with any asset as collateral. Most users choose to borrow stablecoins or WETH.

Once a loan has been active for 24 hours, it is possible hold a [Recall auction](/user-guides/loan-recall-and-liquidation).

### Step 1: Transmitting the Lending Intent

User will define the key parameters of their intent, specifying:

* **Collateral:** The amount and type of asset that a borrower must provide to fulfill the loan
* **Borrow amount:** The total amount that can be borrowed against the above collateral
* **Interest rate:** The minimum [APY](/concepts/glossary#apy-annual-percentage-yield) that a prospective borrower can accept.&#x20;
* **LTV:** The [LTV](/concepts/glossary#ltv-loan-to-value) will be automatically calculated based on the above fields; however, it can also be directly edited to adjust the borrow amount to meet a desired threshold.&#x20;

**The higher your** [**LTV**](/concepts/glossary#ltv-loan-to-value) **and the lower your** [**APY**](/concepts/glossary#apy-annual-percentage-yield) **interest rate, the more likely you are to have your intent filled by a borrower.**

<figure><img src="/files/QeZLEgFTgsjRqJxKJmKN" alt=""><figcaption></figcaption></figure>

When the above information is submitted through the Astaria application, the user will sign an EIP-712 message off-chain through their connected wallet to confirm the [intent](/concepts/glossary#intents). This signed message is gas-free, although users will have to approve the collateral token before proceeding.&#x20;

**Important:** When turned on, the Repeat fill toggle will allow Astaria to continuously fill loans at your desired parameters until all of the lent asset has been depleted from your wallet. Disable it to only allow one loan to fill.

<figure><img src="/files/3NPNusETwxrozOYru5eH" alt=""><figcaption></figcaption></figure>

### Step 2: Wait for a Borrower

* The offer then enters the matching service where it will be matched with a borrower, should the terms fit their requirements.
* It's advised to regularly monitor the loan to ensure that the[ LTV](/concepts/glossary#ltv-loan-to-value) is within your risk tolerances, as certain assets are prone to price fluctuation.
* Wallet access is not necessary to fill a loan. The approval and signed intent message will allow funds to automatically be withdrawn safely from the wallet at the time of execution.

### Step 3: Monitoring the Loan

* Lenders should monitor the health of the loan continuously to make sure that the value of the collateral does not fall below the value of the borrowed asset.&#x20;
* In order to exit the loan, you must administer a [Recall](/user-guides/loan-recall-and-liquidation#recall). **This can only be done 24 hours after the loan has been initiated.** See the 'loan recall and liquidation' section for further information.


# Loan recall and liquidation

Loans on Astaria do not have a set end date. They end when the borrower chooses to repay or the lender decides to send a loan to recall.

## Recall

Recall is the process of replacing an original lender with a refinancing lender, or ending the loan and seizing the collateral. A lender is able to send a borrower's loan to Recall after it has been active for 24 hours. **A borrower can always repay their loan while in recall for no penalty.**&#x20;

If a lender wants to exit their position, the lender initiates a recall using an on-chain transaction through the Astaria application. Requesting a recall opens a new intent with an inclining rate auction. This auction functions the same as a traditional intent from a borrower; the only difference is that a loan's borrowing rate begins at 0% APY, and increases incrementally up to 1000% APY over 24 hours.&#x20;

<figure><img src="/files/x3iITRHZwKyV2D0RLaOM" alt="" width="375"><figcaption><p>A loan that is underwater and currently in recall.</p></figcaption></figure>

## Liquidation

If no lender refinances during this period, or the borrower has not repaid the loan, the loan is presumed defaulted. This is referred to as a **failed recall**. The collateral is now retrievable by the original lender through an on-chain transaction.&#x20;


# Astrological units

Astrological Units are rewards that users can receive when using Astaria.

When using Astaria to borrow or lend supported tokens, users are able to earn rewards in the form of **Astrological Units.**

For each intent, a payout of Units will be automatically attributed to the wallet used to borrow or lend. 1 ETH of loan value (in ETH or USD terms) is equal to 10,000 Units. Earnings are incremental, with no minimum value; every ETH or USDC intent is eligible to earn rewards.

A wallet's Units payout total can be viewed in the UI under the[ rewards page](https://astaria.xyz/rewards/history).

<figure><img src="/files/crsS7p9q0INief0NWFgU" alt=""><figcaption></figcaption></figure>


# Starport

The Astaria application is built on top of the Starport framework.

## What is Starport?

Starport is a simple kernel framework used for composing lending protocols on the Ethereum Virtual Machine (EVM). Starport itself is not a lending protocol, but instead handles the data availability and agreement enforcement that is required for any lending protocol. In Starport, there are three distinct actors: **borrowers**, **lenders**, and **fulfillers**.

Starport supports collateralized loans and options for any ERC-20, ERC-721, or ERC-1155 assets. Rebasing and fee-on-transfer tokens are not supported.&#x20;

## Starport's core components

The Starport kernel is supported by two core contracts: `Starport` and `Custodian`.&#x20;

`Starport` is the entry point for origination and refinancing. The duty of `Starport` is to enforce the agreements of originate and refinance, as well as maintain the record of loan state.&#x20;

`Custodian` is the entry point for repayment or settlement. The duty of the `Custodian` is to custody the borrower collateral and enforce loan settlement and repayment conditions. `Custodian` is not a strict implementation. Borrowers and lenders can provide differing implementations of the `Custodian` that support the Custodian interface. However, a gas efficient default `Custodian` contract will be provided with Starport.&#x20;

## **Modules**&#x20;

Modules are implementations of the module interfaces that are untrusted by the core. Each module serves a purpose within the lending lifecycle providing parameters and conditions for the core contracts to enforce.&#x20;

The duty of the `Pricing` module is to provide the conditions of repayment to the Custodian and the conditions of refinance to the Starport contract.&#x20;

The duty of the `Status` module is to provide the status of whether a loan is active or inactive. An inactive status allows a loan to be settled. An active status allows a loan to be repaid.&#x20;

The duty of the `Settlement` module is to provide the conditions of settlement to the Custodian. Settlement is more commonly referred to as liquidation, but is a restrictive definition for this framework.

***

[The full Starport whitepaper can be found here.](https://github.com/AstariaXYZ/starport-whitepaper/blob/master/starport-whitepaper.pdf)


# Glossary

This page includes definitions for the technical terminology featured throughout this documentation portal.

#### **Intent**

A borrow or lending offer on Astaria. Learn more about intent-based architecture [here](https://www.paradigm.xyz/2023/06/intents).

#### **LTV (Loan-to-value)**

The loan-to-value (LTV) ratio is a financial term used to express the ratio of a loan to the value of an asset purchased. The higher the LTV ratio, the riskier the loan is for a lender.

#### **APY (Annual percentage yield)**

The annual percentage yield (APY) is the interest rate earned on an investment in one year, including compounding interest. A higher APY represents a higher return.

#### **Oracle**

A service that connects blockchain protocols with external data sources.


# FAQ

Frequently Asked Questions (FAQ) about Astaria

### **1 - What is Astaria?**

Astaria is a decentralized finance (DeFi) platform that offers an oracle-less, intent-based lending system. It supports fixed-rate loans with unlimited durations for various digital assets, including ERC-20 tokens and NFTs (ERC-721).

Key features include:

* Intent-based lending mechanism (peer-to-peer)
* Oracle-less lending system
* Fixed-rate, unlimited-duration loans
* Support for ERC-20 and ERC-721 assets on Base and MODE Network

### **2 - How does Astaria differ from other DeFi lending platforms?**

Astaria offers intent-based lending, which functions as a handshake between peers. Unlike pool-based lending DeFi platforms like Aave and Compound, Astaria does not rely on external price oracles. This enhances security and reduces the risk of manipulation, providing greater flexibility and predictability for users to set specific loan terms and avoid forced liquidations due to market volatility.

### **3 - What is intent-based lending?**

In intent-based lending, users define their lending or borrowing terms through pre-defined agreements that specify the conditions under which loans will be executed. This system provides stability and predictability, allowing users to confidently borrow and lend assets.

### **4 - What types of collateral does Astaria support?**

Astaria supports various digital assets as collateral, including ERC-20 tokens and NFTs (ERC-721) issued on Base and MODE Network, such as:

* DeFi Tokens
* LP positions
* Governance tokens
* Memecoins
* Any NFT collection or 1/1

### **5 - Can NFTs be used as collateral on Astaria?**

Yes, Astaria allows users to use NFTs (ERC-721) as collateral for loans. This feature opens up new financial opportunities for NFT holders, enabling them to unlock liquidity from their digital collectibles and assets.

### **6 - What types of advanced DeFi strategies can I employ with Astaria?**

Astaria's intent-based lending mechanism enables users to:

* **Leverage a long position:** Place a token (like $DEGEN) as collateral for getting stablecoins or ETH to buy more tokens (more $DEGEN).
* **Short a token:** Borrow a token (like $DEGEN), sell it on the market, and rebuy it at a lower price.
* **Hedge their position:** Borrow USDC or ETH against their collateral to protect against potential market downturns.

### **7 - Where does my collateral go when I borrow using Astaria?**

If your intent is filled, your collateral goes to the [Astaria vault contract](https://basescan.org/address/0x0000000000a6f0986c92cf1ec4d2e77afbe1466d) until the loan is repaid or recalled.

### **8 - What happens if the loan is recalled? And what happens if it is not repaid?**

If a loan is recalled, borrowers have 24 hours to repay their debt. They can either repay it or wait for someone to refinance it with a higher APY (up to 1000%). If the loan is not repaid or refinanced, the collateral is transferred from the vault to the lender after the 24-hour grace period ends.

### **9 - What happens if the collateral value drops below a certain level?**

In Astaria's system, loans are not liquidated based on price fluctuations. Instead, the risk of forced liquidation is minimized, providing a more stable lending environment. Therefore, lenders and borrowers should always consider the loan-to-value (LTV) and decide when to recall or repay the loan.

### **10 - How can I contact Astaria's support team?**

You can visit our [website](https://astaria.xyz/) and use the contact options provided, or join our [Discord](https://discord.gg/j67qKfb4uN) or [Telegram Feed](https://t.me/AstariaFeed) channel. To stay updated on developments, please subscribe to Astaria's newsletter on our [website](https://astaria.xyz/).


# Responsible disclosure

Astaria's Responsible Disclosure Program

Reports should be submitted via email to <security@astaria.xyz>. Reports may be submitted anonymously and/or encrypted per instructions below.

* All bug reports must be fixed and paid **BEFORE** being published.
* Whitehats may NOT publish information about reports rejected as being a duplicate or known issue.
* Whitehats may NOT publish information during the mediation process.
* Bug report intellectual property remains with the whitehat. Right of publication, however, is determined by whichever publication category the project chooses.
* Astaria will investigate legitimate reports and make every effort to quickly resolve any vulnerability. Please make a good faith effort to avoid privacy violations, destruction of data, and interruption or degradation of our services.

Note that Astaria **requires notice** prior to publishing any findings:

* Whitehats may publish information about their fixes and paid bug reports provided that they give projects 21 days to review and provide input about the publication in the bug report submission thread before they publish.
* Whitehats do NOT need to provide notice prior to publishing information about payment amount, severity, or high-level classification of the bug type (e.g. reentrancy), as long as they do not mention or indicate the project to which it was reported.
* The notice requirement does NOT apply to Whitehats publishing information about reports that have not been resolved within 90 days of escalation, unless a mediation process is ongoing. In those instances, the Whitehat may disclose information pertaining to that bug report without restriction.

If you have any questions or concerns about about Astaria's disclosure policy, please contact us via [Twitter](https://twitter.com/AstariaXYZ), [Discord](https://discord.gg/Bp9Rjr65mZ), or email (<security@astaria.xyz>).

If your messages contain sensitive information, you may encrypt using our PGP key:

```
$ curl https://astaria.xyz/publickey.asc | gpg --import
$ gpg --output document.gpg --encrypt --recipient security@astaria.xyz document
```

You may verify the authenticity of the `security.txt` file using the following commands:

```
$ curl https://astaria.xyz/publickey.asc | gpg --import
$ curl https://astaria.xyz/.well-known/security.txt
$ gpg --verify security.txt
    gpg: Signature made Thu Sep 21 23:31:22 2023 EDT
    gpg:                using RSA key 0DA3BCC19A7E3197657425BDEFFB32CB832E56AD
    gpg:                issuer "security@astaria.xyz"
    gpg: Good signature from "Astaria <security@astaria.xyz>" [ultimate]
```

Thank you for helping us keep Astaria safe!

Updated: 2024-01-24


# Audits

#### Astaria has undergone both Formal Verification and multiple complete audits with [Certora](https://www.certora.com/).

{% file src="/files/Xi67Ou7od0mH1K9VHpFg" %}
Latest Audit w/Certora
{% endfile %}

{% file src="/files/sWh4kupSq5aouiqjK7NE" %}
Original Audit w/Certora
{% endfile %}

{% file src="/files/ep5GlAd5R7OCpbcHJIhp" %}
Starport Lending Kernel Audit
{% endfile %}


# API documentation

Under construction.


# Deployments

Contract deployment addresses for Astaria v1 Core

#### Base Layer 2

<table><thead><tr><th width="198">Contract</th><th>Deployment Address</th></tr></thead><tbody><tr><td><a href="https://basescan.org/address/0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC">Consideration</a></td><td><code>0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC</code></td></tr><tr><td><a href="https://basescan.org/address/0x0000000000A6F0986c92cf1EC4d2e77aFBE1466D">Custodian</a></td><td><code>0x0000000000A6F0986c92cf1EC4d2e77aFBE1466D</code></td></tr><tr><td><a href="https://basescan.org/address/0x00000000000cC7ba78E64E86B2Bd59B1ae7F569E">Starport</a></td><td><code>0x00000000000cC7ba78E64E86B2Bd59B1ae7F569E</code></td></tr><tr><td><a href="https://basescan.org/address/0x0000000000A6F5D91204B3Bb226C2e3a6350b234">V1BorrowerEnforcer</a></td><td><code>0x0000000000A6F5D91204B3Bb226C2e3a6350b234</code></td></tr><tr><td><a href="https://basescan.org/address/0x000000000066E90E8615e1722776765552f7942b">V1LenderEnforcer</a></td><td><code>0x000000000066E90E8615e1722776765552f7942b</code></td></tr><tr><td><a href="https://basescan.org/address/0x000000000095bCfcb627bbB6224e2AeE0A395203">V1Pricing</a></td><td><code>0x000000000095bCfcb627bbB6224e2AeE0A395203</code></td></tr><tr><td><a href="https://basescan.org/address/0x0000000000E1B745934e6C7e8D86a9818ab09a87">V1Settlement</a></td><td><code>0x0000000000E1B745934e6C7e8D86a9818ab09a87</code></td></tr><tr><td><a href="https://basescan.org/address/0x0000000002546f9C641E000DD4b22875236BC147">V1Status</a></td><td><code>0x0000000002546f9C641E000DD4b22875236BC147</code></td></tr></tbody></table>


# Resources

Astaria Intents: [Whitepaper](https://github.com/AstariaXYZ/starport-whitepaper/blob/master/astaria_v1_whitepaper.pdf)

Starport: [Whitepaper](https://github.com/AstariaXYZ/starport-whitepaper/blob/master/starport-whitepaper.pdf)

Learn more about Intents: [Intent-Based Architectures ](https://www.paradigm.xyz/2023/06/intents)

Discord: [Link](https://discord.gg/X92HuRZvF4)


