# Welcome

Gable is a decentralised liquidity market protocol built on Radix DLT, where users can participate as borrowers or suppliers. Gable offers lending products for borrowers, and liquidity solutions for suppliers. Built on Radix DLT, Gable offers transparency, security, and innovative solutions to traders and investors. This allows users to enjoy fast and efficient transaction processing, low fees, and transparent terms.

### Get started as supplier:

{% content-ref url="/pages/AfjELWkEIF1MDKW3R2EM" %}
[V1 - Flashloan Pool](/v1-flashloan-pool/staking-liquidity)
{% endcontent-ref %}

### **Get started as borrower:**

{% content-ref url="/pages/f8Z754TsbOg5m6BMcL65" %}
[V2 - Perpetual Borrowing](/v2-perpetual-borrowing/lending)
{% endcontent-ref %}


# GAB Token

*Resource address:* [*resource\_rdx1tknu3dqlkysz9lt08s7spuvllz3kk2k2yccslfpdk73t4lnznl9jck*](https://dashboard.radixdlt.com/resource/resource_rdx1tknu3dqlkysz9lt08s7spuvllz3kk2k2yccslfpdk73t4lnznl9jck)

*The above resource address is the official address associated to the Gable custom token 'GAB'. When interacting with the token, ensure that the address matches the one above.*

### GAB Introduction

GAB is the custom token for the Gable protocol. This token is issued deliberately after the first release of the protocol (Gable Version 1). From Gable Version 2 and onwards, GAB will play a pivotal role in interacting with the protocol and contributing to its governance.

#### **Utility** <a href="#id-3af2" id="id-3af2"></a>

Suppliers may gain access to enhanced rewards, reduced fees, or exclusive features, while borrowers can enjoy discounted interest rates or access to a wider range of lending options. This utility token will play a crucial role in further incentivizing engagement and usage on our platform.

#### **Governance** <a href="#id-8774" id="id-8774"></a>

The Gable token will also serve as a governance token. Token holders will have the opportunity to participate in the decision-making processes of Gable enabling them to vote on key proposals and protocol upgrades. This ensures that our community plays an active role in shaping the future direction of Gable.

### GAB Allocation <a href="#id-4623" id="id-4623"></a>

At genesis, **1,000,000,000 GAB** tokens will be minted, which will become available over an approx. 4.5 year period. The tokens will be allocated as following:

* 55% of tokens will be distributed to the community: **550,000,000 GAB**
* 20% of tokens will be distributed to the team: 2**00,000,000 GAB**
* 15% of tokens will be dedicated to cover operational expenses: **150,000,000 GAB**
* 10% of tokens will be distributed to investors: **100,000,000 GAB**

<figure><img src="https://1058596797-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fx43gOcmpC0zNpUCZ6GSY%2Fuploads%2FSXIRtzHaN1VI8nCU4FC7%2FGAB%20Genesis%20Allocation%20(1).png?alt=media&amp;token=734e621d-67a4-4aa8-97e7-57780cdd4263" alt=""><figcaption><p>Gab Genesis Allocation</p></figcaption></figure>

**Inflation**

We are committed to encourage active participation and contribution within the Gable. To ensure the long-term health and sustainability of our ecosystem, we are introducing a perpetual inflation rate of 1% per year. This inflation mechanism will come into effect after the last tokens from the initial release schedule have been distributed, approximately 4.5 years from now. This 1% annual inflation will **completely** be dedicated for participation on the protocol, by the community.

For more information, visit the GAB tokenomics post [here](/v1-flashloan-pool/flash-loan/fees).


# Roadmap

We are pleased to share Gable's roadmap of 2024 (and beyond) with you!&#x20;

The upcoming year promises a series of exciting new updates and features. Shaping Gable into a leading lending protocol. Below, you'll discover the key highlights of our high-level roadmap:

<details>

<summary>05-2024 Single Page Web App</summary>

The user interface for both V1 and V2 of the Gable protocol is set to be consolidated into a unified single-page web app. Functioning as the protocol's front page from a user's perspective. This web app promises a significant enhancement in user experience and overall accessibility to the protocol.

*The exact deployment date will be announced closer to the deadline.*

</details>

<details>

<summary>05-2024 V2: Bug Bounty Program</summary>

A bug bounty program of Gable V2 on Stokenet will be initiated in June. The bug bounty program rewards findings spanning frontend to contract-related bugs. Rewards vary based on impact tiers: small, medium, or high, reflecting potential material impact. This approach incentivizes thorough bug identification and resolution for a seamless user experience and operational integrity.

</details>

<details>

<summary>05-2024 V2: Stokenet</summary>

In June Gable V2 will be deployed to Stokenet and integrated into the new single page web app. The strategy is to deploy to Stokenet as soon as possible, whilst the single page web app and contract development continues. This will ensure efficient and targeted development, resulting in a faster and more robust production (mainnet) deployment.

</details>

<details>

<summary>06-2024 V2: Liquidity Incentive Program</summary>

In June, we will launch a liquidity incentive program. Earn GAB tokens passively by providing liquidity on selected DEXes. This liquidity program will kick of 1 month before the go-live of Gable V2. The exact date will be announced later.

Stay tuned for more details on how you can participate and maximize your rewards through liquidity provisioning.

</details>

<details>

<summary>07-2024 V2: Whitepaper</summary>

In July, preceding the Mainnet deployment, the Gable V2 whitepaper will be published.

</details>

<details>

<summary>07-2024: V2: Mainnet (Go-Live!)</summary>

In July we are aiming to deploy Gable V2 to Mainnet!

Gable V2 will bring **Perpetual Borrowing** to the protocol. To give you a high-level taste, this will introduce the following features from the start:

* LSU(LP) and XRD collateral
* xUSDC and xUSDT borrowing
* Borrowers:
  * Collateralised loans
    * Option to *stable* or *variable* interest rates. Where stable interest can be rebalanced under certain circumstances.
      * Interest discount for $GAB holders.
      * Dynamic interest rates based on pool utilisation rate and loan-to-value ratio.
      * Indefinite loan maturity. Borrowers are allowed to maintain the loan indefinitely, or repay at any given moment without penalty.
  * Flash loans
    * Flash loans will be available on collateral to generate additional interest.
* Lenders:
  * Cooldown period of 1 week. A week 1 withdrawal cooldown is introduced as risk management measure, to prevent a potential liquidity crash.
  * xUSD, xUSDT and XRD lending
* Protocol
  * Reserve threshold. A reserve threshold will be introduced by the protocol, to ensure that a certain percentage of supplied liquidity is available as reserve to manage a potential liquidity crash.

Preceding the actual launch of Gable V2, the following deliverables will be released:

* Gable V2 whitepaper
* Single page web app
* Gable V2 audit
* Testnet deployment

*The exact date will be announced closer to the deadline.*

</details>

<details>

<summary>08-2024 - ... V2: Expansion</summary>

Gable V2 is highly scalable and upgradeable. The number of accepted loan/supply and collateral tokens will be expended over time.

</details>

<details>

<summary>09-2024 V1.1: Redeployment</summary>

The decommissioning of Gable V1 progresses smoothly. We anticipate redeploying an updated version, V1.1, by September.

</details>

<details>

<summary>11-2024 Governance Framework</summary>

After the release of Gable V2, any modifications and updates will be proposed and subject to democratic approval through a governance protocol, with the GAB token serving as the governance token.

Before the official implementation of governance protocol changes and updates, consultations with the community will precede to ensure transparent and community-driven decision-making.

</details>

<details>

<summary>..-2025 V3</summary>

Gable V3: Peer-to-peer lending marketplace.

V3 will revolutionise lending with a peer-to-peer marketplace, directly connecting lenders and borrowers. The thrilling part? V1, V2, and V3 of the protocol can seamlessly coexist in parallel. Stay tuned!

</details>

<details>

<summary>Continuous Objectives</summary>

In addition to pre-determined and set milestone, we would like to achieve some continuous objectives:

* CEX and DEX listing of GAB token
* Team expansion
* Extend current protocol versions
  * For instance, incorporating new accepted lending and collateral tokens.

</details>


# Liquidity Program

<div align="left" data-full-width="true"><figure><img src="https://1058596797-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fx43gOcmpC0zNpUCZ6GSY%2Fuploads%2FpTjLc1gJWc4DqReTkeT4%2FLiquidity%20Incentive%20Image.png?alt=media&amp;token=3130c20f-c3cb-47ef-9a6d-8b16d74e0044" alt="" width="375"><figcaption></figcaption></figure></div>

From **September 1st to April 30th**, Gable will launch a Liquidity Incentive Program, distributing approximately **100 million $GAB** tokens to liquidity providers. This initiative aims to boost the liquidity of the $GAB token, enhancing its utility and facilitating the launch of V2, which introduces perpetual lending.

**Introduction and Purpose**

The Liquidity Incentive Program is designed to attract and reward liquidity providers (LPs) who contribute to the liquidity GAB/XRD pairs at decentralized exchanges (DEX). By boosting liquidity, we aim to ensure smooth transactions and greater stability for our native token, paving the way for the successful rollout of V2. Enhanced liquidity is crucial for enabling the $GAB token's utility.

**Rewards Overview**

Participants in the Liquidity Incentive Program will receive rewards in the form of $GAB tokens. The rewards will be distributed based on the amount of liquidity provided and the duration of participation.&#x20;

* **Rewards**: A total of **100 million GAB tokens** have been allocated for the 8 month duration of this program.
* **Distribution**: Rewards are distributed **weekly**, ensuring continuous incentives for active LPs.&#x20;
* **Allocation**: Rewards are allocated **every 5 minutes**. This means that any new LP position will be earning rewards within 5 minutes after providing liquidity.

**Quick Guide**

(assuming that you already have a Radix wallet, and tokens of the pool pair ($GAB and $XRD) to provide as liquidity)

1. **Provide Liquidity**: Choose an eligible liquidity pool and add liquidity.
2. **Earn Rewards**: Start earning rewards within 5 minutes, distributed weekly.
3. **Monitor and Withdraw**: Track your rewards [here](https://app.gable.finance/liquidity-incentive) and withdraw them at your convenience via the DEX (see below).

**Liquidity Pools**

The following liquidity pools are eligible for the incentive program:

* [**Ociswap GAB/XRD pool**](https://ociswap.com/pools/component_rdx1czzc2kztr3cfuu6twpz43vth428jv9a79u0jw2vfresgfh5zpds08d/)
* More coming soon

By participating in this Liquidity Incentive Program, you contribute to the growth and stability of our ecosystem, ensuring a successful V2 launch and a robust token economy. Join us in this exciting journey and start earning rewards while supporting the future of decentralized finance.


# Introduction

Radix DLT is a cutting-edge decentralized ledger technology that forms the foundation for Gable liquidity protocol. Radix DLT provides a robust, secure and scalable infrastructure for the transfer and management of digital assets.

At its core, Radix DLT offers a unique architecture that addresses the scalability limitations of traditional blockchain networks. By implementing a groundbreaking technology called Cerberus ([research paper](https://arxiv.org/abs/2008.04450)), Radix DLT enables parallel processing of transactions, allowing for high throughput and low latency. This innovative approach ensures that our liquidity protocol can handle a large number of transactions efficiently, providing a seamless user experience.

For more information on Radix DLT please visit [RadixDLT.com](https://www.radixdlt.com/).

Why have we chosen Radix DLT as Infrastructure? This decision was driven by several key factors that make Radix DLT an ideal choice for our platform:

1. Scalability: Radix DLT's [scalable infrastructure](https://learn.radixdlt.com/article/what-is-linear-scalability) allows our protocol to handle a significant volume of transactions, ensuring smooth and uninterrupted liquidity operations. This scalability is essential as it enables us to meet the growing demands of our users while maintaining optimal performance.
2. Security: Radix DLT places a strong emphasis on [security](https://learn.radixdlt.com/article/what-do-security-safety-and-liveness-mean), implementing robust consensus mechanisms and encryption protocols. By leveraging this secure infrastructure, our liquidity protocol can offer users a safe and reliable environment for their transactions and assets.
3. Composability and Interoperability: Radix DLT is designed with [(atomic-)composability](https://learn.radixdlt.com/article/what-is-atomic-composability) and interoperability in mind, enabling seamless integration with other blockchain networks and protocols. Atomic Composability is the feature that makes it possible to combine any number of applications together in any shape or form - and for all these parts to be combined atomically as a single transaction that either succeeds all together, or fails all together. This is a crucial feature for Gable liquidity protocol as it opens the opportunity to develop products that are unique to Radix.
4. Developer-Friendly Environment: Radix DLT provides a developer-friendly environment with comprehensive tooling and resources. The asset oriented approach that Radix has chosen to design its network and smart contract language ([Scrypto](https://learn.radixdlt.com/article/what-is-scrypto)) perfectly suits Gable's use case. This empowers our team to build and iterate on Gable liquidity protocol efficiently, enabling us to deliver innovative features and enhancements to our users.

In conclusion, Radix DLT offers a powerful infrastructure that aligns with the requirements of our liquidity protocol. Its scalability, security, composobality and developer-friendly environment make it the perfect choice for our platform. By leveraging Radix DLT, we are confident in delivering a robust and efficient liquidity protocol that meets the needs of our users and drives the advancement of decentralized finance.


# Staking Liquidity

Gable's first liquidity pool will utilize staking rewards as a means to collect liquidity. This innovative approach allows liquidity suppliers to leverage their assets **twice**, (1) by staking and earning staking rewards, and (2) by supplying the staking rewards and earnings interest.&#x20;

This section will cover the following topics:

* Introduction: Gain understanding of the concept of supplying liquidity through staking rewards and learn about the associated benefits and drawbacks.
* [APY: learn about the annual percentage yield that is offered by supplying liquidity on Gable, what the APY is comprised of, and how it is derived.](#user-content-fn-1)[^1]
* Pay-out Scheme: Discover the incentives for supplying liquidity, how earnings are allocated, and why this approach is taken.&#x20;
* User Manual: Follow a step-by-step guide on how to supply liquidity, and subsequently how to withdraw.
* [Security and Risks: Learn about the measures taken to ensure the security of liquidity, and resources in general, in the protocol, and what the potential involved risks are.](#user-content-fn-1)[^1]

[^1]: WIP


# Introduction

This introduction aims to provide you with a comprehensive understanding of the concept of supplying liquidity through staking rewards, and explore the associated benefits and considerations.&#x20;

### Staking

Staking refers to the act of locking your tokens or cryptocurrencies in a designated wallet to support the security and operation of a decentralized network. You can find more information on what staking entails on Radix [here](https://learn.radixdlt.com/article/start-here-radix-staking-introduction). In our case, by staking your assets to our validator node, you (1) become an essential part of the Radix DLT ecosystem and (2) enable the issuance of lending products powered by our liquidity protocol.

### Liquidity via Staking Rewards

Liquidity collection via staking rewards is a novel and powerful mechanism that allows suppliers to stake their assets (XRD) to Gable's validator node, and contributing the earned staking rewards to a liquidity pool.&#x20;

One of the significant benefits of participating in liquidity collection via staking rewards is the opportunity to earn passive income twice (!), (1) on XRD that you stake, and subsequently (2) on the rewards earned from staking.&#x20;

1. As a supplier, when you stake your assets to our validator node, you contribute to the consensus and validation process of the Radix network. In return for your contribution, you receive rewards in the form of additional tokens. These rewards can serve as a consistent income stream, allowing you to benefit from your involvement without actively participating in day-to-day trading or complex investment strategies.
2. The rewards that you have earned from staking are contributed to Gable's liquidity pool, from which lending products are offered. The issuance of these lending products generate interest income, that is distributed, equally, to the suppliers and Gable Liquidity Protocol.&#x20;

Liquidity collection via staking rewards offers a unique opportunity for asset holders to leverage their holdings effectively. Instead of keeping your assets idle, staking them to our validator node allows you to put them to (extra) work by supporting the issuance of lending products. By doing so, you actively contribute to the liquidity and efficiency of the ecosystem while earning rewards in the process. This mechanism not only provides you with a potential source of income but also enables you to actively participate in the growth and development of the Radix DLT ecosystem.

However, it is essential to consider certain drawbacks and considerations associated with staking and liquidity collection via staking rewards:

1. While staking your assets can be rewarding, it's important to assess the risks involved, such as market volatility, potential slashing risks and falling out of the top validators entitled to rewards. Understanding these risks and developing a risk management strategy will help you make informed decisions and navigate the staking process more effectively<br>

2. By staking your assets to our validator node, you commit to a certain lock-up period during which your assets will be inaccessible for other purposes. This lock-up period on Radix DLT is generally around 2016 epochs (approx. one week), but can vary depending on the protocol and network rules. It's crucial to assess your liquidity needs and ensure that you can afford to have your assets tied up for the specified duration. <br>

   Furthermore, staking rewards are gathered by the validator owner and subsequently deposited into the liquidity pool on behalf of the stakers. However, there is an additional waiting period of approximately four weeks that validator owners must endure. This results in a four-week delay between the issuance of staking rewards and their actual deposit into the liquidity pool. Once this initial four-week period is surpassed, rewards will be continuously added to the pool. This arrangement carries several implications:

   1. Initially, during the first four weeks, no rewards will be available in the liquidity pool. This may impact early adopters. To address this, compensation will be provided to this group of users in the form of Gable token airdrops. After this initial period, rewards will be consistently accrued in the pool.
   2. Structurally, as a stream of incoming rewards is established, new users will receive rewards that were issued four weeks prior to their onboarding. In essence, the rewards they collect will be offset by a four-week window. The significance of this offset depends on the fluctuations in two key factors: the annual percentage yield (APY) and the number of stakers participating at Gable within that four-week window. It's worth noting that rapid changes in both of these factors are unlikely in practice.

3. Traditionally, when staking your assets with a validator node, you have the opportunity to compound your rewards over time. This means that as you continue to earn staking rewards, those rewards are added to your staked assets. The compounding effect of this is balanced out as every staker enjoys the same relative benefit. <br>

   However, when you contribute your staking rewards to a liquidity pool, they are no longer actively staked with the validator node. Thus, you will lose the compounding effect. Whilst your stake remains the same, the stake of stakers at other validators increases due to compounding rewards. This can result in a slowly decreasing staking APY.&#x20;

It's important to note that while you may lose compounding effect on staking rewards, you will gain compounding effect from the liquidity pool. Participants who contribute liquidity will receive a share of the interest earnings generated by the protocol's activities. These interest earnings can provide their own potential for compounding. The proposition of Gable is that the income from the liquidity pool should exceed the income from compounding rewards.&#x20;

In conclusion, liquidity collection via staking rewards presents an exciting opportunity for participants in the Radix DLT ecosystem to contribute their assets, support the issuance of lending products, and earn rewards for their involvement. By staking your assets to our validator node, you actively contribute to the growth and sustainability of Gable liquidity protocol. While there are associated benefits and considerations to be mindful of, such as potential risks and lock-up periods, this mechanism allows you to participate in the evolving landscape of decentralized finance and leverage your assets effectively. We invite you to explore and engage in liquidity collection via staking rewards as we build a vibrant and thriving ecosystem on Radix DLT.


# APY

Supplying liquidity via staking rewards at Gable is subjected to three different annual percentage yields (APY's): ***Staking APY***, ***Interest APY*** and ***Total APY***. This section will explain to you how these APY are derived.

First of all, a 7 day time window is considered when calculating all above mentioned APY. The 7 day yield is subsequently extended to annually.

### Staking APY

The staking APY represents the yield obtained by staking at the Gable validator node. It is calculated using the following formula(s):

$$
TotalStake\_{t, i} = Stake\_{t-i}+StakingRewards\_{t-i}
$$

where 't' is the most recent time, and 'i' is the lag in days.

$$
StakingAPY\_t = \frac{{TotalStake\_{t=0} - TotalStake\_{t-7}}}{{TotalStake\_{t-7}}} \times \left(\frac{{365}}{{7}}\right) \times 100
$$

### Interest APY

The interest APY represents the yield obtained on your staking rewards when you supply them to the Gable liquidity pool. The interest earned from staking rewards is distributed back into the pool, effectively compounding your earnings. The interest APY is calculated using the following formula(s):

$$
TotalEarnings\_{t, i} = StakingRewards\_{t-7}+InterestEarnings\_{t-i}
$$

where 't' is the most recent time, and 'i' is the lag in days.

It is important to note that the StakingRewards component provides a stable reference point by considering its value at 't-7' as a static factor. This allows for consistent and accurate calculations of the Interest APY.

$$
InterestAPY = \left(1 + \frac{{TotalEarnings\_{t=0} - TotalEarnings\_{t-7}}}{{TotalEarnings\_{t-7}}}\right)^{\frac{{365}}{{7}}-1} - 1
$$

### Interest APY

When you stake, you earn staking rewards. By supplying these staking rewards to the pool, you further earn interest on them. This interest can be viewed as a compounding yield on your initial staking rewards.

The Total APY takes into account the growth of your staking rewards through staking and the subsequent interest earned through supplying. This compounding effect results in a higher overall yield on your staked assets.

The Total APY is calculated using the following formula:<br>

$$
TotalAPY = (1 + StakingAPY) \* ( 1 + InterestAPY) - 1
$$


# Pay-out Scheme

The resources that the supplier is entitled to can be divided into two categories: (1) staking rewards and (2) Interest earnings

### Staking rewards

Gable validator node charges a 100% fee on staking rewards earned by participants. However, instead of keeping this fee, the protocol facilitates the direct deposit of staking rewards into the liquidity pool. As a result, the effective staking fee for suppliers becomes 0%, as they can retrieve their staking rewards from the liquidity pool. This setup enables suppliers to participate in the staking process without incurring any direct fees, allowing them to fully benefit from the rewards generated by their staked assets. It aligns the interests of the protocol and the suppliers, creating a fair and transparent system for liquidity provision and staking participation.

### Interest earnings

You may wonder, how does Gable earn revenue? Gable generates revenue through the issuance of lending products to borrowers. The funds for these products are financed by the staking rewards contributed by our suppliers. The interest earnings generated from the lending activities are then divided equally between the suppliers and the protocol. This means that both parties receive an equal share of the interest earnings, providing a fair and balanced distribution of the generated profits. By sharing the rewards in this manner, we incentivize suppliers to contribute their assets and participate in the liquidity pool, fostering a mutually beneficial ecosystem for all stakeholders involved.

The following table illustrates the composition of earnings:

|                   | Supplier | Gable |
| ----------------- | -------- | ----- |
| Staking rewards   | 100%     | 0%    |
| Interest Earnings | 50%      | 50%   |


# User Manual

\*WIP\*


# Security and Risks

WIP


# Flash Loan

Flash loans offer users the ability to borrow a significant amount of funds without requiring any collateral. These loans are executed and settled within a single transaction on the blockchain, providing near-instant access to capital. The main feature offered by Gable Liquidity Protocol at the current time are $XRD flash loans.

Flash loans are a powerful tool that offer endless opportunities. However, they require careful execution and understanding of risks. This section will ensure that users acquire the diligence and knowledge necessary to utilise flash loans in a save and responsible manner.&#x20;

**What You'll Learn**

1. An Overview of Flash Loans: Understand the fundamentals of flash loans, including how they work, their advantages, and potential risks.
2. Flash Loan Use Cases: Discover the wide range of applications for flash loans in DeFi, including arbitrage, collateral swapping, and portfolio rebalancing.
3. Advanced Strategies: Dive deeper into advanced flash loan techniques, such as composability, flash loan chaining, and flash loan derivatives.
4. User Manual: Get a detailed walkthrough of the process involved in executing a flash loan on Gable.
5. [Demonstration: A comprehensive demonstration will be provided of how to execute a flash loan on Gable.](#user-content-fn-1)[^1]
6. [Fees: Learn about the fees associated with lending at Gable.](#user-content-fn-1)[^1]
7. Best Practices and Security Considerations: Learn essential tips and security measures to follow when working with flash loans, ensuring a safe and successful borrowing experience.

**Note**: remember to exercise caution, conduct thorough research, and always prioritize the security of your funds throughout your flash loan journey.

[^1]: WIP


# Fundamentals

A flash loan is a unique feature within decentralized finance (DeFi) that allows users to borrow a specific amount of funds temporarily without requiring collateral. Unlike traditional loans, flash loans enable borrowers to access liquidity instantly and without the need for upfront assets.

The key characteristic of a flash loan is that it must be repaid within the same transaction in which it was borrowed. If the borrower fails to repay the loan in its entirety by the end of the transaction, the loan is automatically reversed, ensuring the lender's funds are never at risk.

Flash loans are made possible through smart contracts, self-executing agreements that automatically execute specific actions when predetermined conditions are met. These contracts reside on blockchain platforms, such as Ethereum or Radix DLT, and facilitate the borrowing and repayment process.

The underlying process of a flash loan on Gable consists of several steps:

1. Borrowing: The borrower initiates a flash loan by interacting with a smart contract that supports flash loan functionality. The borrower specifies the desired loan amount in XRD.
2. loan approval: The smart contract verifies if the requested amount is available in the liquidity pool.
3. Loan Execution: Once the flash loan is approved, (1) the loan amount in XRD and (2) a transient NFT token are provided. \
   A transient NFT token is a token which can not be withdrawn or deposited into any wallet. It can be minted, burned, but not deposited or withdrawn. \
   The borrower is allowed to utilise the loaned amount for various purposes within the transaction. This can include arbitrage opportunities, collateral swapping, or other types of DeFi operations.
4. Repayment: The borrower must repay the flash loan amount, including interest rate along with the transient token, by the end of the transaction. If the loan's conditions are met, the smart contract will burn the transient token, so that the transaction can succeed. Failure to meet the loan's condition will withhold the transient token to be burned, resulting in the automatic reversal of the loan, canceling the transaction and returning the borrowed funds to the lender.

Flash loans offer several advantages in the DeFi space. Firstly, they provide instant liquidity without the need for collateral, allowing users to access substantial funds for various purposes, such as capitalising on market inefficiencies or executing complex trading strategies. Flash loans also promote financial innovation by enabling users to create novel applications and optimize their financial operations.

However, it is important to note that flash loans also come with risks. The main risk is the requirement for repayment within the same transaction, which makes them highly dependent on the success of the planned operations. If the borrower fails to generate sufficient profit or complete the intended actions within the transaction, they may not be able to repay the loan, resulting in its automatic reversal. Additionally, the volatility and unpredictable nature of the cryptocurrency markets can amplify these risks.

To mitigate these risks, borrowers often perform thorough analysis and implement well-defined strategies before executing a flash loan. They may also leverage risk management techniques, such as using stop-loss orders or limit their exposure to a percentage of the borrowed funds.

In summary, flash loans provide a powerful tool for accessing instant liquidity within the DeFi ecosystem. By leveraging smart contracts and blockchain technology, borrowers can borrow funds without collateral, opening up opportunities for innovative financial strategies and applications. However, careful consideration of risks and proper planning is essential to ensure successful loan execution and repayment within the specified timeframe.


# Use Cases

Flash loans have emerged as a powerful tool within the decentralized finance (DeFi) ecosystem, offering unique opportunities for users to access large sums of cryptocurrency on a temporary basis. These loans have gained popularity due to their innovative design and the variaty of use cases they enable. Let's explore some of the key use cases for flash loans.

### **Arbitrage**

Flash loans have become a powerful tool for arbitrageurs within the decentralized finance (DeFi) space. Arbitrage involves taking advantage of price discrepancies between different exchanges or markets. Flash loans enable users to borrow a large sum of cryptocurrency for a single transaction, allowing them to execute a series of trades to exploit these price differences. By quickly capitalizing on market inefficiencies, arbitrageurs can generate profits without the need for substantial capital or collateral.

### **Liquidity provision**

Flash loans also serve as a crucial tool for liquidity providers in DeFi ecosystems. Liquidity providers often face challenges when it comes to balancing their positions across different pools. Flash loans allow them to borrow funds temporarily, swiftly move assets between pools, rebalance their positions, and then return the borrowed funds. This flexibility enables liquidity providers to optimize their capital allocation, increase their returns, and enhance the overall liquidity available in the market.

### **Collateral swaps**

Flash loans offer a convenient solution for users who find themselves locked into positions they wish to exit. Through a flash loan, users can borrow funds to repay existing debts, swap collateral, and then repay the loan. This mechanism enables efficient reallocation of assets and mitigates the risk of being stuck with undesirable collateral. Collateral swaps using flash loans provide users with increased flexibility and the ability to adapt their positions in response to market conditions.

### **Capital-efficient trading**

Flash loans facilitate capital-efficient trading strategies for DeFi traders. Traders can borrow a significant amount of capital to execute complex trading strategies that require substantial liquidity. By utilizing flash loans, traders eliminate the need to hold a large capital base, as they can borrow the necessary funds temporarily. Once the trades are completed and profits are realized, the loan can be repaid, leaving the trader with the net profit. This capital-efficient approach enables traders to optimize their trading strategies and improve their overall returns.

### **Protocol interactions**

DeFi protocols often have interdependencies, requiring users to interact with multiple platforms and contracts to achieve their desired outcomes. Flash loans simplify this process by enabling users to borrow funds and execute transactions across multiple protocols in a single atomic transaction. This seamless integration of protocols promotes composability and opens up new possibilities for DeFi applications. Flash loans empower users to leverage the functionalities of various protocols simultaneously, facilitating complex financial operations and expanding the potential for innovation in the DeFi ecosystem.


# User Manual

This guide provides a tutorial on how to manually execute flash loans! We will explore the world of flash loans and how you can leverage them and access instant liquidity on Radix DLT via Gable Protocol.&#x20;

This user guide aims to provide you with a comprehensive and fundamental understanding of flash loans, their benefits, and the practical steps to utilise them effectively. Whether you are an experienced DeFi user or new to the concept of flash loans, this guide will equip you with the knowledge and tools to utilize the power of flash loans.&#x20;

**Let's get started!**


# 1. Dependencies

To get you set-up you first need to meet several key dependencies. These dependencies ensure the smooth functioning and secure execution of flash loans as offered by Gable.

## Radix DLT Network

Gable is build on Radix DLT. To interact with Gable's flash loan feature you have to be connected to the Radix DLT network. This can be achieved by setting up the following components:

### Radix Wallet and Connector

The **Radix Wallet** is a mobile app where you can easily view and manage all your accounts and assets, and connect to a limitless variety of decentralised applications (dApps), like Gable's. The wallet offers a user-friendly interface for borrowers to request and repay flash loans, as well as for lenders to provide liquidity and earn interest.&#x20;

The Radix Connector is a chrome browser extension. The connector lets your Radix Wallet connect to dApp websites.

The radix wallet and connector can be installed by following the guide [*here*](https://wallet.radixdlt.com/).

### Radix Account

To be able to interact with any dApp, a personal Radix account is required. This can be created in the Radix Wallet by following the steps as explained by the wallet interface.


# 2. Transaction Manifest

As flash loans are executed within a single transaction, you are required to tailor a transaction. Tailoring and building a transaction can be done in multiple ways, either manually, semi-automatically and fully automatically. To actually understand what happens under the hood, we will first walk through the manual way of tailoring a transaction. To build a transaction manually we need to take a closer look at what is called the "transaction manifest".

### Transaction manifest

"A transaction manifest is the Radix way of building transactions. It makes it possible to compose multiple actions to be executed atomically by describing a sequence of component calls and movements of [resources](https://docs-babylon.radixdlt.com/main/scrypto/resources/introduction.html) between components. In short, full atomic composability becomes possible directly in transactions" - see [link](https://docs-babylon.radixdlt.com/main/scrypto/transaction-manifest/intro.html) for more detail.

Below the most basic transaction is demonstrated as transaction manifest. This is what happens:

1. A "lock fee" method is called on an account address that locks some XRD as fee. "lock\_fee" will immediately add the associated amount of XRD to the fee reserve. This XRD can be used to pay for ongoing processing during the transaction’s execution, and can be spent even if the transaction ultimately fails in its execution. See [article](https://docs-babylon.radixdlt.com/main/scrypto/system/fees.html).
2. A "withdraw" method is called on an account address that takes some amount of a resource from the account. If you want to use XRD to fund a certain action, this method is required to get the XRD into the transaction.
3. A "take\_from\_worktop\_by\_amount" is called on some amount of a resource, takes it from the worktop, and puts it in a bucket. This operation is a bit less intuitive, please read [this](https://docs-babylon.radixdlt.com/main/scrypto/transaction-manifest/intro.html#_the_worktop) post for more information. In essence you can think of the "worktop" as a distribution centre, or a layer on top of a transaction, that orchestrates resources from one instance to the other. Unused resources will be stored in the worktop during a transaction, and have to be withdrawn to be exchanged.
4. A "deposit" method is called that takes some bucket and deposits it into a account address. This is final operation that finalises the transaction.\
   \
   **Note:**  no resources are allowed to be left in the worktop for a transaction to be completed. Therefore it is of importance that all hanging resources are deposited at the end of a transaction.

<pre class="language-http"><code class="lang-http"><a data-footnote-ref href="#user-content-fn-1"># lock fees to pay for the transaction</a>
CALL_METHOD
  Address("[your_account_address]")
  "lock_fee"
  Decimal("[amount]");

# withdraw 10 XRD from account, which goes to the worktop
CALL_METHOD
  Address("[your_account_address]")
  "withdraw"
  ResourceAddress("[xrd_address]")
  Decimal("[amount]");

# take 10 XRD from the worktop and put it in a bucket
TAKE_FROM_WORKTOP_BY_AMOUNT
  Decimal("10")
  Address("[xrd_address]")
  Bucket("xrd");

# deposit the bucket of XRD into the recipient's account
CALL_METHOD
  Address("[your_account_address]")
  "deposit"
  Bucket("xrd");
</code></pre>

The above transaction is considered a simple "one component" transaction. Although the skeleton of the flash loan transaction will be similar, a flash loan will interact with more components during the same transaction, and is therefore considered a complex transaction. The next section will describe what flash loan transaction manifest will look like.

[^1]: This method is redundant, as the radix wallet will add it automatically to any transaction.


# 3. Build Flash Loan

### Flash loan transaction manifest

A flash loan transaction typically interacts at least 3 times with components - to get, use and repay the loan. However, depending on the use case, the number of interactions might increase.

Therefore, on a high level, a flash loan transaction manifest can be broken down into:

1. Getting a loan
2. Using a loan
3. Repaying a loan

Below a transaction manifest for a flash loan on Gable is illustrated:

<pre data-full-width="false"><code># Gable flash loan transaction

# (1) get loan

# call get flashloan method
#    provide: loan amount
#    return: loan + transient token
CALL_METHOD 
Address("component_rdx1cpmh7lyg0hx6efv5q79lv6rqxdqpuh27y99nzm0jpwu2u44ne243ws") 
"get_flashloan" 
Decimal("&#x3C;loan_amountt>");

# (2) use loan

# take XRD loan from worktop
TAKE_FROM_WORKTOP 
Address("resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd") 
Bucket("xrd_bucket1");

# for instance call a method that takes some XRD ...
# ... and returns GAB
CALL_METHOD 
"swap"
Address("&#x3C;some_component_address>") 
Bucket("xrd_bucket1");

# take GAB loan from worktop
TAKE_FROM_WORKTOP 
Address("resource_rdx1tknu3dqlkysz9lt08s7spuvllz3kk2k2yccslfpdk73t4lnznl9jck") 
Bucket("gab_bucket");

# for instance call a method that takes some GAB ...
# ... and returns some XRD
CALL_METHOD 
"swap"
Address("&#x3C;some_component_address>") 
Bucket("gab_bucket");

# (3) return loan

# take XRD from worktop
TAKE_FROM_WORKTOP 
Address("&#x3C;resource_tdx_c_1qyqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq40v2wv>") 
Bucket("xrd_bucket2");
<strong>
</strong><strong># take transient token from worktop
</strong><strong>TAKE_FROM_WORKTOP 
</strong><strong>Address("resource_tdx_c_1q2xltzyu94nesddh0yyq9h9vuzz5l904n2yt93ltfsssg3ygd5") 
</strong><strong>Bucket("transient_bucket");
</strong>
# call repay flashloan method
#    provide: XRD plus transient token
#    return: residual XRD
CALL_METHOD 
Address("component_tdx_c_1qwxltzyu94nesddh0yyq9h9vuzz5l904n2yt93ltfsssa7pd6s") 
"repay_flashloan" 
Bucket("xrd_bucket2") 
Bucket("transient_bucket");

# the residual XRD (your profit) will be returned to your wallet
CALL_METHOD 
Address("&#x3C;<a data-footnote-ref href="#user-content-fn-1">your_account_address</a>>") 
"deposit_batch" 
Expression("ENTIRE_WORKTOP");
</code></pre>

Tailoring this transaction to your use case will require you to (1) fill in open fields:

* \<loan\_amount>: the loan amount in XRD that you would like to receive.
* \<your\_account\_address>: the account address to which you would like to return the residual XRD of the transaction (you profit).

And (2) overwrite the 'use loan' section with your specific use case.

**Note:** no method call to “lock\_fee” is required – the wallet will add this automatically.

[^1]:


# 4. Execute Flash Loan

Now that you know how to tailor your transaction, by using the transaction manifest, to perform an end-to-end flash loan, it is time to learn how to actually execute it.

1. First of all, to be able to execute any form of transaction, you have to be connected to the Radix network.&#x20;

* On desktop, you can do this by connecting to the Radix Wallet phone app, via the Radix wallet extension. This can be achieved by clicking on the "connect" button on the top right screen of any dApp (like [gable.finance](https://docs.gable.finance/v1-flashloan-pool/flash-loan/user-manual/www.gable.finance)) or the [Radix Dashboard](https://rcnet-dashboard.radixdlt.com/).&#x20;
* On phone, you have to have your Radix Wallet phone app opened.&#x20;

2. Once connected, the Radix Dashboard (on desktop) or Radix Wallet (on phone) offer a "send tokens/nft" or "send raw transaction" option. The "send raw transaction" option takes in a transaction manifest and processes this into a transaction on the Radix Network.&#x20;
3. Press "send" and approve the transaction on your phone accordingly. Your transaction will now be broadcasted to the network.&#x20;
   * Transaction succeeded: In case that your transaction is succeeded - congrats!
   * Transaction fail: the transaction manifest is sensitive to typo's and minor discrepancies. See below section for more information on potential errors that you can encounter, and how to solve them.&#x20;


# 5. Automate Flash Loan

Understanding the manual task of building and executing a transaction manifest is fundamental to working with flash loans. However, being able to automate this process will save time, resources, and the risk of human-error. This section will describe how this automatic process can be achieved.&#x20;

\*WIP\*


# Advanced Strategies

While basic flash loan functionality has already opened up a wide range of possibilities, advanced strategies take it a step further, introducing new dimensions of composability, flash loan chaining, flash loan derivatives and many more.

### Composability

Composability is a key concept in DeFi, allowing different protocols and smart contracts to seamlessly interact and combine functionalities. With flash loans, composability takes on a whole new level of sophistication. By leveraging flash loans as liquidity bridges, users can optimize their capital allocation and execute complex strategies across multiple protocols in a single transaction.

One popular use case of composability is arbitrage. Traders can take advantage of price discrepancies between different decentralized exchanges (DEXs) or liquidity pools by using flash loans to borrow funds, execute trades, and capture profits within the same transaction. Composability enables traders to tap into multiple liquidity sources and execute arbitrage opportunities across various protocols simultaneously, maximizing their profit potential.

### Flash Loan Chaining

Flash loan chaining takes the concept of composability to the next level. Instead of executing a single flash loan within a transaction, users can chain multiple flash loans together, creating intricate sequences of borrowing and arbitrage. This technique allows for more sophisticated trading strategies and opens up opportunities for arbitrage across multiple markets and protocols, multiplying the potential profit generated from a single flash loan.

### Flash Loan Derivatives

Another advanced strategy involves flash loan derivatives. Derivatives are financial instruments whose value is derived from an underlying asset. With flash loan derivatives, users can create and trade derivative products based on the value and performance of flash loans themselves. These derivative contracts can be used to hedge against flash loan risks, speculate on flash loan volumes, or create new financial instruments that capture the dynamics of flash loan markets.

Furthermore, flash loan derivatives enable the creation of synthetic flash loans, which are virtual flash loans with no actual borrowing involved. Synthetic flash loans allow users to simulate flash loan functionality and test complex trading strategies without the need for real capital. This helps traders refine their techniques, develop new trading algorithms, and experiment with different market conditions in a risk-free environment.

### **Algorithmic Trading with Flash Loans**

Advanced traders and developers can utilize flash loans in algorithmic trading strategies. By leveraging real-time market data and executing a series of trades within a flash loan transaction, users can automate trading strategies and capture profit opportunities based on predefined parameters. This approach allows for rapid and efficient trading without the need for substantial capital.

### **Leveraged Yield Farming**

Yield farming involves providing liquidity to DeFi protocols in exchange for rewards or yields. Advanced users can combine flash loans with yield farming strategies to amplify their potential returns. By leveraging flash loans to borrow additional funds, users can increase the amount of capital deployed in yield farming strategies, thereby boosting their overall yield and compounding their rewards.

### **Flash Loan Debt Cycling**

Flash loan debt cycling is a technique where users repeatedly borrow and repay flash loans to manipulate or optimize their debt positions. This strategy involves borrowing a flash loan to repay an existing debt, obtaining more favorable terms or interest rates. By carefully orchestrating multiple flash loans in a cyclic manner, users can effectively manage and optimize their debt obligations across various lending platforms.&#x20;

These advanced use cases and strategies unlock new possibilities for traders, arbitrageurs, and developers alike. Enabling users to optimize capital allocation, create complex trading sequences, and explore synthetic flash loan environments. It's important to note that advanced flash loan strategies come with increased complexity and risk. Proper understanding of the underlying protocols, smart contract security, and market dynamics is crucial. By harnessing the power of advanced flash loan strategies responsibly, users can continue to drive innovation and push the boundaries of decentralized finance.


# Demonstration

WIP


# Fees

Flash loan fees has been set at 0.1%. It's a small cost that enables everyone to unlock instant liquidity in a profitable manner.&#x20;

If you think the fee should be different, you can have a say! Our community can vote and decide on changes, making it a platform that evolves with you.


# Best Practices and Security

When engaging with flash loans on Gable, it's essential to adhere to best practices and implement robust security measures. By following these guidelines, you can ensure a safe and successful borrowing experience. Here are some key considerations:

1. **Thoroughly understand the flash loan mechanism:** Before utilizing flash loans, take the time to grasp the underlying technology and its limitations - i.e. by walking through the content in the 'Flash Loan' section. Familiarize yourself with Gable Liquidity Protocol, the specific requirements for borrowing and repaying loans, and the potential risks involved. Understanding the process will help you make informed decisions and mitigate potential pitfalls.
2. **Perform due diligence on the lending platform:** Choose a reliable and reputable lending platform. Although we from Gable are proud and confident of our security standards, it is important to perform your own due dilligence too. Review the platform's history, user feedback, and any security incidents that may have occurred in the past.
3. **Implement smart contract security measures:** If you're developing or deploying smart contracts for flash loans, prioritize robust security practices. Follow best practices for code development, including thorough testing, peer review, and external audits. Utilize secure coding standards and libraries to minimize the risk of vulnerabilities, such as reentrancy attacks or unchecked external calls.
4. **Verify contract addresses and dependencies:** Ensure that the smart contracts you interact with are legitimate and from trusted sources. Always double-check the contract addresses and dependencies to avoid falling victim to phishing attacks or interacting with malicious contracts that could compromise your funds.
5. **Perform comprehensive testing:** Before executing flash loan transactions, thoroughly test your code and strategies in a controlled environment. Use test networks and simulators to simulate real-world scenarios and identify any potential issues or vulnerabilities. Testing allows you to validate the effectiveness and safety of your approach before deploying it in a live environment.
6. **Monitor and respond to market conditions:** Keep a close eye on market conditions and evaluate the feasibility of your flash loan strategies in real-time. Stay informed about potential risks, such as high volatility or liquidity constraints, and adjust your plans accordingly. Having a proactive approach to market monitoring helps you mitigate risks and optimize the success of your flash loan transactions.
7. **Exercise caution with borrowed funds:** Use flash loans for their intended purposes and avoid speculative or high-risk activities that could lead to losses. Plan your borrowing and repayment strategies carefully, ensuring that you have a clear plan in place before executing any flash loan transactions.

By adhering to these best practices and security considerations, you can enhance the safety and success of your flash loan experiences. Remember, maintaining a proactive and security-conscious mindset is crucial when working with DeFi tools and protocols.


# Lending

COMING SOON


# Borrowing

COMING SOON


# Bug Bounty

### Bug Bounty Program

We are excited to announce our Bug Bounty Program aimed at enhancing the security and reliability of Gable V2. We invite everyone to help us identify and resolve any technical issues. Our program covers two main areas: technical bugs in the backend contract and front-end bugs.

#### Scope

1. **Back-End Contract Bugs**
   * **Critical Severity**: Bugs that could result in a total failure of the contract. Resolving this failure woud require the isolation of custody/funds, and a upgrade of the contract.
   * **High Severity**: Bugs that could cause partial loss of funds, severe degradation of service, or major security vulnerabilities.
   * **Medium Severity**: Bugs that affect functionality or performance without immediate serious consequences.
2. **Front-End Bugs**
   * **Critical Severity**: Bugs that cause the front-end to crash or result in a complete loss of user functionality.
   * **High Severity**: Bugs that significantly impair the user experience or expose sensitive user information.
   * **Medium Severity**: Bugs that cause minor disruptions or have a moderate impact on user experience.

#### Rewards

Rewards will be issued based on the severity of the reported bugs:

**Backend Contract Bugs**

* **Critical Severity**: Up to 500.000 $GAB
* **High Severity**: Up to 100.000 $GAB
* **Medium Severity**: Up to 10.000 $GAB

**Front-End Bugs**

* **Critical Severity**: Up to 100.000 $GAB
* **High Severity**: Up to 50.000 $GAB
* **Medium Severity**: Up to 10.000 $GAB

#### Submission Guidelines

1. **Bug Summary**: Submit a clear and detailed summary of the bug with screenshots, including steps to reproduce, potential impact, and suggested fixes (if available).
2. **Responsible Disclosure**: Do not publicly disclose the bug until it has been fixed and you have received permission to do so.

#### Terms and Conditions

* All submissions must be your original work.
* Only the first report of a specific bug will be eligible for a reward.
* We reserve the right to adjust the reward amount based on the quality of the report and our internal assessment of the bug’s impact.
* Our decision on the severity classification and reward amount is final.

#### How to Participate

To 1) participate in back-end bug bounty or 2) submit your bug, please reach out via below channels:

1. Mail: <contact@gable.finance>
2. Telegram: @GableFinance
3. Discord: @GableFinance

Include all necessary information as outlined in the Submission Guidelines.

Thank you for helping us improve the security and reliability of our platform!


# Borrow

To borrow at Gable V2 Stokenet, you can follow the below guide.

1. Request XRD tokens

![](https://1058596797-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fx43gOcmpC0zNpUCZ6GSY%2Fuploads%2FbRXNHsct6CNa7CaqM7GS%2FNaamloze%20tekening%20\(7\).png?alt=media\&token=c7fe4625-774d-4165-8080-f30eadb5f47b)

2. Provide XRD as collateral

<figure><img src="https://1058596797-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fx43gOcmpC0zNpUCZ6GSY%2Fuploads%2FbFj1SMHzB4WpOrcXYXG4%2Fimage.png?alt=media&amp;token=90dfe511-4011-4b52-9d54-2adc9fbddb72" alt=""><figcaption></figcaption></figure>

3. Borrow GTT (Gable Test Token)

<figure><img src="https://1058596797-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fx43gOcmpC0zNpUCZ6GSY%2Fuploads%2FN1P7IsIKOrvYlgGAqCfA%2Fimage.png?alt=media&amp;token=9ee8fb6f-83bc-49ff-b842-90b4f310d3fb" alt=""><figcaption></figcaption></figure>

4. Enjoy interacting


# Supply

To supply liquidity at Gable V2 Stokenet, please follow the below guide:

1. Request supply token (GTT)

GTT (Gable Test Token) are used as lendable assets on Stokenet. To be able to supply this asset, please share your Stokenet wallet address via:

* Gable Telegram
* Gable Discord
* Mail to <contact@gable.finance>

2. Supply GTT

<figure><img src="https://1058596797-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fx43gOcmpC0zNpUCZ6GSY%2Fuploads%2FiK4BJA1RdO151lAcigVm%2Fimage.png?alt=media&amp;token=661c4f9b-9829-4152-8a67-3840e7e679db" alt=""><figcaption></figcaption></figure>


# FAQ

### General

#### About Gable Liquidity Protocol

Gable is a decentralised liquidity market protocol build on Radix DLT where users can participate as borrower or supplier. The protocol will offer lending products for borrowers, and liquidity solutions for suppliers. Built on Radix DLT, the protocol offers transparency, security, and innovative solutions to traders and investors. This allows users to enjoy fast and efficient transaction processing, low fees, and transparent terms.

Currently, Gable offers flash loans as main lending feature, and liquidity collection via staking rewards as main supplying feature.

### Borrow

#### What are flash loans

Flash loans are loans that are executed within a single transaction. This is made possible by one of Radix's main features; atomic composability. Atomic composability allows multiple operations to happen within a single transaction.

This means that tokens can be borrowed, returned, and used to fund activities, all within the same transaction. Flash loans open up opportunities for activities like arbitrage and leveraging capital for profit within a single transaction.The fast and secure nature of a flash loan decreases costs and makes the need for collateral redundant.&#x20;

#### How do flash loans work?

Flash loans are a type of decentralised finance (DeFi) innovation that allows users to borrow funds without collateral, as long as the loan is repaid within the same transaction. The concept relies on smart contracts and blockchain technology, enabling instant borrowing and repayment. If the loan is not repaid by the end of the transaction, the entire transaction is reversed, ensuring the security of the lending platform.

#### What are flash loans used for?

Flash loans have multiple use cases in decentralized finance (DeFi). They are primarily used for *arbitrage* opportunities, where traders can exploit temporary price discrepancies across different platforms to make profits. Additionally, flash loans are used for *collateral* *swapping*, *debt refinancing*, and *liquidations*.&#x20;

They also facilitate capital-efficient trading strategies, yield farming, protocol optimizations, and even as a tool for developers to test and deploy smart contracts. The flexibility and instant availability of flash loans make them a versatile tool for various financial activities within the DeFi ecosystem.

#### What is the difference between a flash loan and a traditional loan?

The main difference is that traditional loans require collateral and have repayment terms, while flash loans are uncollateralized and must be repaid within a single transaction.

#### What are the risks associated with flash loans?

Flash loans carry several risks, including the risk of price manipulation, arbitrage attacks, and transaction failures. Moreover, flash loans require borrowers to repay the loan within the same transaction, which can be challenging if the market conditions change rapidly. Improper risk assessment and lack of due diligence can also lead to substantial financial losses.

#### How can I participate in flash loans on your liquidity protocol?

To participate in flash loans on Gable liquidity protocol, you need to follow a few steps. First, connect your wallet to the protocol. Then, specify the loan parameters, such as the amount involved. Execute the flash loan transaction. Finally, repay the loan amount plus any applicable fees within the same transaction to complete the process. For a detailed elaboration and user guide, please visit the [borrowers section](broken://pages/jMz2DLtVbeuLYmvfWXVS).

#### How is the interest rate determined for flash loans?

Currently, a static interest rate is set. However, over time a switch to dynamic interest rates will take place. This dynamic rate will be determined by a combination of factors. These include the availability of funds in the lending pool, the current market conditions, and the perceived risk associated with the loan. In practice the interest rate will be based on algorithms that consider these factors in real-time, ensuring efficient allocation of funds and fair pricing for borrowers.

#### What happens if I fail to repay a flash loan?

The smart contract is designed to automatically revert all the transactions, canceling the loan and any associated actions. This ensures that the lending pool remains solvent and protects the interests of other participants in the protocol. Failing to repay a flash loan may also result in a loss of reputation within the decentralized finance community. As of now no financial penalties are imposed by Gable Liquidity Protocol in case of failure to repay.

#### How can I get support or assistance if I encounter any issues with flash loans on your platform?

If you encounter any issues and need assistance with flash loans on Gable, you can reach out to the customer support helpdesk: <contact@gable.finance>. There you can request support and address concerns that you may face during the flash loan process. Additionally, you can use our social media channels to raise any questions.&#x20;

### Supply

#### How do I supply liquidity to Gable Liquidity Protocol

Gable Liquidity Protocol collects liquidity from staking rewards. A dedicated Gable validator node is in place that collects staking rewards on your (the staker's) behalf, and distributes it into the liquidity pool. Therefore, all you have to do is stake at Gable validator node to become a liquidity supplier.

#### How do I stake my tokens at your validator node?

You can stake at Gable validator node by returning to the 'supplier' page on [gable.finance,](https://docs.gable.finance/faq/www.gable.finance) connect your wallet, and use the 'provide liquidity' option.&#x20;

Alternatively, you can find Gable validator node address in the RadixDLT explorer, and perform the transaction to the validator node directly via the Radix Wallet. You can find more detail on how to do this here.

#### What is the process for withdrawing my staking rewards from the liquidity pool?

Like supplying stake, you can withdraw stake by returning to the 'supplier' page on [gable.finance](https://docs.gable.finance/faq/www.gable.finance.supplier), connect your wallet, and use the 'withdraw liquidity' option.&#x20;

Alternatively, you can find Gable validator node address in the RadixDLT explorer, and perform the withdrawal of your stake from the validator node directly via the Radix Wallet. You can find more detail on how to do this here.

#### How often are staking rewards distributed to the liquidity pool?

Staking rewards are distributed to the liquidity pool at the end of each epoch, which is a predefined period of time during which network events and consensus take place.&#x20;

#### What is the estimated interest rate or return on staked tokens?

The estimated return depends on two factors; the staking APY as offered by the Radix network, and the interest earned by the Gable Liquidity Protocol. Both are dynamic and can vary depending on various factors, including the protocol's design, the current market conditions, and the demand for staking services. For more information on the pay-out scheme on Gable visit [this section](/v1-flashloan-pool/staking-liquidity/pay-out-scheme). For a real-time overview please refer to the 'dashboard' page on [gable.finance/dashboard](https://docs.gable.finance/faq/www.gable.finance/dashboard).

#### Are there any fees associated with staking or withdrawing rewards from the liquidity pool?

Participating in the Gable liquidity protocol as a supplier involves a one-time transaction fee for staking, unstaking, and withdrawing liquid staking units (LSUs) on the Radix network. These transaction fees are generally low, making them a minor consideration. However, apart from these specific events, there are no additional fees required to engage as a supplier on the Gable liquidity protocol. We aim to provide a cost-effective and accessible platform for suppliers to contribute their assets without imposing unnecessary financial burdens.

#### What happens if there are any issues with the validator node? Will it affect my staked tokens or rewards?

If Gable validator node misses many consensus rounds the validators may begin to lose potential emissions XRD be excluded from participating in consensus for some time. As long as such problems are infrequent, validator node-runners and stakers won’t miss out on many emmissions. Penalties are calculated per epoch. With epochs occurring roughly every 5 minutes, a node-runner that brings their node back online quickly will also quickly pick back up earning rewards.

#### Can I withdraw my tokens at any time, or is there a lock-up period?

Instantly withdraw your LSU's from the Gable liquidity protocol and receive your entitled resources, including LSU's, XRD staking rewards, and XRD interest earnings, directly into your account. However, please note that unstaking from the Gable validator node is subjected to an unstaking delay period dictated by the Radix network. This delay period typically lasts 2,016 epochs, which equates to approximately 1 week. Rest assured that while there may be a delay in unstaking, your assets (staked XRD) will be securely held until the unstaking process is complete, ensuring the integrity and reliability of the Gable liquidity protocol.


