# Danogo

## Introduction

Danogo is a **Cardano-based DeFi platform** focused on **lending and borrowing**. Our journey began with the **Bond DEX**, a marketplace initially supporting **Optim Bonds**—allowing users to buy, sell, or trade these bond assets. Building on this foundation, Danogo subsequently introduced the **Danogo Staking Bond**, expanding the Bond DEX to support both Optim Bonds and Danogo Staking Bonds. These staking-focused bonds enable users to lend or borrow the **staking rights** of their ADA.

In addition to these bond-focused offerings, Danogo includes a **fixed-rate lending feature**, providing borrowers with predictable interest expenses and a straightforward borrowing experience. On top of that, Danogo’s **yield aggregator** helps users optimize returns across various Cardano protocols, simplifying complex DeFi strategies into a more seamless, user-friendly process.

## Features

* **Bond DEX**
  * **Initial Launch**: Began with support for **Optim Bonds**, serving as a dedicated marketplace for bond-like tokens on Cardano.
  * **Now Supports Danogo Staking Bonds**: Users can trade both **Optim Bonds** and **Danogo Staking Bonds**, benefiting from increased liquidity and broader investment options.
* **Danogo Staking Bond**
  * **Staking Rights Lending/Borrowing**: Users can **lend or borrow** the staking rights of their ADA.
  * **Seamless Trading**: Fully integrated with the Bond DEX, providing easy entry and exit for staking bond positions.
* **Yield Aggregator**
  * **Cross-Protocol Optimization**: Help users find the most suitable Yield products by comparing across multiple Yield Dapps on a simple interface.
  * **Ease of Use**: Simplifies yield-farming strategies into a few clicks, making advanced tactics accessible to all user levels.
* **Fixed-Rate Lending**
  * **Predictable Costs**: Offers borrowers **stable interest rates**, ideal for those who prefer certainty over floating or market-driven rates.
  * **Supply with higher Yield**: Lock your token into Danogo's fix-rate lending pool and earn yields that match or exceed non-maturity deposits on Liqwid


# Litepaper

## Abstract

Danogo is a decentralized lending and borrowing protocol providing both fixed pool lending and flexible pool lending. Danogo introduces a novel approach to DeFi implementation on Cardano with the following improvements:

1. Support multiple independent oracles concurrently (our oracle smart contract will be open sourced and available for all other Smart Contract to access oracle sources onchain from Indigo, Liqwid, DJED, Orcfax, Charli3, Minswap, Splash & other DEXes at the same time) &#x20;
2. Support DEX LP tokens as collaterals
3. Loan smart contract is inter-operable with other smart contracts, thus making loans programmable. This open door for new use cases to be built on Danogo loan to grow DeFi ecosystem on Cardano
4. Remove batching, hence enabling continuous interest compounding while Liqwid interest are only accrued at fixed intervals during batching.
5. Introduces novel parallel-threaded liquidation mechanism to enhance resilience during extreme market conditions. In 2023, Indigo faced a two-hour liquidation queue because liquidations had to be executed sequentially (<https://messari.io/report/cardano-ecosystem-analysis-q2-2023>). This will protect supply pools from default risks during extreme market conditions.
6. Cross deposit idle fund to optimized yield for Suppliers; Danogo pools put all idle funds on Liqwid and keep qToken instead, this way Danogo suppliers will always earn yield, even when waiting for borrowers.
7. Danogo smart contracts are written in Aiken and will be open-sourced once thoroughly audited. This will enable other developers to build independent off-chain front-ends with further use cases to ensure decentralization of the protocol.&#x20;

Danogo aims to serve as a composable, scalable, and secure financial primitive for the Cardano DeFi ecosystem.

<br>


# Danogo Fixed Pool Lending

## Introduction

The DeFi space is experiencing exponential growth but continues facing significant challenges such as market volatility and not enough reliable investment options. Fixed Rate Lending steps in to solve these issues by providing a stable and predictable financial tool for people to invest and borrow in an otherwise fluctuating ecosystem. This paper explores the compelling need for Fixed Rate Lending, how it works, and why it’s a perfect fit for Cardano blockchain to deliver sustainable financial solutions.

Fixed Rate Lending caters to:

* **Investors** who seek stable and predictable income.
* **Borrowers** who aim to secure funding without the uncertainty of fluctuating interest rates.

## Market Environment & Problem

In decentralized finance (DeFi), market fluctuations significantly impact borrowing and lending rates. High volatility often leads to unpredictable floating interest rates, making it difficult for borrowers to plan their capital costs. The increasing demand for stablecoins further amplifies these fluctuations, as traders and investors seek liquidity for various DeFi strategies, including leveraged trading, liquidity provision, and yield farming.

### Lack of Fixed-Income Investment Options

Currently, most DeFi lending platforms, including those on Cardano, operate with float interest rates, leaving lenders exposed to unpredictable returns. Unlike traditional finance, where fixed-income instruments such as bonds and loans with fixed term provide stable yields, DeFi lacks a robust fixed-rate lending and secondary debt market. This absence limits the ability of risk-averse investors to participate in DeFi and discourages long-term capital commitment.

### Interest Rate Volatility and Its Market Limitations

Borrowing demand in DeFi remains consistently high, with stablecoins serving as a primary example due to their price stability and versatility in leveraged trading, liquidity provisioning, and arbitrage strategies. Many DeFi lending platforms operate with floating interest rates, where borrowing costs fluctuate based on market conditions. As a result, borrowers face unpredictable financing costs, especially during periods of high utilization, which may impact their borrowing decisions and make long-term planning more difficult.

A review of Liqwid Finance’s lending markets illustrates how stablecoin borrowing demand leads to high utilization rates, often exceeding 80%, which in turn drives up borrowing costs as floating interest rates adjust dynamically.

<table data-header-hidden><thead><tr><th></th><th width="119.47265625"></th><th width="105.66015625"></th><th></th><th></th><th></th></tr></thead><tbody><tr><td>Stablecoin</td><td>Total Supply</td><td>Total Borrowed</td><td>Utilization Rate</td><td>Supply APY</td><td>Borrow APY</td></tr><tr><td>DJED</td><td>5.8M</td><td>5.16M</td><td>88.96%</td><td>25.14%</td><td>35.32%</td></tr><tr><td>iUSD</td><td>1.82M</td><td>1.57M</td><td>85.98%</td><td>23.51%</td><td>34.17%</td></tr><tr><td>USDM</td><td>2.02M</td><td>1.71M</td><td>84.69%</td><td>22.82%</td><td>33.68%</td></tr><tr><td>USDC</td><td>4.49M</td><td>3.52M</td><td>78.25%</td><td>19.56%</td><td>31.25%</td></tr><tr><td>USDT</td><td>1.26M</td><td>928.95K</td><td>73.14%</td><td>17.17%</td><td>29.35%</td></tr></tbody></table>

*Table 1: Stablecoin Lending and Borrowing Market Information on Liqwid (on 2025-01-22)*

#### **Interest Rate Volatility in DeFi Lending Markets**

DeFi lending platforms typically determine interest rates based on token demand, liquidity availability, and market activity:

* Periods of high borrowing demand lead to higher interest rates, increasing costs for borrowers.
* Liquidity shortages drive interest rate surges, particularly when lending pools approach full utilization.
* Market volatility can create unpredictable interest rate fluctuations, making it difficult for borrowers to manage long-term financing strategies.

The following yield curve chart illustrates how borrowing rates fluctuate over time in response to utilization changes and market demand:

<figure><img src="/files/jdJ9Dl8uJmAC5WQCfpg9" alt=""><figcaption><p><em>Image 1: Yield curve of DJED per epoch</em></p></figcaption></figure>

This reinforces the need for Fixed-Rate Borrowing, allowing users to secure stable borrowing costs and avoid unpredictable interest rate spikes. Additionally, a Fixed-Income Investment model can provide lenders with more stable returns, encouraging long-term capital commitment and improving overall market efficiency.

## Solution

Danogo introduces a Fixed Rate Lending platform that enables borrowers to secure loans at predetermined, unchanging interest rates, and investors to earn stable returns on their capital. Unlike floating-rate lending, where rates fluctuate based on market conditions, fixed-rate lending ensures consistency for both parties, fostering financial planning and reducing risk.

This platform offers:

* **More Stable Returns for Investors:**&#x20;
  * Suppliers can create deposit pools with a fixed maturity date that will be used to provide fixed-rate lending.
  * The platform aims to ensure that the yield for suppliers equals or exceeds the interest rate of non-maturity deposits on Liqwid (<https://liqwid.finance/>).
  * Each deposit pool is tokenized into principal tokens (pTokens) and yield tokens (yToken). Those tokens can be redeemed at maturity.&#x20;
  * Opportunities for different Investor Profiles:
    * Market Makers: Professional traders who create pools and provide liquidity for interest rate swaps by market-making with pTokens & yTokens, creating a secondary market for fixed-income trading.
    * Stable Yield Investors: Those looking to lock in capital for a fixed, stable yield can invest and hold pTokens until maturity.
    * High-Risk Investors: Risk-tolerant traders can engage in leveraged trading of yTokens, speculating on future interest rate movements to maximize returns. This trading mechanism operates similarly to the Interest Rate Swap (IRS) Market in Traditional Finance (TradFi), where participants trade fixed and floating rates based on their market outlook.
* **Stable Borrowing Costs for Borrowers:**&#x20;
  * Borrowers can secure fixed interest rates and fixed loan terms, shielding them from market volatility and unpredictable floating rates.

### How It Works:

Danogo’s Fixed-Rate Lending and Interest Rate Swap (IRS) Market provide a structured, efficient system for lenders, borrowers, traders, and liquidity providers to interact. Participants can earn returns, hedge risks, or optimize capital through interest rate trading and fixed-term lending pools.

The four main roles in the system are:

* Market Makers – Provide liquidity, create lending pools, and facilitate price discovery in the secondary market.
* Borrowers – Secure fixed-rate loans with collateral and predictable repayment terms.
* Leveraged Traders – Trade yield tokens to speculate on interest rate movements.
* Fixed-Deposit (FD) Investors – Lock in capital for stable returns.

#### 1. Market Makers

**Role Overview**

Market Makers supply liquidity by depositing assets to create Fixed-Rate Lending Pools. Market Makers will receive Principal Tokens (pToken) & Yield Tokens (yToken) for creating the pool, which can be traded on Danogo DeX, facilitating price discovery and liquidity for pToken and yToken on the secondary market.

**How Fixed Rate Lending Pools work**

Fixed Rate Lending Pools can be configured with key parameters as follow:

* Maturity date: The fixed term for the pool, when pToken & yToken can be redeemed.
* Accepted collaterals: The assets borrowers can use as security.
* Threshold: The maximum percentage of the collateral’s value the user can borrow\..
* Fixed rate settings: The configuration defines how the fixed interest rate is calculated, including factors like maximum loan duration, interest rate gradient, and base interest rate.

Fixed Rate Lending Pools earn returns from two sources:

1. Floating interest rates generated by the liquidity supplied to Liqwid Finance. When fund is idle, not on lent out to fixed term loans, they are deposited into Liqwid to earn yield,
2. Interest paid on Fixed-Term Loans, which borrowers repay at predetermined rates.

Since the lending pool dynamically allocates liquidity between Liqwid Finance and Fixed-Term Loans, it ensures that the minimum yield for lenders will always be equal to or higher than Liqwid’s yield.&#x20;

**Tokenized Yield Instruments**

Upon depositing, lenders receive two types of tokens representing their investment:

* pToken (Principal Token): Represents the deposited principal and can be redeemed at maturity for the principal amount.
* yToken (Yield Token): Represents the interest earnings generated over time and can be redeemed at maturity for the full yield.

Both tokens can be traded on the secondary markets to unlock liquidity or hedge risk before maturity.

**Market Making Role**

* Provide liquidity to the secondary market for pTokens and yTokens.
* Facilitate price discovery for interest rate swaps.
* Earn fees and arbitrage profits from trading spreads between fixed and floating rates.

By combining lending with market-making, users maximize capital efficiency while enabling a liquid and fair interest rate swap market.

#### 2. Borrowers

**Role Overview**

Borrowers can access fixed-rate loans by selecting from pre-set loan options, each offering:

* Fixed loan terms (7 days, 30 days, 60 days, 90 days)
* Fixed interest rates
* Collateralized borrowing

**Loan Creation Process**

1. Borrowers specify the debt amount and health factor they wish to maintain.
2. The system automatically calculates the required collateral amount based on the selected loan parameters.
3. Borrowers deposit collateral and receive loan funds directly from the pool.

**Collateral Management and Loan Adjustments**

* Borrowers can modify their collateral at any time to enhance the health factor of their loan, reducing liquidation risk.
* ADA collateral continues to earn staking rewards and retains voting power for borrowers.

**Loan Repayment**

* At maturity, borrowers must repay the full debt amount, which includes:
  * The principal amount borrowed
  * The fixed interest accrued over the loan term
* Once repayment is completed, borrowers receive their collateral back in full.

**Liquidity Management**

* Loans are funded directly from the pool.
* If liquidity is currently supplied to Liqwid, the pool will withdraw from Liqwid and fund the loan, ensuring optimal liquidity allocation.

This structure allows borrowers to access predictable borrowing costs while maintaining capital efficiency, making fixed-rate lending a sustainable alternative to floating-rate borrowing.

#### 3. Leveraged Traders (Speculating on Interest Rates)

**Role Overview**

Traders can speculate on interest rate fluctuations by trading yTokens in the Interest Rate Swap Market.

**How Traders Benefit from yT Tokens**

* Long yToken (Bullish on Rates): If borrowing demand rises, yToken prices increase, leading to potential profits.
* Short yToken (Bearish on Rates): If borrowing demand drops, yToken prices decrease, allowing traders to short-sell yToken.

This trading mechanism allows for interest rate speculation, yield hedging, and high-risk, high-reward opportunities in DeFi.

#### 4. Fixed-Deposit (FD) Investors (Seeking Stable Returns)

**Role Overview**

Fixed-Deposit (FD) investors are risk-averse participants who prefer stable, predictable yields over speculation.

**How FD Investors Earn Returns**

* FD investors buy pTokens on the Danogo Bond DeX, which they hold until maturity for guaranteed fixed returns.
* Unlike leveraged traders, FD investors avoid market volatility and focus on long-term capital preservation.

This role provides an opportunity for users looking to lock in stable returns without exposure to interest rate fluctuations.

#### Redemption Process

At maturity, holders can redeem their pToken (Principal Token) and yToken (Yield Token) to claim their funds. The redemption process works as follows:

1. Redemption at Maturity:
   * pToken holders redeem their Principal Token for the original deposited amount.
   * yToken holders redeem their Yield Token to receive the interest earned over the loan period.
2. Funds Settlement:
   * The system automatically settles redemptions from available liquidity in the pool.
   * If liquidity was supplied to Liqwid, funds will be withdrawn from Liqwid to fulfill redemptions efficiently.

#### Liquidation Process

Liquidation occurs when a borrower fails to meet repayment obligations or when the value of their collateral falls below a critical threshold, making the loan undercollateralized. Danogo’s liquidation mechanism ensures risk management and capital protection for lenders.

**Liquidation Triggers**

There are two conditions that can trigger liquidation:

1. Failure to Repay the Loan BEFORE Maturity:
   * If a borrower does not repay the full debt amount (principal + fixed interest) by the due date, the system automatically initiates liquidation to recover lender funds.
2. Health Factor Falls Below 1 (Undercollateralization):
   * The health factor measures the collateral's strength relative to the borrowed amount.
   * If the collateral value drops due to market fluctuations, causing the health factor to fall below 1, liquidation is triggered to prevent further losses.

**Process**&#x20;

1. Collateral Seizure
   * When liquidation is triggered, the borrower’s collateral is fully liquidated to recover the outstanding debt.
   * The collateral is transferred to liquidators, who repay the loan in exchange for discounted collateral.
   * This process ensures that debt repayment is handled efficiently, preventing bad debt from accumulating in the lending pool.
2. Debt Settlement
   * The proceeds from liquidation are used to repay the full outstanding debt, which includes:
     * The principal amount borrowed
     * The full fixed interest&#x20;
   * Funds are returned to the lending pool, ensuring that liquidity providers receive their expected repayments.
3. Lender Protection
   * Liquidation ensures that lenders receive their principal and interest as expected.
   * Since loans are backed by collateral, the risk of loss is minimized for liquidity providers

### Oracle and Price Feed System

Oracles play a crucial role in Danogo’s platform that ensures accurate price data for assets and for determining fair interest rate swaps.

#### How Danogo Uses Oracles

1. **Collateral Valuation & Health Factor Calculation**

* Danogo uses Oracles to fetch current market prices for collateral assets and borrowing assets to determine the health factor of a loan.
* This ensures borrowers always meet collateralization requirements, reducing undercollateralization risks.

2. **Liquidation Triggers**

* Oracles are used to check if an asset’s price falls below a certain threshold, the system automatically checks the health factor and initiates liquidation when necessary.
* This prevents bad debt accumulation while ensuring a fair liquidation process for borrowers and lenders.

3. **Interest Rate Determination**

* Danogo Fixed Lending Pools uses On-chain Yield Data of Liqwid Finance to calculate market-based fixed rates for loans.
* This data is also used to determine the values of funds supplied to Liqwid that ensures accurate interest calculation for Fixed Rate Lending Pools and the pricing of yTokens.

#### Oracle Integration

Danogo currently integrates with Orfax and Liqwid for price accuracy, reliability, and decentralized data sourcing. Additionally, support for Djed, Indigo Protocol, and Charli3 will be implemented based on the required price feeds for specific token pairs, ensuring comprehensive oracle coverage while minimizing the risk of single-source failure.&#x20;

<br>

### Risk Management

Danogo has implemented multiple layers of risk mitigation strategies to ensure the security and stability of the platform. Below are key risks and the measures taken to mitigate them.

#### 1. Danogo Smart Contract Hack Risk

* **Risk**
  * As a DeFi protocol, Danogo relies on Smart Contracts to facilitate all operations
  * Vulnerabilities in Smart Contracts could lead to exploits, fund losses, or unexpected protocol failures.
* **Mitigation**
  * Danogo’s smart contracts are audited by reputable firms to identify and mitigate vulnerabilities.
  * All smart contracts are open-source that allows the community to verify their security.

#### 2. Liqwid Smart Contract Hack Risk

* **Risk**
  * Danogo integrates with Liqwid Finance to generate yield for idled funds.
  * If Liqwid’s smart contracts are compromised, it may impact funds supplied to Liqwid pools.
* **Mitigation**
  * Danogo allocates liquidity dynamically, meaning funds are not fully dependent on Liqwid.
  * If a security breach occurs, funds supplied to Liqwid can be withdrawn to fixed-rate pools, minimizing exposure.

#### 3. Liqwid Pool Fund Dry-Up Risk

* **Risk**
  * Liquidity shortages in Liqwid pools could delay loan funding or redemptions.
* **Mitigation**
  * By default, when the funds are idle and not lent out to fixed term loans, they are deposited into Liqwid to generate yield.&#x20;
  * If Liqwid pools dry up, Danogo will stop supplying additional funds to Liqwid and prioritize capital allocation to fixed-rate pools. Moreover, Liqwid’s and all float pool’s mechanisms naturally adjust borrowing rates based on utilization rate. When the pool experiences a liquidity shortage, borrowing rates increase sharply, making it more expensive for borrowers to maintain their loans. This incentivizes borrowers to repay their loans to avoid high borrowing costs, which gradually restores available liquidity.

#### 4. Oracles Manipulation Attack Risk

* **Risk**
  * Danogo relies on Oracles to fetch price data
  * If an attacker manipulates oracle prices, they could exploit the system by undercollateralizing loans or triggering false liquidations
* **Mitigation**
  * Danogo integrates multiple Oracle’s sources to prevent single-point failures or price manipulation.
  * If a single oracle’s price deviates by more than 5% from the average price of all sources, all loan’s operations related to the price will be suspended to protect the user's fund.

#### 5. Collateral Default Risk (Value Falls Below Loan Amount)

* **Risk**
  * If market volatility causes collateral prices to drop significantly, loans may become undercollateralized, leading to:
    * Liquidation inefficiencies, where collateral is insufficient to cover the loan.
    * Lender losses, if liquidations fail to recover the full borrowed amount.
* **Mitigation**
  * Over-Collateralization:&#x20;
    * Loans are always over-collateralized, ensuring that loans are backed by assets exceeding the borrowed amount.
    * This acts as a buffer against market volatility that reduces the risk of undercollateralized defaults.
  * Liquidation Safeguards&#x20;
    * Automated liquidation process ensures that undercollateralized loans are quickly settled to protect lenders.
    * Liquidators are incentivized to repay defaulted loans in exchange for discounted collateral, keeping markets efficient.

### Disclaimer & Risk Disclosure

This litepaper is for informational purposes only and does not constitute financial, legal, or investment advice. Participation in Danogo’s Fixed-Rate Lending platform involves risks, including but not limited to market volatility, regulatory uncertainties, and potential smart contract vulnerabilities

Danogo does not guarantee fixed returns or risk-free investments, as all transactions are subject to market conditions, borrower defaults, and liquidity risks. Users should conduct their own due diligence and consult with qualified financial or legal advisors before engaging with the platform.

By participating in Danogo’s ecosystem, users acknowledge and accept the inherent risks of decentralized finance (DeFi) and blockchain technology. Danogo shall not be held liable for any losses, damages, or disruptions resulting from the use of the platform or its associated services.

<br>


# Danogo Flexible Pool Lending

## 1. Introduction

Decentralized finance (DeFi) has revolutionized access to financial services, offering open, permissionless protocols for lending, borrowing, and trading. Protocols like Compound Finance on Ethereum  (<https://compound.finance/documents/Compound.Whitepaper.pdf>) have demonstrated the effectiveness of decentralized money markets. As the DeFi ecosystem expands to Cardano, Danogo is designed to meet the unique demands of this ecosystem while incorporating proven innovations and novel improvements.

Cardano's eUTXO model, native token support, and low transaction fees create a fertile ground for advanced financial primitives. However, the current DeFi landscape on Cardano remains underdeveloped compred to its EVM counterparts. Danogo addresses this gap by providing a robust lending infrastructure with advanced features.<br>

## 2. Protocol Architecture & Implementation

Danogo mirrors the fundamental architecture of Compound Finance: users supply assets to earn interest and borrow against their supplied collateral. Below are Danogo specific adaption for eUTXO model on Cardano

### **2.1 Multi-Oracle Support**

Danogo integrates multiple independent oracles (e.g., Liqwid, Indigo, Orcfax, and DEXes) for enhanced price reliability and manipulation resistance. The protocol aggregates these sources to derive a consensus price, mitigating the risk of relying on a single oracle.

### **2.2 Programmable Loans**

Danogo introduces a novel concept: programmable loans. Smart contracts or other dApps can programmatically initiate, manage, or close loans via on-chain interactions. This enables advanced DeFi use cases such as flash loans, leveraged trading, or automated strategies.

### **2.3 Continuous Compounding**

While protocols like Liqwid compound interest at discrete intervals via batching, Danogo supports continuous compounding of interest. This ensures real-time accrual of yield for suppliers and debtors, resulting in a more precise and fair financial experience.

### **2.4 Parallel Liquidation Threads**

Market crashes often result in a backlog of liquidations, jeopardizing the solvency of the protocol. Danogo introduces parallel-threaded liquidation logic, allowing multiple liquidation processes to execute simultaneously. This preserves pool integrity and ensures rapid response to volatility.

### **2.5 Automatic Staking Rewards Distribution**

ADA staking rewards are automatically compounded and distributed to ADA Pool immediately at the end of epoch, increasing dToken value at the same time. This feature protects the ADA pool from suppliers who withdraw before epoch end and re-supply at the beginning of the next epoch to gain double staking rewards. &#x20;

### **2.6 Support Decentralized Governance**

For borrowers using ADA as collateral, they will still receive ADA staking rewards and retain their voting rights to delegate to any dReps of your choice.

### 2.7 Composability

To maximize capital efficiency, Danogo enables idle funds in the lending pool to be composably supplied to other yield-generating protocols such as Liqwid. This inter-protocol integration allows Danogo to passively earn additional yield on unused liquidity without compromising core lending operations. These external supplies can be withdrawn to meet Danogo’s internal borrowing demands. In the event of liquidity shortages or dry-ups in external protocols, Danogo can eliminate new allocations to these protocols. This dynamic allocation enhances protocol sustainability while maintaining user access to funds when needed.<br>

## 3. How it works

Danogo creates flexible lending pools where users can supply assets to earn interest or borrow against their collaterals. Interest rates are dynamically determined by market supply and demand that allows for real-time adjustments. With Danogo’s flexible pool model, users interact directly with the protocol rather than negotiating terms such as interest rate, maturity or collateral directly with another party.

### 3.1 Supplying Assets

Unlike peer-to-peer platforms that directly match lenders and borrowers, Danogo aggregates liquidity into shared pools. When users supply assets, they contribute to a fungible liquidity pool rather than funding individual loans. This model significantly improves capital efficiency and ensures high liquidity allowing users to withdraw their funds at any time, as long as there is sufficient liquidity in the pool.

Supplied assets are represented by dTokens, which entitle the holder to a proportional share of the pool. As interest accrues based on borrowing activities, the value of dTokens increases relative to the underlying asset. This means users earn yield simply by holding dTokens, making passive income seamless and fully on-chain.

### 3.2 Borrowing Assets

Danogo allows users to borrow assets directly from the protocol by using their supplied collaterals without peer-to-peer matching. Unlike Danogo Fixed Pool Lending, users simply choose the asset they wish to borrow, and there are no negotiating terms, maturity dates, or funding periods. Each flexible lending market operates with a floating interest rate that adjusts algorithmically based on real-time supply and demand, ensuring fair and transparent borrowing costs.

#### 3.2.1 Collateral values

Unlike systems where a single collateral factor applies globally, Danogo defines collateral factors per collateral asset against each borrowing pool. This means the borrowing power of a collateral asset may vary depending on which asset the user wants to borrow. For example, Djed used as collateral might have a higher borrowing factor against stablecoins, but a lower one against ADA. The borrowing capacity is determined by summing the value of each collateral asset, multiplied by their collateral factor. Users can borrow up to—but not beyond—their total calculated borrowing capacity, and Danogo enforces that there is no borrowing, or withdrawing of collaterals is permitted if it would raise the total value of borrowed assets above their borrowing capacity. This mechanism ensures system-wide solvency and protects against default risk.

### 3.3 Interest Rate Mechanic

<figure><img src="/files/4hM4IGsLsA9MWNL1dt9R" alt=""><figcaption><p>Borrow APY formular</p></figcaption></figure>

<figure><img src="/files/YuVVblffWzRHj3ga5Yc7" alt=""><figcaption><p>Borrow APY vs Utilization Rate</p></figcaption></figure>

<table data-header-hidden><thead><tr><th width="154.4375"></th><th></th></tr></thead><tbody><tr><td>base_rate</td><td>The annual base interest rate that the borrower is required to pay. Stored in bps, e.g., a base rate of 4% is stored as 400 bps</td></tr><tr><td>power_base</td><td>power_base is an adjustment factor that determines how the borrow interest rate increases as the utilization rate rises. power_base is stored as basis points. E.g., power_base = 1.047 is stored as 10,470 bps</td></tr><tr><td>util_rate</td><td>Utilization ratio is total borrow over total supply</td></tr><tr><td>basis</td><td><p>Basis point (bps) is used to store interest rates as integers on-chain, ensuring accuracy up to two decimal places.</p><p>1 = 100% = 10,000 bps</p><p>0.04 = 4% = 400 bps</p><p>0.1025 = 10.25% = 1,025 bps</p></td></tr></tbody></table>

<br>

**References**

\[1] Compound’s Whitepaper: <https://compound.finance/documents/Compound.Whitepaper.pdf>

<br>


# Danogo Leverage Trading

## 1. Introduction

While DeFi continues to evolve rapidly, it still lacks native, reliable options for traders to amplify gains or hedge risks with confidence. Danogo Leverage addresses this gap by offering a powerful, decentralized leverage trading product built entirely on Cardano. It enables users to open long or short positions with borrowed capital, directly from flexible lending pools, and swapped on dex  in a single transaction—while maintaining full transparency and protocol-enforced liquidation logic.

This litepaper presents the core motivations behind Danogo Leverage Trading, how it works within the Cardano ecosystem, and why it’s a critical piece in unlocking more advanced financial strategies for DeFi users.

Danogo Leverage is built for:

* Traders who want to amplify profits using leverage and directional strategies.
* Hedgers who aim to protect their portfolio from downside risks.
* Builders who want to integrate leveraged positions into DeFi applications.

## 2. Danogo’s Solution

Danogo introduces a native Leverage Trading platform on Cardano that empowers users to open long or short positions directly on-chain using borrowed capital—executed in a single, seamless transaction. The protocol combines the capital efficiency of floating-rate lending with the composability and programmability of the eUTXO model to unlock advanced trading strategies, all while preserving transparency and decentralization.

This leverage platform offers:

**2.1. Capital-Efficient Trading for Every User Profile**

* Speculative Traders: Open leveraged long or short positions using ADA or supported tokens as collateral, with real-time P\&L tracking and liquidation price visibility.
* Hedgers: Manage downside risk by opening short positions against volatile holdings to preserve capital during market downturns.
* DeFi Builders: Programmatically integrate leverage into other protocols (e.g., yield aggregators, structured products) via on-chain interactions for automated or composable strategies.

**2.2. Flexibility in Trading & Collateral Options**

* Flexible Trading Pairs: Danogo Leverage will support a wide range of trading pairs (e.g., ADA/USDM, BTC/USDM, ETH/USDM,...), offering diverse market opportunities and greater flexibility for all user profiles—whether trading, hedging, or building.
* Multi-Collateral Support: Users can deposit a variety of assets—including stablecoins like DJED, USDM, … as collateral for position. This gives users greater flexibility and capital efficiency in managing leveraged positions, especially during volatile market conditions.

**2.3. Seamless Single-Transaction Leverage Execution**

Users can initiate borrowing, swap, and position creation in one transaction. This reduces complexity and cost compared to traditional DeFi margin protocols that require multiple steps or off-chain coordination.

**2.4. Real-Time Collateral and Liquidation Management**

Inspired by Danogo Flexible Pool Lending architecture, the leverage protocol supports:

* Continuous monitoring of loan health via oracle-based pricing.
* Parallel-threaded liquidation logic, allowing for rapid response in market downturns.
* Liquidator and Collector incentives, ensuring market-driven enforcement of risk controls.

**2.5. Composable with Other Protocols**

Just like Flexible Pool Lending, Danogo Leverage is designed with DeFi composability in mind:

* Collateral or idle liquidity can be routed to external yield-generating protocols like Liqwid.
* Yield-bearing collateral can be used in leveraged positions, maximizing capital utilization.

**2.6. Programmable Positions and Automation**

Danogo supports programmable leverage positions, enabling smart contracts to automatically open, monitor, and close trades. This feature enables:

* Auto-leverage strategies.
* One-click portfolio rebalancing.
* Event-triggered hedging (e.g., based on asset price or time).

**2.7. Built for Cardano’s eUTXO Model**

Unlike traditional account-based models, Danogo Leverage is purpose-built for Cardano:

* Every position is stored as a UTXO with its own data and execution path.
* Leverage positions are stateless and fully auditable, with deterministic outcomes and no hidden backend logic.

Danogo Leverage brings to Cardano what has long been missing in DeFi: a decentralized, transparent, and composable leverage trading solution—empowering traders and protocols alike with tools for amplified returns, risk management, and programmable strategies.

## 3. How It Works

Danogo Leverage introduces a fully on-chain margin trading mechanism built for Cardano, allowing users to open leveraged long or short positions in a single transaction. Unlike traditional DeFi lending or fixed-term loan models, the Leverage product dynamically combines borrowing, swapping, and risk management.

The protocol is designed to offer capital-efficient, composable, and programmable trading workflows while leveraging oracle-based pricing and automated liquidation mechanisms.

**3.1. Opening a Leverage Position**

Users open  a leverage trade by selecting a trading pair, choosing a leverage level, and depositing initial collaterals. The protocol automatically borrows the remaining required funds from a lending pool, executes the swap via a supported DEX, and locks the resulting assets into a position UTXO as collateral.

Depending on whether the position is long or short, the position will receive either the quote token or the base token as output. All of these steps—borrowing, swapping, and locking—occur atomically in a single transaction, minimizing friction, slippage, and gas costs..

**3.2. Position Management**

Once opened, each leverage position is recorded fully on-chain and represented as a UTXO, ensuring transparency and traceability. Positions owner can monitor key metrics in real time, including:

* Profit and Loss (P\&L)
* Leverage Ratio
* Liquidation Price
* Health Factor

The protocol allows position owners to actively manage their positions by:

* Increasing or reducing collateral to adjust leverage and improve position safety.
* Closing the position at any time to lock in profits or minimize losses.

Each position includes a health factor that determines whether it's eligible for liquidation. If the market moves against the user and the position health drops below a critical level, it becomes open for liquidation.

**3.3. Liquidation Process**

When a position’s health factor falls below 1 due to adverse price movements, it signals that the position is no longer safely collateralized and becomes eligible for liquidation.

At this point, liquidators—any user on cardano—can:

* Swap the position’s collateral on a DEX (e.g., Minswap, Splash) to obtain the borrowed asset.
* Use the swapped amount to fully repay the debt, thereby closing the position and restoring pool balance.
* Receive a liquidation reward for performing this service.

This entire process is executed atomically in a single transaction, ensuring efficiency, preventing partial liquidation states, and minimizing market risk.

Danogo’s liquidation engine is fully decentralized and runs on-chain, with all logic enforced via smart contracts and UTXO validation.&#x20;

**3.4. Composability and Automation**

All leverage positions are programmable. Smart contracts and dApps can trigger leverage trades, monitor their health, or liquidate them on-chain. This enables advanced DeFi use cases such as automated trading strategies, vault management, and structured leverage products.

**3.5. Capital Efficiency**

Idle liquidity in leverage pools can be supplied to external protocols such as Danogo Flexible Pool to earn additional yield when not being used for active leverage trades. This dynamic allocation boosts returns for pool suppliers while preserving liquidity for borrowing demands.

## 4. Disclaimer & Risk Disclosure

This litepaper is for informational purposes only and does not constitute financial, legal, or investment advice. Participation in Danogo’s Leverage Trading platform involves significant risks, including but not limited to market volatility, price manipulation, liquidation risk, and potential smart contract vulnerabilities.

Danogo does not guarantee profits or protection from losses. Leveraged trading amplifies both gains and losses, and positions may be liquidated if market conditions move unfavorably. All users are responsible for monitoring their positions, understanding the risks of leverage, and ensuring sufficient collateral.

Users should conduct their own due diligence and consult with qualified financial or legal advisors before interacting with the protocol.

By participating in Danogo’s leverage ecosystem, users acknowledge and accept the inherent risks of decentralized finance (DeFi), including technical failures, oracle inaccuracies, and liquidity constraints. Danogo shall not be held liable for any financial losses, damages, or disruptions resulting from the use of the platform or its associated services.

<br>


# Audit Report

### Danogo Fixed Pool Lending Audit Report

{% file src="/files/RE9WopOHBrn9P59DzOZ2" %}

### Danogo Flexible Pool Lending Audit Report

Version 1.1.0: Support Leverage Trading

{% file src="/files/OGRgaVAtslSZfpGdoTy2" %}

Version 1.0.0: Flexible Pool Lending&#x20;

{% file src="/files/hNDE3Ny5kFYTZcxhEFFu" %}

### Oracle Aggregator

{% file src="/files/oolACHXPFZz5bx9tPBoM" %}

### Concentrated Liquidity Pool

{% file src="/files/nxXw8d5AcZyZlK4v41y1" %}


# Follow Us

### ![](/files/D8ynHRjsG0lzh8UUvV9s) [Website](https://danogo.io)

### ![](/files/SqqidoXDnwFqwITQuLWs) [Twitter](https://x.com/danogo_2023)&#x20;

### ![](/files/Jj1oYdkyaOoluuHn6igu) [Discord](https://discord.com/invite/tb9K8sjmuq)

### ![](/files/rS4ZlTJqDDXCBpfPfWQT) [Telegram](https://t.me/danogo_io)


# Blogs


# Cardano Smart Contract Composability Challenges

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

#### Cardano Smart Contract Composability Challenges

Composability in the context of decentralized applications (dApps) refers to the ability of different dApps to interact and build upon one another, facilitating the creation of complex, interconnected systems. This feature is central to the success of decentralized ecosystems, enabling innovation and the development of highly integrated solutions.

1. #### Composability in Ethereum: A Model of High Interoperability

Ethereum’s EVM (Ethereum Virtual Machine) boasts high composability, allowing developers to reuse code and functionality from existing dApps to create new ones. This fosters a collaborative and interconnected ecosystem. Here’s how it works:

1. Smart Contract Interaction: Any smart contract on an EVM-compatible blockchain can call any other contract, enabling dApps to share data and functionality effortlessly.
2. Token Interoperability: Tokens and other blockchain assets can move freely between different dApps, facilitating seamless interactions and value transfers.
3. Building Blocks: dApps can be constructed from smaller, reusable components, promoting modularity and efficiency.<br>

**Benefits of Composability:**

* Innovation: Composability enables rapid development by allowing developers to build on existing solutions, driving innovation.
* Interoperability: It fosters interoperability between dApps and blockchains, creating a more unified Web3 landscape.
* Efficiency: Developers can save time and resources by reusing existing code and functionality, avoiding the need to reinvent the wheel.<br>

**Examples:**

* DeFi protocols leverage composability to create complex financial products and services.
* dApps can integrate with each other to offer users a more comprehensive and seamless experience.
* Open-source code from one project can be reused to develop new dApps, and token interoperability allows for cross-platform interaction.

#### Composability in Cardano: Challenges and Limitations

Despite the growing number of decentralized applications on Cardano, composability remains a significant challenge. This is not an inherent flaw of the Cardano platform but a consequence of its dapps technical design.

Cardano uses the eUTxO (Extended Unspent Transaction Output) model, which, while enhancing security and scalability, presents challenges for dApp interoperability. Unlike Ethereum’s account-based model, where smart contracts can easily interact with one another, Cardano’s EUTxO model tightly couples transaction outputs with specific contracts. This design creates a more complex environment for integrating various dApps.

Furthermore, there are currently limited cross-protocol interoperability standards, such as oracles, that facilitate seamless interactions between Cardano-based dApps. Different projects, like Indigo, Liqwid, and Djed, use their own proprietary oracles with varying standards, while others, such as Orcfax and Charli3, employ their own systems as well. When supporting multiple Oracles, Danogo smart contracts&#x20;

**The Challenge of Batchers in Transaction Processing**

When batchers are used to bundle multiple transactions together, they can introduce problems. Each transaction in a batch might depend on others for inputs or outputs, and if one transaction fails, the entire batch fails. This compromises the atomicity that is essential for composability, as dApps may expect operations (such as lending and borrowing in DeFi) to be executed together or not at all.

For example, in a swap transaction that uses a batcher, the transaction is not completed until two batch transactions are finalized. This adds complexity, making it significantly harder for one smart contract to interact with another.

**Issues with Payment Key-Based Identification**

Another key challenge is the use of payment keys to identify users. Since smart contracts typically rely on a user’s payment key to interact with the contract, this can make it difficult for multiple smart contracts to communicate on behalf of the user.

If one smart contract uses the payment key to identify a user, it may not be able to access or "see" the payment key used by another contract. Cardano smart contracts are generally isolated from each other, and unless they are explicitly designed to interact using common references (such as shared data or tokens), they cannot communicate effectively.

For example, if Liqwid (a lending platform) and Indigo (a synthetic asset platform) both use payment keys for user identification, neither contract can automatically call or interact with the other on behalf of the same user unless the user explicitly authorizes each transaction. This creates friction in composing actions across multiple dApps.

When the payment key is the sole method of user identification, it establishes a direct relationship between the user and the contract, limiting flexibility. Other smart contracts cannot act on behalf of the user unless the user provides explicit consent for each transaction (via a signature). This lack of abstraction between user identity and smart contract logic further hinders composability, especially in DeFi applications, where users expect seamless interactions between lending, borrowing, staking, and other protocols.

***

#### How Danogo Addresses Cardano's Composability Challenges

Danogo aims to solve several composability issues within Cardano’s ecosystem by implementing a set of innovative strategies:

1. Open-Source Smart Contracts: Danogo provides fully open-source smart contracts, complete with detailed documentation and guides on Datum. This makes it easier for other smart contracts to interact with Danogo’s ecosystem, fostering interoperability across Cardano-based dApps. If Dapps choose not to opensource, they should at least publish documentation on datum design & documentations.
2. Standardized Oracles: Danogo will publish the oracle standards used by Djed, Indigo, Liqwid, as well as Orcfax and Charli3. By pushing for the standardization of oracles across the Cardano ecosystem, Danogo aims to simplify the interaction between dApps and ensure smooth, permissionless communication across Cardano ecosystem.
3. Avoiding Batchers: Danogo’s smart contracts avoid the use of batchers, which can cause UTxO contention. Instead, Danogo employs transaction chaining and queries the mempool directly. This approach minimizes the complexity and potential failure points that arise with batch transactions. With the advent of Layer 2 solutions like Midgards, this issue will become less significant.
4. Alternative User Identification: Rather than relying on the payment key for user identification, Danogo utilizes fungible tokens (FTs) or non-fungible tokens (NFTs) as a method of receipt for user identification. This allows users to transfer their wallets without disrupting their ability to interact with Danogo’s smart contracts. It also enables any other smart contract to interact directly with Danogo’s ecosystem, without needing user-specific payment key access or explicit permission at every step. (We learnt this design from @zygomev from Optim Labs)

***

#### Conclusion

Cardano’s unique EUTxO model provides significant security and scalability benefits but presents challenges for dApp composability. The reliance on payment keys, use of batchers, and lack of interoperability standards make it difficult for Cardano-based dApps to interact with one another seamlessly.

However, Danogo is addressing these issues by creating open-source smart contracts, promoting oracle standardization, avoiding the use of batchers, and introducing flexible user identification methods. These efforts are designed to enhance composability, enabling Cardano’s ecosystem to unlock the potential for more integrated and dynamic dApp interactions, making Cardano a more competitive player in the decentralized space.


# Danogo Multi-Source Oracle Aggregation

### How Danogo mitigate an Oracle attack?

To ensure that loan pricing and collateral risk assessment are based on real-time, decentralized data sources, Danogo leverages two types of oracles:

* Overnight Lending Rate Oracle → Used to calculate fixed-term lending rates.
* Token Price Oracle → Used for collateral valuation.

Danogo’s multi-oracle architecture is a strong innovation in the Cardano DeFi ecosystem. Here’s what makes it stand out:

#### 1. Multi-Source Oracle Aggregation for Redundancy & Security

Danogo supports multiple oracle providers to eliminate single points of failure:\
✅ Current Supported Oracles:

* Orcfax
* DJED
* Liqwid
* Indigo
* Decentralized Exchanges (DEXs) → Minswap, Splash.

🔜 Upcoming Integrations:

* Charli3

By aggregating data from multiple sources, Danogo prevents price manipulation risks that arise from relying on a single oracle.

#### 2. Automatic Oracle Attack Detection & Mitigation

Danogo includes a built-in defense mechanism against oracle manipulation:

* If any single oracle’s price deviates by more than 5% from the average of all oracle feeds, all loan operations related to that price will be suspended.
* This prevents flash loan attacks, price manipulation exploits, and inaccurate liquidations.

#### 3. Continuous Oracle Expansion for Stronger Security

Danogo actively seeks to integrate new oracles to further enhance security and decentralization.

* More oracle providers = higher resilience against data manipulation.
* Integrating DEX price feeds improves real-time accuracy, as DEX prices reflect actual market trades.

Danogo’s commitment to multi-oracle security and decentralized price aggregation makes it the most robust and reliable lending protocol on Cardano.&#x20;

***


# Handle concurrency in a market crash

### How does Danogo handle concurrency in a market crash?

Danogo is implementing parallel liquidation processing to avoid the bottlenecks seen in Indigo/Liqwid’s system during high-volatility events. Here’s how Danogo’s approach improves on existing Cardano DeFi architectures:

#### 1. Parallel Execution for Liquidations & Collateral Top-Ups

* Indigo utilize traditional model where liquidation happens sequentially (one after another)
* Liqwid utilize batchers to allow 4 or 8 liquidations to happen at the same time depends on each token market, but incur batching cost and market interruption during frequent batching.&#x20;
* Unlike Indigo/Liqwid models, Danogo does not use batcher and decouples each loan from the main pool.
* This means every loan operates on its own execution thread, allowing:
  * Simultaneous liquidations, reducing delays during mass liquidations.
  * Faster collateral top-ups, giving borrowers real-time protection from liquidation.

#### 2. Eliminating Liquidation Queues

* In Indigo’s case, a single liquidation bot had to process each transaction one by one, leading to a two-hour queue during the ADA flash crash in 2023.
* Danogo’s multi-threaded execution model ensures that no loan has to wait for another before being processed.

#### 3. Open-Source Liquidation Bot Infrastructure

* Danogo will provide technical documentation and APIs so that anyone can run their own liquidation bot.
* This means that instead of relying on a single entity (which creates a bottleneck), multiple liquidation bots can run concurrently, leading to:
  * Faster liquidation processing.
  * Reduced risks of bad debt accumulation.
  * Increased decentralization, as liquidations are no longer controlled by a single entity.

#### Why This Matters?

* Prevents Bad Debt: Faster liquidation prevents loan collateral from falling below the borrowed amount.
* Ensures Market Stability: Borrowers can top-up collateral in real-time, reducing unnecessary liquidations.
* Decentralization & Open Participation: By making liquidation tools publicly accessible, Danogo avoids centralization risks while improving system efficiency.

This approach significantly improves scalability, efficiency, and fairness in Cardano’s DeFi ecosystem. 🚀


# Prevent LP Price Manipulation

Robust LP Pricing

On Cardano, most liquidity pools remain thin, making LP token valuations vulnerable to price manipulation. At Danogo, we’ve developed a straightforward yet robust method that anchors LP valuations to true market prices and prevents LP price manipulation.

### 1. Traditional LP Valuation

For a pool of Token A and Token B, the traditional LP Valuation formula is:<br>

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

### 2. The Manipulation Problem in Thin Pools

In low liquidity pools, a large swap can skew the “reserve price” far away from the external market price. If an attacker dumps Token A into the pool, the pool’s A/B ratio changes, causing the total value of Pool from traditional LP valuation to diverge from reality.

As a result, LP tokens minted or burned at that moment end up over- or under-valued.

### 3. Danogo’s Corrected LP Pricing Method

#### 3.1. Dual-Route LP Price Calculation

To protect against pool manipulation, we use dual-route LP Price calculation by valuing on each side of the pool against the chosen reference asset (the asset in which you wish to express LP value—e.g., ADA).&#x20;

Under normal market conditions—when no one is pushing the pool’s ratio away from fair value, both sides are equal.

The LP value against token X:

* Side A valuation

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

* Side B valuation

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

The price on both sides should be nearly identical, however in practice, we allow a small tolerance ε (e.g., 0.5 %) so micro-slippage doesn’t trigger false alarms.&#x20;

#### 3.2. Detecting Manipulation

When large swaps can skew one reserve drastically, causing:

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

for some small threshold e. Such a divergence signals potential price manipulation on one side of the pool.

### 4. Protective Response

As soon as the two LP-price routes diverge beyond our threshold:

1. Mark the LP price as “unreliable”.
2. Block any new borrow or liquidation actions tied to those LP tokens to prevent an attacker from exploiting the temporary mispricing.
3. Pause until the pool rebalances (either through natural arbitrage or an admin-triggered rebalance), at which point the two LP-price calculations realign.

### 5. Outcome & Benefits

* Accurate valuation: We ensure LP tokens never trade at an inflated value driven by one-sided pool manipulation.
* Loan safety: By blocking borrow/liquidation under suspicious conditions, we protect lenders and borrowers from unfair liquidations.
* Market integrity: Once the pool returns to equilibrium, all operations resume seamlessly—preserving both uptime and user trust.<br>

With this dual-route pricing and automatic protective mechanism, Danogo delivers reliable LP valuations and a safer lending environment—even in Cardano’s thinnest pools.

\
\
\ <br>


# Uniswap V3-Style Concentrated Liquidity

### 1. How Concentrated Liquidity is reshaping market making on Cardano

Decentralized exchanges have become a core piece of DeFi infrastructure. Through automated market makers (AMMs), traders can swap assets permissionlessly while liquidity providers supply the capital that powers these markets.

Early AMM models made market making simple and accessible, anyone could deposit two assets into a pool and earn fees from trades. However, this design also introduced a structural inefficiency: most liquidity sits idle, while only a small portion actively facilitates trading.

As the DeFi ecosystem on Cardano continues to grow, improving how liquidity is deployed becomes increasingly important. Concentrated Liquidity Market Makers (CLMMs) address this problem by allowing liquidity providers to allocate capital more precisely around active trading ranges.<br>

### 2. Liquidity was never meant to be passive

Most AMM pools use the constant product model, where liquidity is distributed across the entire price curve to support trading across a wide range of prices.

Under this model, liquidity is theoretically available for all possible prices between zero and infinity.

While elegant in theory, this assumption rarely reflects how markets actually behave. In practice, trading activity is concentrated around the current market price.

Liquidity positioned far away from the spot price rarely participates in swaps. It remains locked in the pool, generating no trading fees while still exposing liquidity providers to price risk and impermanent loss.

For example, in many stablecoin pools, only a very narrow band around the peg accounts for the majority of trading volume. Yet the traditional AMM model spreads liquidity across an enormous price range where almost no trading occurs.

This creates a structural inefficiency.

Only a small portion of total liquidity actively supports trading at any given time. As trading demand grows, slippage increases unless the total liquidity in the pool grows dramatically.

In other words, improving market quality requires disproportionately more capital  not because demand increases, but because liquidity is poorly allocated.

For ecosystems where liquidity depth is still developing, such as Cardano DeFi, this inefficiency becomes particularly visible.<br>

### 3. Concentrated Liquidity

The idea of concentrated liquidity was popularized by Uniswap V3, allowing liquidity providers to allocate capital within specific price ranges instead of spreading it across the entire curve.

Danogo brings this Uniswap V3 model to Cardano, enabling LPs to concentrate capital where trading actually happens.

Concentrated Liquidity Market Makers introduce a more precise approach to liquidity provision. In this model, liquidity providers can allocate capital within custom price ranges where they expect most trading activity to occur.

Each liquidity position is defined by two parameters:

• a lower price boundary\
• an upper price boundary

Liquidity only becomes active when the market price lies within that interval.

By concentrating liquidity around expected trading ranges, CLMMs dramatically increase liquidity density near the spot price. Each unit of capital becomes significantly more productive because it is continuously engaged in facilitating trades rather than sitting idle at irrelevant price levels.

Multiple liquidity providers can create different price ranges within the same pool. These individual positions are aggregated into a unified liquidity curve that traders interact with.

From the trader’s perspective, the market behaves like a single deep liquidity pool. Behind the scenes, however, liquidity is dynamically concentrated where trading actually happens.<br>

### 4. How Concentrated Liquidity works under the hood

To enable concentrated liquidity, the price space of a trading pair is divided into discrete intervals known as price ticks. Each tick represents a boundary between two adjacent price levels along the price curve.

When creating a liquidity position, a liquidity provider selects a lower tick and an upper tick, defining the price range where their capital will be active.

As long as the market price remains within this range:

• the liquidity participates in swaps

• trades are executed against that liquidity

• the provider earns a proportional share of trading fees

This mechanism introduces the concept of active liquidity. Only liquidity positioned around the current market price contributes to trading activity and earns fees.

If the market price moves outside the selected range, the liquidity becomes inactive. In this state, the position stops facilitating trades and no longer generates fees until the price re-enters the range or the provider updates the position.

As a result, concentrated liquidity directly links market behavior with liquidity performance. Fee generation is no longer simply a function of time but depends on how accurately liquidity is positioned relative to price movements.

This design also transforms liquidity provision into a more dynamic form of market making. Unlike traditional AMMs where liquidity is largely passive, CLMMs reward liquidity providers who actively monitor market conditions and adjust their ranges to remain near the current price.

The result is a more responsive liquidity system where capital continuously adapts to evolving market conditions, improving overall market efficiency.


# News


# Fixed Pool Lending Early Adopter Rewards Program

### 📢 What is the Fixed Pool Lending Early Adopter Program?

As we continue building the future of decentralized finance on Cardano, we're excited to introduce the Fixed Pool Lending Early Adopter Campaign — a special incentive program designed to reward our early supporters and borrowers who help grow the Danogo ecosystem.

Danogo’s Fixed Pool Lending feature allows users to borrow assets at a fixed interest rate for a fixed duration, bringing stability and predictability to DeFi lending. Now, we're giving back to those who borrow early and often.

***

### 🎯 Campaign Overview

Campaign Name: **Fixed Pool Lending – Early Adopter Rewards**\
Duration: **May 24, 2025 – December 31, 2025**\
Eligible Users: Borrowers who create valid loans through Fixed Pool Lending on Danogo during the campaign.\
Incentive: The more you borrow, the more $DANO you earn — simple as that.

***

### 💰 Reward Scheme

For every $100 borrowed per epoch (5-day lending period), you will receive 1 $DANO.\
Note: Rewards are calculated per loan.

#### 🧮 Examples:

* Borrow $400 for 30 days →\
  400 / 100 = 4 × 6 epochs = 24 $DANO<br>
* Borrow $400 for 7 days →\
  400 / 100 = 4 × 1 epoch = 4 $DANO<br>
* Borrow $450 for 5 days →\
  450 / 100 = 4 (rounded down) × 1 epoch = 4 $DANO<br>

Borrowers are rewarded based on the principal amount and loan duration, encouraging early and sustained borrowing behavior.

***

<br>

### $DANO Token Details

* Token Ticker: DANO
* Policy ID: cde0ddc1e46f26d886eb972319bcb76418cb42c1cd8aded18a042537\ <br>

***

### ⏳ Claiming Your Rewards

Rewards will be calculated every epoch and distributed at the start of the following epoch. Only valid loans created during the previous epoch will be eligible.

✅ Claim your rewards here:\
👉[ https://app.danogo.io/incentivized](https://app.danogo.io/incentivized)

***

### 🚀 Join the Movement

Are you ready to earn more while borrowing smarter?

Whether you’re hedging, leveraging, or unlocking liquidity, Danogo’s Fixed Pool Lending lets you borrow with confidence — and now with extra rewards in $DANO.

Join us in this early adopter campaign and be part of the next wave of DeFi on Cardano.

📆 Mark your calendar — it all begins May 24, 2025.

<br>


# Danogo Flexible Pool Incentivized Testnet

<figure><img src="/files/288gSSm4RaTEnbzA5MF9" alt=""><figcaption></figcaption></figure>

We are thrilled to announce the launch of the Danogo Flexible Pool Lending Testnet, which completes our end-to-end lending and borrowing suite by offering both fixed-rate and flexible-rate options for users. Float-rate lending, also known as variable-interest-rate lending, is a dynamic model where rates fluctuate in real-time based on supply and demand within the pool, unlike fixed-rate lending, where interest rates remain constant regardless of market conditions.

We invite all users to participate in this critical testing phase: explore core float-rate functionalities, stress-test liquidations, and help us refine the Danogo protocol with your feedback. By joining the testnet, you’ll play a vital role in identifying improvements and earn rewards for your contributions.

### Danogo Testnet Timeline

The Danogo Testnet will follow these key milestones:

* Address Registration\
  Registration opens on June 2nd, 2025, at 00:00 UTC via the [Registration Form](https://docs.google.com/forms/d/e/1FAIpQLSfCMDoeWJkfNBSp3jfa8xVw_qN2qVnswLjzUIfkkT6FyBfr5w/viewform?usp=sharing)

If you already joined the Danogo Fixed Rate Lending Testnet? No need to register again

* Main Task Completion\
  Testnet tasks can be completed starting June 09th, 2025, at 12:00 UTC and concluding on June 16th, 2025, at 23:59 UTC. This phase involves exploring Danogo’s features and testing its functionality while contributing to the platform’s refinement.

### What can you earn?

We are excited to announce that the total prize pool for the Danogo Flexible Pool Lending Testnet is 150,000 $DANO, which will be distributed among participants based on their points.<br>

### How to Participate

Already joined the Danogo Fixed Rate Lending Testnet? No need to register again — you're all set for this campaign!\
For new participants, follow these simple steps:

Join the Testnet

* Register via [This Form](https://docs.google.com/forms/d/e/1FAIpQLSfCMDoeWJkfNBSp3jfa8xVw_qN2qVnswLjzUIfkkT6FyBfr5w/viewform?usp=sharing).
* Connect to this Website: [https://preview.danogo.io](https://preview.danogo.io/)
* We recommend using Eternl or Lace wallets for optimal performance.

Claim Test Tokens

* Tokens you will receive: 500 tADA, 300 tDjed, 300 tiUSD, 200.000 tSnek
* Ensure you use the same wallet registered during sign-up.
* Faucet Limit: 1 claim per wallet per day.
* Use this [Link ](https://preview.danogo.io/testnet-faucet)to receive test tokens.

Complete Testing Tasks

* Perform testing tasks described in the testing instructions to earn your points.

Provide Feedback

* Report any bugs or suggest improvements through the [Feedback Form](https://docs.google.com/forms/d/e/1FAIpQLSdlN_EamrjR-4D08ghgumy2680xoyNdyeWiU3H-VyCIN12urw/viewform).
* 🎁 Valid reports or suggestions may earn you bonus rewards!

### Detailed Testing Instructions

Connect your wallet before performing any of the actions below:

1. Supply Asset & Earn Interest
2. Withdraw Asset
3. Create Floating Interest Rate Loans
4. Modify Loans
5. Repay Loans

Each successful transaction performing one of the actions above will count as 1 point, with a maximum of 10 points per action.

🎯 The more points you earn, the bigger your rewards!<br>

1️⃣ Supply Assets & Earn Interest (Max 10 points)

* Deposit assets into the Danogo Float pool and receive dTokens.
* Requirement: Complete your supply transactions with at least two different asset types.

How to supply assets: <https://docs.danogo.io/how-to-use/guides/flexible-pool-lending/how-to-supply-assets>

2️⃣ Withdraw Assets (Max 10 points)

* Suppliers can withdraw assets by returning dTokens, receiving both principal and interest.
* Requirement:
  * Partial Withdrawal: Withdraw a portion of supplied assets.
  * Full Withdraw: Withdraw all supplied assets in a single transaction.

How to Withdraw Assets: <https://docs.danogo.io/how-to-use/guides/flexible-pool-lending/how-to-withdraw-assets>&#x20;

3️⃣ Create Float Interest Rate Loans (Max 10 points)

* Borrowers must provide sufficient collateral (Tokens or dTokens).
* Requirement:&#x20;
  * One transaction without supplied tokens as collateral.
  * One transaction with supplied tokens as collateral.

How to Borrow: <https://docs.danogo.io/how-to-use/guides/flexible-pool-lending/how-to-create-floating-interest-rate-loans>

4️⃣ Modify Loans (Max 10 points)

* Adjust collateral and loan amounts as needed.
* Requirement:
  * One transaction that increases collateral and the borrowed amount.
  * One transaction that decreases collateral and the borrowed amount.

How to Modify a Loan: <https://docs.danogo.io/how-to-use/guides/flexible-pool-lending/how-to-modify-loans>

5️⃣ Repay Loans (Max 10 points)

* Fully repay a loan by reducing the borrowed amount to 0.

How to Repay a Loan: <https://docs.danogo.io/how-to-use/guides/flexible-pool-lending/how-to-repay-loan><br>

***

### Join the Community

Stay updated and connect with the Danogo community:

🌐 Website: [\[Link\]](https://danogo.io/)

💬 Discord: [\[Link\]](https://discord.gg/vDMRZBJtTy)

💬 Telegram: [\[Link\]](https://t.me/danogo_io)

📢 Twitter: [\[Link\]](https://x.com/danogo_2023)

***

### Be Part of the Future of DeFi!

This is your opportunity to shape the Danogo ecosystem. Your participation will help refine our protocol, ensuring a secure, stable, and efficient DeFi experience for all users. Join the Testnet today and make an impact!

🚀 Start Testing Now! 🚀\ <br>


# Flexible Pool Lending Rewards

**🎯 Campaign Overview**

**Duration**: From: Sep 17, 2025 (Epoch 583)    To: once notified.

**Eligible Users**: Suppliers who supply USDM/USDA/ADA/BTC/USDCx or Borrowers who create valid USDA/USDM/ADA/BTC loans through Flexible Pool Lending on Danogo during the campaign.

**Incentive**: The more you borrow/supply USDA, USDM, ADA, BTC the more $DANO you earn&#x20;

**💰 Reward Scheme**

For every 100 USDA/USDM or 100 ADA or 0.001 BTC borrowed per Cardano epoch (5-day period), you will receive 1 $DANO.

*Note: Rewards are calculated per loan.*

For every 100 USDA/USDM or 100 ADA or 0.001 BTC supplied per Cardano epoch (5-day period), you will receive 0.5 $DANO.

*Note: Rewards are calculated per snapshot each epoch.*

<br>

**🧮 Examples:**

Borrow $400 for 30 days →

400 / 100 = 4 × 6 epochs = 24 $DANO

Borrow $400 for 7 days →

400 / 100 = 4 × 1 epoch = 4 $DANO

Borrow $450 for 5 days →

450 / 100 = 4 (rounded down) × 1 epoch = 4 $DANO

Supply $1000 for 5 days →

1000 / 100 \* 0.5 = 5 × 1 epoch = 5 $DANO

<br>


# Leverage Trading Incentivized Testnet

## Introducing the Danogo Leveraged Trading Testnet

Trade with leverage. Earn rewards. Help harden Cardano’s next-gen margin engine.

We’re excited to launch the Danogo Leveraged Trading Testnet—a big step toward safe, capital-efficient leveraged trading on Cardano. This is your chance to open test positions, push the UI/UX, and earn token rewards while we finalize the core mechanics ahead of mainnet.

### What Is Danogo Leveraged Trading?

Danogo’s leveraged trading lets you:

* Open long/short positions on supported pairs (e.g., BTC/USDM, ADA/USDM)
* Borrow from Danogo’s lending pools to amplify exposure
* Close position to take profit or stop loss.
* Settle on-chain— fully decentralized, transparent, composable<br>

### 📣 Why Join

* Earn rewards for completing simple on-chain tasks and sharing feedback
* Shape the product that margin traders will use on Cardano
* Become an early adopter of Danogo’s leverage + lending stack<br>

### 💡 How It Works (3 Simple Steps)

1. Register your Cardano preproduct wallet and receive faucet token
2. Open test positions (long/short), adjust leverage, try partial close + full close.
3. Submit feedback and claim rewards—no real funds required (test assets only).<br>

### ✅ How to Join

* Register: <https://forms.gle/s1KSi9poesCju7kp9>
* Get test assets:&#x20;
  * For ADA (choose Prepod network) : <https://docs.cardano.org/cardano-testnets/tools/faucet>
  * For other tokens: <https://preprod.danogo.io/testnet-faucet>
* Access the testnet app:  <https://testnet.danogo.io/>
* Submit feedback/bugs:  <https://forms.gle/WpdEBCvU3GLfwkYX7>
* Spread the word on X/Discord with #DanogoTestnet and tag @DanogoFinance&#x20;

### ⚠️ Important Notes

* Testnet uses test ADA/fUSDM/fBTC/fUSDA—no real funds.
* You must register the wallet you use to be eligible for rewards.\ <br>

***

### 🏆 Incentives & Point System

Rewards Pool: 100,000 $DANO allocated to testnet participants.\
Your share scales with your total points.

#### Main Tasks

| Task                                                           | Max Points |
| -------------------------------------------------------------- | ---------- |
| Open 6 positions (any mix of long/short)                       | 6 pts      |
| Close 6 positions                                              | 6 pts      |
| Submit feedback or bug report (clear repro steps/logs/screens) | 5 pts      |
| Share a post on X (Twitter) about your test experience         | 3 pts      |

💡 Tip: Quality feedback (clear titles, steps, screenshots/tx links, expected vs actual) helps us fix things fast—and enables you to score maximum points.

***

### 🧭 What We Want You to Test&#x20;

* Open/close on BTC/USDM and ADA/USDM
* Leverage slider & numeric input behavior
* Full close flows
* Fees/interest display (clarity + math checks)
* TP/SL placement, cancel, and execution UX
* Error states (insufficient collateral, price moved, oracle delay)<br>

***

### 🗓 Timeline&#x20;

* Registration opens: September 18th
* Testing window: \[September 22 – September 29]
* Feedback deadline: October 06
* Rewards calculation & announcement: October 14<br>

***

### 🏆Guide line&#x20;

* Disclaimer
  * Prices shown on the testnet are based on mock DEX pools. These do not represent the actual market prices of the token pair.
* How to Open Position
  * Go to mainscreen: <https://testnet.danogo.io/>
    \*

    ```
    <figure><img src="/files/pVE6zpKJQ61GAFtVQ8Qu" alt=""><figcaption></figcaption></figure>
    ```
  * Connect wallet

    * Click on button Connect Wallet
    * On popup Connect Wallet, click on chosen wallet
      * The system only displays wallets for which you have installed the plugin.
    *

    ```
    <figure><img src="/files/rSSAMrqb0cZdJD6162hu" alt=""><figcaption></figcaption></figure>
    ```
* Choose Pair to trading

  * Click on the trading pair which you want to trade
  *

  ```
  <figure><img src="/files/cHFG5czk7yTDpDu1uQeA" alt=""><figcaption></figcaption></figure>
  ```
* On the right panel, input position Information
  \*

  ```
  <figure><img src="/files/9eANmDB0oihXMPwd3P0K" alt=""><figcaption></figcaption></figure>
  ```

  * Select position type : long/short
  * Choose deposit token:
    * Click on icon dropdown to change deposit token
    * On popup, choose token
      \*

      ```
      <figure><img src="/files/WXaj53JQBWsuySFDcBlr" alt=""><figcaption></figcaption></figure>
      ```
  * Input collateral amount
  * Choose leverage
  * Check Position information and click on Open Long/Short
    \*

    ```
    <figure><img src="/files/7s2o9bTLX39wnErSVPU6" alt=""><figcaption></figcaption></figure>
    ```
  * Sign the transaction
* How to Close Position
  * Go to main screen: <https://testnet.danogo.io/>
    \*

    ```
    <figure><img src="/files/ZgGLpm1AQKnjWXEAEsKF" alt=""><figcaption></figcaption></figure>
    ```
  * Connect wallet
  * On position list, select position that you want to close
  * Click Close button
  * Sign the transaction

\ <br>


# Danogo Leverage Trading Leaderboard Campaign

**Duration**: Oct 20 – Nov 17, 2025 (4 weeks)\
**Total Rewards**: $4,000 equivalent ($1000 each week)\
**Objective**: Reward top-performing traders on Danogo’s Leverage Trading.

### **How It Works**

* Create Leverage Trading Position on Danogo with the specific pair announced each week. The pair is posted every Monday 12:00 UTC on Twitter and Discord.
* Ranking Metric: Weekly cut-off PnL = realized PnL + unrealized PnL on Monday 17:00 UTC snapshot. Fees and slippage are included.
* Reset: Leaderboard resets every Monday 17:00 UTC.

### Weekly Rewards

| Rank      | Reward |
| --------- | ------ |
| 1st Place | $500   |
| 2nd Place | $300   |
| 3rd Place | $200   |

Rewards are distributed within 72 hours after each round ends via[ app.danogo.io/incentivized](https://app.danogo.io/incentivized).

### Eligibility

* Trade on Danogo Leverage Trading during the campaign period.
* Only positions opened within the week’s period (Monday 17:00 UTC → next Monday 17:00 UTC) count toward that week’s ranking.

### Leaderboard

* Top 10 updated daily on our Discord channel.
* Final weekly standings are posted after the cut-off snapshot.

### Example

A trader opens a 5× long ADA/USDM and closes with +20%. The realized gain (minus fees/slippage), plus any open PnL at the cut-off snapshot, forms that week’s cut-off PnL.

### Timeline

* Week 1: Oct 20 – Oct 27 → Rewards announced Oct 29
* Week 2: Oct 27 – Nov 3 → Rewards announced Nov 5
* Week 3: Nov 3 – Nov 10 → Rewards announced Nov 12
* Week 4: Nov 10 – Nov 17 → Rewards announced Nov 19

### How to Join

1. Go to <https://app.danogo.io/leverage-trading>
2. Connect your wallet and trade the pair of the week.
3. Track your rank on Discord’s daily Top 10.

####


# Cardano Incident Update — What Happened & How We Responded

On **Friday, 21 November 2025 at around 08:00 UTC** , the Cardano network experienced a complex chain partition triggered by a malformed delegation transaction exploiting a dormant deserialization bug in certain node versions. This affected many services across the ecosystem — including Danogo.

As always, we want to communicate clearly and transparently about what happened on our side.

***

### **How this impacted Danogo**

Danogo was running **Cardano node version 10.4.1**, one of the versions affected by the issue:

#### **1. Our node could not consume new blocks**

Because of the chain partition, nodes on v10.4.1 became stuck behind the healthy chain.\
This meant Danogo’s backend couldn't follow the main chain correctly.

#### **2. Ogmios could not receive fresh block data**

Our Ogmios service depends on the node to stream the latest blocks.\
When the node stalled, Ogmios stopped receiving updates.

#### **3. Transaction builder received outdated UTXOs**

Without fresh block data, our transaction builder could not access correct UTXO information.\
**Result:**\
Users could not build or submit new transactions during the incident window.

Throughout this time, **user funds remained completely safe**, and no on-chain Danogo positions were affected.

***

### **Our Response**

As soon as updated node versions were announced from Intersect (<https://x.com/IntersectMBO/status/1991818834592870894>), we acted immediately:

#### **✔ Upgraded to Cardano node 10.5.2**

This is the patched version aligned with the healthy chain.

#### **✔ Full resynchronization of the chain**

Our node required \~9 hours to fully resync to the canonical chain, restoring normal service.

#### **✔ System checks & validation**

We validated UTXO correctness, Ogmios data freshness, and transaction-building flows before reopening the platform.

Danogo is now **fully operational**.

***

### **Key Takeaways**

* Danogo was affected *only* because the older node version (10.4.1) stalled during the chain split.
* No funds were at risk, and all on-chain logic stayed intact.
* The downtime was a direct result of the Cardano node deserialization issue, not a Danogo smart contract or backend failure.
* Upgrading to the patched version restored full service.

***

### **Moving Forward**

We are taking additional steps to strengthen resilience:

* Faster node upgrade cadence
* Additional node health monitoring
* More redundancy in block-sync infrastructure
* Automatic UTXO validation fallback paths for extreme consensus events

If you submitted a transaction during the incident window and it did not appear on-chain, you may need to **resubmit** it. Our team can assist if needed.


# Concentrated Pool Incentivized Testnet

### Introducing Danogo Concentrated Pool Testnet

Provide liquidity. Swap tokens. Earn rewards. Help harden Cardano’s next-gen concentrated liquidity engine.

We’re excited to launch the Danogo Concentrated Liquidity Pool (CLP) Testnet. Key step toward efficient liquidity provisioning on Cardano. This is your chance to add and withdraw liquidity, swap tokens, and earn token rewards while we finalize the core mechanics ahead of mainnet.

#### What Is Danogo Concentrated Liquidity?

Danogo’s concentrated liquidity lets you:

* Provide liquidity only within a chosen price range (e.g., 0.9–1.1 USDM per ADA) instead all prices
* Earn a higher share of fees with the same capital when trades happen inside your range
* Manage your liquidity positions fully on-chain — decentralized, transparent, and composable

#### 📣 Why Join

* Earn rewards for completing simple on-chain tasks and sharing feedback
* Shape the product that LPs and protocols will rely on for concentrated liquidity
* Become an early adopter of Danogo’s CLP

#### 💡 How It Works (3 Simple Steps)

1. Register your Cardano preprod wallet and receive faucet token&#x20;
2. Use CLP features on testnet:&#x20;
   * Add liquidity&#x20;
   * Withdraw liquidity&#x20;
   * Swap tokens&#x20;
3. Submit feedback and claim rewards—no real funds required (test assets only)

#### ✅ How to Join

1. Register: <https://forms.gle/obJb6ydyVnWwJ3Sc7>
2. Get test assets:
   1. For ADA (choose Prepod network) : <https://docs.cardano.org/cardano-testnets/tools/faucet>
   2. For other tokens: <https://preprod.danogo.io/testnet-faucet>
3. Access the testnet app:  <https://testnet.danogo.io/swap/>
4. Submit feedback/bugs: [https://forms.gle/YejM7qop4zJWExNH6](< https://forms.gle/YejM7qop4zJWExNH6>)
5. Spread the word on X/Discord with #DanogoTestnet and tag @DanogoFinance

#### ⚠️ Important Notes

* Testnet uses test assets - no real funds.
* You must register the Mainnet wallet you use to be eligible for rewards.

#### 🏆 Incentives & Point System

Rewards Pool: 100,000 $DANO allocated to testnet participants.

Your share scales with your total points.

<table><thead><tr><th width="579">Task                                                           </th><th valign="middle">Max Points </th></tr></thead><tbody><tr><td>Add liquidity to at least 3 different pair  </td><td valign="middle">3 pts </td></tr><tr><td>Perform at least 10 swaps</td><td valign="middle">10 pts </td></tr><tr><td>Perform at least 3 liquidity withdrawals (partial and full) </td><td valign="middle">3 pts </td></tr><tr><td>Submit feedback or bug report (clear repro steps/logs/screens)</td><td valign="middle">5 pts </td></tr><tr><td> Share a post on X (Twitter) about your test experience and tag @DanogoFinance or retweet our announcement post </td><td valign="middle">3 pts  </td></tr></tbody></table>

💡 Tip: Quality feedback (clear titles, steps, screenshots/tx links, expected vs actual) helps us fix things fast—and enables you to score maximum points.

#### 🧭 What We Want You to Test;

* Add liquidity on ADA-USDA, BTC-USDM, ADA-USDM
  * 1 Partial and 2 full withdrawals from your liquidity positions
* Swap on on ADA-USDA, BTC-USDM, ADA-USDM
* Fees/Price display&#x20;
* TP/SL placement, cancel, and execution UX
* Error states (insufficient collateral, price moved, oracle delay)

#### 🗓 Timeline

* Testing window: 12:00 UTC Jan 22th  2026  –  12:00 UTC Jan 29th 2026
* Feedback deadline: Feb 06
* Rewards calculation & announcement: Feb 10

### 🏆Guideline

* Disclaimer
  * Prices shown on the testnet are based on mock DEX pools. These do not represent the actual market prices of the token.

#### 1. How to Add Liquidity

* Go to mainscreen: <https://testnet.danogo.io/liquidity>
* Connect wallet
  * Click on button Connect Wallet
  * On popup Connect Wallet, click on chosen wallet
    * The system only displays wallets for which you have installed the plugin.
* Choose Pool to add liquidity
  * Click on the pool that you want to add liquidity to

    <figure><img src="/files/bmuyseauiT4iUJlQJKUu" alt=""><figcaption></figcaption></figure>
  * On the popup, enter Liquidity Information

    <figure><img src="/files/XxTfbrmhJqcg3zs9nW49" alt=""><figcaption></figcaption></figure>
  * &#x20;Enter amount for Token A, system will calculate required amount of Token B based on the pool’s weight
    * You can adjust the amount using the percentage slider.
    * Click Add after all required information is filled in
    * Sign the transaction

#### 2. How to withdraw liquidity

* You can only withdraw liquidity after you have successfully added liquidity before
* Go to main screen: <https://testnet.danogo.io/liquidity>
* Connect wallet
* In the pools list, you will see the Withdraw button next to Add button for the pool where you previously added liquidity.

  <figure><img src="/files/s3exnB6EtNwEvgMh0P3V" alt=""><figcaption></figcaption></figure>
* Click Withdraw button
* By default, Danogo withdraws 100% of your liquidity from the pool. You can adjust the withdrawal amount using the slider or by editing the value manually.

  <figure><img src="/files/EnC5weKghIZLKskIiu9L" alt=""><figcaption></figcaption></figure>
* Sign the transaction

#### 3. How to Swap

* &#x20;You can swap tokens that are available in the pool.
* Go to main screen: <https://testnet.danogo.io/swap>
* Connect wallet
* Choose Pair to Swap
* Click on icon dropdown to change token

  <figure><img src="/files/NU1qR1ZIQrwMdK2VPbuh" alt=""><figcaption></figcaption></figure>
* In popup, choose token you want

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

* Input amount you want to swap.
* Danogo will automatically calculate the output amount based on token pair price.

  <figure><img src="/files/wH4EjkS4bP55Fl8T1NQf" alt=""><figcaption></figcaption></figure>
* Double-check price information, amount you will receive, exchange rate, and fee
* Note: In a concentrated liquidity pool, price may change depending on your swap amount and the currently active liquidity range.
* Sign the transaction


# Leverage Trading & Concentrated Pool (Uniswap V3) Campaign

**Duration**: Mar 19 – Mar 31 (2 weeks)\
**Total Rewards**: 2,000ADA & 100K DANO\
**Objective**: Reward top-performing traders with ADA and distribute DANO to all users participating in Danogo leverage trading.

### **How It Works**

* Create Leverage Trading Position on Danogo with the following pairs:&#x20;
  * **ADA - USDCx**
  * **NIGHT - USDCx**
* Ranking Metric:&#x20;

  * Total **Gross PnL** = Sum of the **Gross PnL** of all positions opened during the campaign (both closed and still open).

  <figure><img src="/files/7cjCY4KV2djOGGDDsZtt" alt=""><figcaption></figcaption></figure>

### Reward 2,000 ADA for the top 5 traders by profit.

| Rank      | Reward  |
| --------- | ------- |
| 1st Place | 800 ADA |
| 2nd Place | 500 ADA |
| 3rd Place | 300 ADA |
| 4rd Place | 200 ADA |
| 5rd Place | 200 ADA |

### Reward 100k DANO&#x20;

* Reward DANO to all users who open positions during the campaign period.
* Earn 1 DANO for every $10 of trading volume.

### Eligibility

* Users must trade on Danogo Leverage Trading during the campaign period.
* Only positions opened within the campaign’s period (19/03/2026 17:00 UTC → 31/03/2026 17:00 UTC) count toward.

### Leaderboard

* Top 10 updated daily on our Discord channel & Website Danogo
* The top 5 winners will be announced after the campaign ends.

### Example

Assume a trader opens **3 positions during the campaign**.

<table><thead><tr><th width="114">Position</th><th width="149">Pair</th><th width="142">Status</th><th width="172">Trading Volume ($)</th><th width="159">Gross PnL</th></tr></thead><tbody><tr><td>Position 1</td><td>ADA/USDCx</td><td>Closed</td><td>$5,000</td><td>-$50</td></tr><tr><td>Position 2</td><td>ADA/USDCx</td><td>Closed</td><td>$3,000</td><td>+$120 </td></tr><tr><td>Position 3</td><td>NIGHT/USDCx</td><td>Open</td><td>$2,000</td><td>+$30</td></tr></tbody></table>

* Total Gross PnL = (-$50) + $120 + $30 = +$100
* Total Volume = $5,000 + $3,000 + $2,000 = $10,000&#x20;
  * Total DANO earned = $10,000 / 10 = 1,000 DANO

### Timeline

* From 19/03/2026 17:00 UTC → To 31/03/2026 17:00 UTC

### How to Join

1. Go to <https://app.danogo.io/leverage-trading>
2. Connect your wallet and start trading **USDCx pairs**.
3. Track your rank on Discord’s daily Top 10.
4. Follow us on X to stay updated on the campaign <https://x.com/DanogoFinance>


# Concentrated Pool Rewards

**🎯 Campaign Overview**

**Duration**: From: Mar 30, 2026 (Epoch 622)    To: once notified.

**Eligible Users**: Liquidity Providers who add liquidity to **Danogo Concentrated Pools (CLP)**

**Incentive**: The more **liquidity** you provide → the more $DANO you earn

**💰 Reward Scheme**

For every **$100 worth of LP position (in USD)** per Cardano epoch (5-day period) you will receive 2 $DANO.

*Note: Rewards are calculated per snapshot each epoch.*

**Reward Formula**

`Rewards per epoch = (LP Value in USD / 100) x 2`&#x20;

**🧮 Examples:**

Provide $400 liquidity for 30 days →

(400 / 100) x 2 × 6 epochs = 48 $DANO

Provide $400 for 7 days →

(400 / 100) x 2 × 1 epoch = 8 $DANO

<br>


# Dano Finance integrates TradingView into Leverage Trading

We're excited to announce the integration of TradingView's Advanced Charts into Dano Finance Leverage Trading. This integration brings professional-grade [market](https://www.tradingview.com/markets/) analysis directly to the platform, enabling traders to analyze price action, identify opportunities, and execute positions seamlessly within the Cardano ecosystem.

### What is TradingView?

[TradingView](https://www.tradingview.com/) is one of the world's most popular charting and [market](https://www.tradingview.com/markets/) analysis platforms, trusted by millions of traders and investors across global financial markets.

Designed for both beginners and professional traders, [TradingView](https://www.tradingview.com/) provides advanced charting technology, technical indicators, drawing tools, and real-time market data that help users better understand market movements and make informed trading decisions.

From cryptocurrencies and forex to stocks and commodities, [TradingView](https://www.tradingview.com/) has become the industry standard for technical analysis. Traders use the platform to monitor price action, identify trends, analyze market structure, and develop trading strategies based on real-time market conditions.

For example, traders often monitor the [BTCUSD](https://www.tradingview.com/symbols/BTCUSD/) chart to analyze Bitcoin price movements, identify market trends, and evaluate potential trading opportunities in real time.&#x20;

<br>

Some of TradingView's most widely used features include:

* Advanced interactive charts
* Multiple chart types and timeframes
* Hundreds of technical indicators
* Professional drawing and annotation tools
* Real-time market visualization
* Customizable trading layouts

By integrating TradingView's Advanced Charts directly into [Dano Finance](https://dano.finance/leverage-trading), traders can access these powerful analytical tools without leaving the platform, creating a more seamless and efficient trading experience.

### TradingView on Dano Finance

<img src="/files/RBdgpRrt5ZrmS11r15Vb" alt="" height="385" width="602">

The TradingView chart is embedded directly into the Leverage Trading page, giving traders access to advanced market analysis without needing to switch between multiple applications or browser tabs.

Instead of analyzing markets on one platform and placing trades on another, users can now perform both actions from a single interface.

This streamlined workflow helps traders react faster to market movements and manage positions more efficiently.

### How to use TradingView on Dano Finance

#### Step 1: Open Leverage Trading

Navigate to the Leverage Trading section on Dano Finance.

Once inside the trading interface, you'll find the TradingView chart displayed alongside the trading panel and position management tools.

The chart updates in real time, allowing you to monitor price movements as market conditions change.

#### Step 2: Select your trading pair

<img src="/files/ZceJXaaDmxKEuEuQtntP" alt="" height="388" width="602">

Choose the market you want to trade.

The chart will automatically update to display the corresponding asset's price action, allowing you to begin your analysis immediately.

This enables traders to quickly evaluate market structure before opening a leveraged position.

#### Step 3: Change timeframes

<img src="/files/vv0sttlkP9b416gq6ExT" alt="" height="395" width="602">

Different trading strategies require different perspectives.

Using the timeframe selector at the top of the TradingView chart, traders can switch between short-term and long-term views of the market.

For example:

* Lower timeframes help identify short-term opportunities.
* Higher timeframes help reveal broader market trends.
* Multiple timeframe analysis can improve trade planning and risk management.

#### Step 4: Apply technical indicators

TradingView provides access to a wide range of technical indicators that help traders interpret market behavior.

Popular indicators include:

* Moving Averages
* Relative Strength Index (RSI)
* MACD
* Bollinger Bands
* Volume Analysis Tools

These indicators can be added directly to the chart to support trading decisions and identify potential market opportunities.

#### Step 5: Draw and analyze market structure

One of TradingView's most powerful features is its drawing toolkit.

Traders can:

* Draw trendlines
* Mark support and resistance zones
* Identify breakout levels
* Highlight key price areas
* Visualize trading setups

These tools make it easier to build a structured trading plan before entering a position.

#### Step 6: Execute trades without leaving the interface

After completing market analysis, traders can open, manage, or close positions directly from the Dano Finance Leverage Trading interface.

There is no need to switch platforms or copy information between applications.

Analysis and execution happen in one seamless workflow.

### Benefits for Leverage Traders

Leverage trading requires precision.

Because leveraged positions are more sensitive to price movements, access to reliable charting tools becomes even more important.

The TradingView integration on Dano Finance helps traders:

* Analyze market conditions more effectively
* Identify potential entry and exit points
* Monitor market trends in real time
* Improve risk management
* Execute trades more efficiently

By bringing advanced charting directly into the trading experience, Dano Finance helps traders make more informed decisions while reducing unnecessary complexity.

### Building a better trading experience on Cardano

At Dano Finance, our mission is to provide traders with professional-grade tools while maintaining the transparency and accessibility of decentralized finance.

The integration of TradingView represents another important step toward that vision.

By combining advanced charting technology with decentralized leverage trading, Dano Finance delivers a more complete trading experience for users across the Cardano ecosystem.

### Start trading with TradingView on Dano Finance

The TradingView integration is now available within Dano Finance Leverage Trading.

Whether you're analyzing market trends, planning your next position, or actively managing trades, TradingView's powerful charting tools are now built directly into your trading workflow.

Explore Dano Finance today and experience leverage trading powered by TradingView.

<br>


# Getting Started


# Ready with your Cardano Wallet

Danogo supports the following Cardano's wallets:

1. Begin
2. Eternl
3. Exodus
4. Flint
5. Gero
6. Lace
7. Lode
8. Nufi
9. Tokeo
10. Typhon
11. Vespr
12. Yoroi


# Connecting Wallet

Go to Danogo dApp, navigate to the top right corner of the screen and click the **Connect wallet** button.

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

After you click the **Connect wallet** button, a list of supported Cardano wallets will appear. Select your preferred Wallet to connect

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


# Guides


# Yield Aggregator

The **Danogo Yield Aggregator** streamlines the process of finding and acting on the best **lending**, **borrowing** opportunities across Cardano DeFi. By **interacting directly** with each protocol’s smart contracts, it guarantees a **transparent**, **secure**, and **trustless** experience.

**Why It Matters:**\
Investing on Cardano can be complex—various DApps offer different APRs and APYs for lending, borrowing, and providing liquidity. Manually **comparing** them takes time and effort, leaving many users unsure if they’re getting the **best** possible returns.

**How It Works:**

* **Aggregates & Analyzes** data from multiple DApps, covering both **lending/borrowing** (e.g., Liqwid, Lenfi).
* Displays yields in a **simple interface**, allowing you to **filter**, and **compare** based on APR, APY, token type, and more.
* Lets you **take action**—supply, withdraw, borrow, or repay—**all without leaving Danogo**.

**Key Benefits:**

* **Security & Transparency** through direct smart contract interaction.
* Quick, **one-stop comparison** of rates for both **suppliers** and **borrowers**.
* **Easier decision-making** with streamlined categories and clear filtering options.
* Drives **higher participation** in Cardano DeFi by **reducing complexity** and saving time.


# How to find the most suitable yield products?

First, Let's connect your wallet!

Step 1: Navigate to the Yield Aggregator menu

Step 2: On the screen, you’ll see a list of tokens available for lending and borrowing across various lending protocols

* The tokens are sorted based on the number of tokens you hold in your wallet.

Step 3: For each token, the best interest rate for supplying and borrowing is displayed:

* Supply: The highest interest rate available for that token.
* Borrow: The lowest interest rate available for that token.

Step 4: To view deal details, click on the Supply APY or Borrow APR corresponding to the token

<div align="center" data-full-width="true"><figure><img src="/files/bq1xE8SJ63OsDGqz8YAT" alt="" width="482"><figcaption></figcaption></figure></div>


# How to Supply Liquidity?

First, Let's connect your wallet!

Step 1: Navigate to the Yield Aggregator menu

Step 2: Choose the token you want to supply and click on its Supply APY.

<figure><img src="/files/bq1xE8SJ63OsDGqz8YAT" alt="" width="482"><figcaption></figcaption></figure>

Step 3: On the Supply list, select the most suitable deal.

* We display key deal details, including the protocol, Supply APY, available volume, and maturity date.
* Click the Supply button on your selected deal.

<figure><img src="/files/n1EPiGMZWqvgTKtF6uOY" alt="" width="494"><figcaption></figcaption></figure>

Step 4: On Supply Screen (Each protocol will display different types of information):

* Input Supply Amount, Click Supply
* Sign the transaction on your wallet

<div><figure><img src="/files/xcQTDSpEYQPPyMW0feHC" alt=""><figcaption></figcaption></figure> <figure><img src="/files/Ikd0jwYq2ZSzUUKxNHqn" alt=""><figcaption></figcaption></figure></div>

* ***Note: All transactions are built and interact directly with the smart contract of the protocol you select.***

Step 5: After the transaction is successfully signed:

* For Liqwid Protocol: You can modify the details of your supply position right on the supply list screen
* For Danogo Protocol: You will receive Bond tokens. Go to My Account to view information about the Bonds you’ve received. Here, you can either list your Bonds or redeem them upon maturity.

<br>


# How to Withdraw Liquidity?

First, Let's connect your wallet!

Step 1: Navigate to the Yield Aggregator menu

Step 2: Choose the token you want to withdraw and click on its Supply APY.

<figure><img src="/files/bq1xE8SJ63OsDGqz8YAT" alt="" width="482"><figcaption></figcaption></figure>

Step 3: On the Supply list, enable toggle My Supply

* The screen only shows your supply list.
* Choose the deal you want to withdraw tokens
* Click the Withdraw button on your selected deal.

<figure><img src="/files/NItzhu1Ei26ymF54u6Uv" alt="" width="497"><figcaption></figcaption></figure>

Step 4: On Withdraw Screen

* Input Withdraw Amount, Click Withdraw
* Sign the transaction on your wallet

<figure><img src="/files/2Xj8ltJbNVcjWXf2texI" alt=""><figcaption></figcaption></figure>

* ***Note: All transactions are built and interact directly with the smart contract of the protocol you select.***


# How to Borrow Tokens?

First, Let's connect your wallet!

Step 1: Navigate to the Yield Aggregator menu

Step 2: Choose the token you want to borrow and click on its Borrow APR.

<figure><img src="/files/bq1xE8SJ63OsDGqz8YAT" alt="" width="482"><figcaption></figcaption></figure>

Step 3: On the Borrow list, select the most suitable deal.

* We display key deal details, including the protocol,Borrow APR,   collateral tokens and the liquidation point
* Click the Borrow button on your selected deal

<figure><img src="/files/ke8XH7gyKhCRQGgVy04T" alt="" width="493"><figcaption></figcaption></figure>

Step 4: On Borrow Screen (Each protocol will display different types of information) :

* Select the collateral token
* Enter the amount of collateral
* Enter the amount you want to borrow

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

* Click Borrow:
  * Note: Be cautious not to let the health factor value drop too low. Because The loan will be liquidated if the health factor reaches 1
* Sign the transaction on your wallet
  * ***Note: All transactions are built and interact directly with the smart contract of the protocol you select.***

Step 5: After the transaction is successfully signed:

* For Liqwid Protocol: You can modify the details of your borrow position right on the borrow list screen


# How to Repay a Loan?

* First, Let's connect your wallet!
* Step 1: Navigate to the Yield Aggregator menu
* Step 2: Choose the token you want to Repay and click on its Borrow APR.

<figure><img src="/files/bq1xE8SJ63OsDGqz8YAT" alt="" width="482"><figcaption></figcaption></figure>

* Step 3: On the Supply list, enable toggle My Borrow
* The screen only shows your borrow list.
* Choose the deal you want to repay tokens
* Click the Modify button on your selected deal.

<figure><img src="/files/V7oewD6PR5EuRVXlSYUk" alt="" width="494"><figcaption></figcaption></figure>

* Step 4: On Modify Screen (Each protocol will display different types of information) :you enter the details of the loan you want to retain:&#x20;
* Select the collateral token : You can keep the current one or choose a different token
* Update the collateral amount: you can keep it the same, increase, or decrease it
* Enter the amount you want to retain in the loan
  * If the amount you enter is greater than the current value of the loan: you are borrowing more.
  * If the amount you enter is less than the current value of the loan: you are repaying part of the loan.
  * If the amount you enter is 0: you are repaid everything.

<div><figure><img src="/files/OCZafoM8lD2rXVqNNdXJ" alt="" width="390"><figcaption></figcaption></figure> <figure><img src="/files/4gnAFNYdnlJrVgYeQBfO" alt="" width="391"><figcaption></figcaption></figure></div>

* Click Modify or Repay button:
  * Note: Be cautious not to let the health factor value drop too low. Because The loan will be liquidated if the health factor reaches 1
* Sign the transaction on your wallet
  * Note: ***All transactions are built and interact directly with the smart contract of the protocol you select.***


# Danogo Staking Bond


# How to Borrow ADA Staking Rights?

First, Let's connect your wallet!

Step 1: Navigate to the Borrow menu. Click on the Borrow ADA button

<figure><img src="/files/z7DnpUOzs0lZhyrECQPm" alt="" width="563"><figcaption></figcaption></figure>

Step 2: Configure the loan settings.

* The parameters that need configuration are
  * Volume
  * Duration
  * Borrow Interest Rate
  * Premium duration
    * Note: Note: Danogo will automatically calculate the premium amount (The initial interest amount that the borrower has to pay)
* Click Create Button

<figure><img src="/files/BCDWOhShJorXOOdx7jz1" alt="" width="563"><figcaption></figcaption></figure>

Step 3: Sign the transaction on your wallet

* After the transaction is completed, you will immediately receive Danogo Bond Borrow Token. This token is represented for your loan.
* The borrow request will be displayed on the Borrow screen

<div><figure><img src="/files/wFupIWTwzakB5aJblxFX" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="/files/CcHcLxK22egUzoPNhXOz" alt="" width="563"><figcaption></figcaption></figure></div>


# How to Provide Liquidity?

First, Let's connect your wallet!

You can provide liquidity in 2 ways:

* The first method is by creating a buy order (BID) with Bond type = Danogo Staking Bond.
* The second method is buying Danogo Staking Bond at the market price.

### Create a buy order : for details see the Danogo Dex guide

<div><figure><img src="/files/pMpGGurbiL5KVr6ok7ov" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="/files/FmjKp76QZpTLgkojoiC4" alt="" width="341"><figcaption></figcaption></figure> <figure><img src="/files/6oWQkYaGZzLbLeRNFDvC" alt="" width="563"><figcaption></figcaption></figure></div>

### Buy at market price: If you buy directly from the bond issuer, you don’t have to pay an order processing fee to Danogo For more detail, see Danogo Dex Guide

<figure><img src="/files/WkTLGlAO7bgeZDpIERhf" alt="" width="563"><figcaption></figcaption></figure>


# Danogo Bond Dex


# How to buy a Bond at Market price?

### Let's connect your wallet to the exchange!

### **Buy at market price:** Immediately **buy Bonds** from **the Sell Orders** on the exchange.

**Step 1:** Browse the list of available Sell orders on the exchange to find any attractive Yield Bids. A higher yield is good for the buyer -> Click on Ask Yield or Ask Volume of the "Ask" you want to purchase.

<figure><img src="/files/gwQ6aVLJIyxn3q7pDwRZ" alt="" width="289"><figcaption></figcaption></figure>

***Note***: This is NOT the Bond interest rate. This is the interest rate at which you are willing to buy the Bond. The higher the trading yield, the less ADA the buyer will pay!

**Step 2:** Set the amount you want to buy

* Danogo will automatically calculate the Bond price based on the desired Yield of the seller.
* Click on the Buy button.

<figure><img src="/files/KzHHqQcxNT4zMyiQ0YN6" alt="" width="290"><figcaption></figcaption></figure>

**Step 3:** Sign transaction on your Wallet.

<figure><img src="/files/qSeIfSYfaufryX28tPDK" alt="" width="290"><figcaption></figcaption></figure>

* After the transaction is completed, you will immediately received the purchased Bonds in your wallet. They will be displayed in the account screen at <https://app.danogo.io/account>


# How to buy a Bond at your desired price (create Buy order)

### Let's connect your wallet to the exchange!

### If there is no sell order with a suitable maturity and yield for you, or if you want to buy a large quantity of Bonds, please create a new Bid

**Step 1:** Click on +Bid button

<figure><img src="/files/4Q2uodgGg5GzZcXa1Ls5" alt="" width="288"><figcaption></figcaption></figure>

**Step 2:** Enter the parameters for your Bid order

* Choose your Maturity range: This is the range of Bond maturity that you want to buy, NOT related to Bond issuance time
* Enter your desired Yield rate: Danogo will prioritize bid with the LOWEST yield for the seller to see you Bidder should enter the lowest yield you are willing to buy the Bond
* Enter the amount of Bond Token you want to buy
* Danogo will calculate the Ada deposit amount for you. Danogo will hold your ADA deposit but **you will be able to keep ALL Staking Rewards until someone sell you a Bond**, at that point your ADA will be paid to seller and you will be earning higher yield from the Bond you purchase instead!
* Click Submit Bid

<figure><img src="/files/TzMrdDckMYYQ6NXYj6Xh" alt="" width="290"><figcaption></figcaption></figure>

**Step 3:** Sign on Your wallet

* When a seller agrees to sell you the Bond at your requested Yield, we will automatically transfer the Bond and leftover deposit back to your wallet

<figure><img src="/files/FGxhLQgoNz7pUPgSyesc" alt="" width="290"><figcaption></figcaption></figure>


# How to sell a Bond at Market price?

### Let's connect your wallet to the exchange !

### Sell immediately at market price by **matching** with the **Bid order** on the exchange

\
**Step 1:** Browse the list of available Bids on the exchange to find any attractive Yield Bids

<figure><img src="/files/7OfKaHGX6gvuifUXHjxG" alt="" width="290"><figcaption></figcaption></figure>

***Note***: This is NOT the Bond interest rate. This is the interest rate at which you are willing to sell the Bond. The lower the trading yield, the more ADA the seller will receive! A higher yield will attract buyers to help you sell your Bond faster, but you may receive fewer Ada coins

**Step 2:** Click on the desired Bid

* Set the amount you want to sell.
* Danogo will automatically calculate the Bond price based on the desired Yield of the buyer and the remaining maturity period

<figure><img src="/files/hZN9QkH4j2XKL5J26KKE" alt="" width="289"><figcaption></figcaption></figure>

**Step 3:** Sign on your Wallet

* After the transaction is completed, your Bonds will be transferred to the buyer, and you will immediately receive the corresponding amount of ADA for the Bonds you sold


# How to sell a Bond at your desired price? (create Sell order)

### Let's connect your wallet to the exchange !

### If there are no suitable Bid orders, you can list your Bonds on the exchange for the desired Yield amount

**Step 1:** Click on your wallet button to view List of your Bond holding <https://app.danogo.io/account>

<figure><img src="/files/Eo8oEpO1k9EOr3S91gaW" alt="" width="309"><figcaption></figcaption></figure>

**Step 2:** Click Button "List" next to the Bond you want to sell

<figure><img src="/files/LTJej0nYpy1rOKbbZNuB" alt="" width="309"><figcaption></figcaption></figure>

**Step 3:** Enter the parameters for your Listing order

* Set amount you want to sell
* Set the interest rate (yield) you want to sell in percentage (ex: 5.33%)

<figure><img src="/files/wzChTtypz1tulfnpekUL" alt="" width="310"><figcaption></figcaption></figure>

***Note***: This is NOT the Bond interest rate. This is the interest rate at which you are willing to sell the Bond. The lower the trading yield, the more ADA the seller will receive! A higher yield will attract buyers to help you sell your Bond faster, but you may receive fewer Ada coins

**Step 4:** Sign on your Wallet

* Danogo will automatically calculate Bond price daily, so sellers & buyers do not have to keep updating their listings prices. Danogo will prioritise display of Bond sale with highest offer interest rate first, so seller should try to offer the HIGHEST interest rate you are willing to sell your Bond

<figure><img src="/files/A8qXHlAIUE6H7WOuYDoK" alt="" width="311"><figcaption></figcaption></figure>


# How to update Sell order (Listing)?

### Users can update your Sell order at any time.

### Open Your order <https://app.danogo.io/account>

**Step 1:** Click on button "List" next to the Sell order you want to update

**Step 2:** Change the parameters on your Listing order -> click on Update -> then sign on your Wallet to approve this transaction.

**Note:** If you want to **cancel** your order, you can update the number of Bonds = 0<br>

<figure><img src="/files/J5ctsLPI3ixyMosBak02" alt="" width="308"><figcaption></figcaption></figure>


# Fixed Pool Lending


# How to Create a Pool

### Step 1: Connect Your Wallet

Open the app and click Connect Wallet.

Select the type of wallet you use. For example, if you're using Eternl Wallet, choose Eternl from the supported wallets list.

Confirm and connect your wallet to the platform to proceed.

### Step 2: Create a New Pool

1. After successfully connecting your wallet, select Create Pool on the main interface.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXd2DA-P33TKOSn_icitS5XiR0RK1UFvIjRnK2y22CpcIfhalUFWkvHZKJkYqY-YegmPXbi-OYW0wIwmqT29-_ihYaN0sYkTcq6hbFDRrWKUNDoq7II2uTF8TVzZs9c3a-ge8zzl?key=uUZN19F4shulBnjhlrulQA)

2. You will be redirected to the pool creation screen, where you can set up the parameters for your pool.

### Step 3: Choose Token

1. On the pool creation screen, find the Token Deposit section.
2. Choose the token you wish to deposit into the pool. For example, if you select Token ADA, simply choose and confirm.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeuvBQQYP2knRMD5KcUWRsL6TTG1em9Nnabv_KWdmBWPpeRaVGwk91nOklx9q1AtwNuXMJCtArjz9qg6KWZwc21o2_OqWULJhXaQQsuMUJWZVt5ZBFVeT94ttSMKupUpc-oS2Cs?key=uUZN19F4shulBnjhlrulQA)

### Step 4: Enter the Liquidity Amount

1. After select the token, you enter the amount to deposit.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfH7m_ObixoCEgW2Tb9Zf87CgWjXwPo09L5vZSMUsVdpDWxGDJ1gMfBCt0nFx502QdW_Gh7peUdNGGiPyBtNLx1cn1lkd9M367Wy1IHr8SH1XLkulftnntGFbL7CeYlSeRxNxbY?key=uUZN19F4shulBnjhlrulQA)

### Step 5: Select Maturity Date

2. After enter the amount, you will need to set the Maturity Date for your pool.
3. Note: The selected date must be later than today

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcMWwmZsszlpYbIdIGLVU_srP8cBVJv-9G5-tGzD8KmhJrGmumOsM39TCmjfRWmh8CUVxRI36QGkPSyx4SmODU3_f2Oy8sOjP1cidjGGC2NlV8hIUEzi_ZtJHgABVxA5PxxIKg?key=uUZN19F4shulBnjhlrulQA)

### Step 6: Choose Collateral and Liquidation Threshold

1. Next, you will need to select the Collateral. Click the Add Collateral button to choose your collateral token.\
   Note: You can add or remove collateral, but note that a maximum of 3 tokens can be added.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeS3TNeA8Ry2NfVr40uXBNodu4CQsmdkz8tGLuaNxHf2qIz_slVJMISUkDzEF4CuMjpSb1p6Tdn0tSoB8kpGfLLrpUs6CBNe-2Ih3Y3zKVbs586SH5i1j1Ov5evQdeaioEh7FS3?key=uUZN19F4shulBnjhlrulQA)

2. Set the Liquidation Threshold, which determines the point at which assets in the pool will be liquidated if their value falls below this level. If you're unsure about the Liquidation Threshold, you can click the "i" icon to learn more about what it means.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe68GqBYbWa24s3zYvSIH5sOWFsFj2WIzPVyx0XS9iR6dhaJgzTVxQAzeRaLelFTupZPQILybsbCOF5GF3g_uSieBiiYhr506d9UHex0FDESE0CUPjzdsETrvrwjHhf_PtnTQii?key=uUZN19F4shulBnjhlrulQA)

### Step 7: Set Pool Parameters

1. Max Loan Duration: Set the Maximum Loan Duration for loans in the pool. This defines the maximum time a borrower can use the funds from the pool.
2. Interest Rate Gradient: Set the Interest Rate Gradient, which controls how the interest rate changes over time, helping to manage rates based on market conditions.
3. Base Interest Rate: Set the Base Interest Rate, which is the starting interest rate for loans in the pool.

Click the "i" icon for more detailed information.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfYBm8BldvHW2_l8oMlyXuXci4MPviS8Tv0Dnfz3OF_QNMAt6LoqlAM-ulVk51PatxlM61nOd_Oiqy_kNZVHBH7olnY0M6TED9pZZ6KZ8O_XJiS9-oA8P0yYUt9-Tj6R1a_kio?key=uUZN19F4shulBnjhlrulQA)

### Step 8: Confirm and Create Pool

1. After setting up all the necessary parameters, you will see an overview of your pool setup.
2. Double-check all the information and click Create Pool to create the pool.
3. Confirm the transaction via your wallet and complete the pool creation process.
4. You will receive your Principle Token (PT) and Yield Token (YT) corresponded to your deposited liquidity.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfYIZv38N2locW4MkY9J6CS9uWO8nruxjlQO8GCgqaWEPhZVwDV_qKiKNXDYLCAiaA3Kj--sOfcQe_pXcSvfQHetJkA38PXHopFjyv7AxPGJDzhAeULolrSTqiQJ5nhCTBHslqa?key=uUZN19F4shulBnjhlrulQA)


# How to Create a Loan

### Step 1: Connect Your Wallet

1. Open the app and click Connect Wallet.
2. Select the type of wallet you use. For example, if you're using Eternl Wallet, choose Eternl from the supported wallet options.
3. Confirm and connect your wallet to the platform to proceed.

### Step 2: Choose Token to Borrow

1. Once your wallet is connected, you will be directed to the loan creation screen.
2. Select the Token you wish to borrow from the available options.

### Step 3: Choose Collateral Token, Fixed-Rate, and Loan Duration

1. First, select the Collateral Token you want to use, which will serve as the asset backing your loan. If using ADA as collateral, the borrower will retain ADA staking rewards and voting rights.
2. Next, choose the Loan Duration from the available options: 7 days, 30 days, 60 days or 90 days
3. Based on your selected collateral and loan duration, choose the corresponding Fixed-Rate. The available fixed rates will vary depending on both the collateral and loan duration selected.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcRGA2WS0jGNGommtj2vleSVme9sSFnZgtgCLuATqPDRs0lOX63qT26hgH_sqY5JUYVHFGooBVxp6SKikxsKlL-uRLk7F4pmIQqfdJq2daOWXZjzMV1K6rQvExShsaprEnoDD3DIg?key=uUZN19F4shulBnjhlrulQA)

### Step 4: Enter amount to borrow

1. Enter the amount of the selected token that you wish to borrow. Ensure that the amount is within the liquiditiy.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXchbtbTs3IdbQVDZ8PAcG7WcbqJadKLHQ-Nd7eHE886atpUclSj5cj5RdPOzU7PfBch8it7X2kSo46HUUK9ZuiG_jHkJELQ3MLyDyM3tB4X29h8k4ZhZKZyQIBLn1j3P8sVh2BNkA?key=uUZN19F4shulBnjhlrulQA)

### Step 5: Adjust Health Factor

1. Adjust the Health Factor, which reflects the ratio between your collateral and the loan amount. A higher health factor means less risk of liquidation.
2. The system automatically calculates the required collateral based on the HF you enter, so you cannot manually increase the collateral.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdCKs-0LBg-RKc5oOED_ZnzY3W2D4enpsnKTSx36oy6Yh7XJPE4EJHAKLRUVNMprWmvDXMJQR_nfZ1gqkd-OH9akTea2UlStsql3WuC13FSxTa0fkxiePFCLhERlqCMVZDFXO8N2A?key=uUZN19F4shulBnjhlrulQA)

### Step 6: Review Loan Summary

1. Once you have set all the parameters, you will see a summary of your loan details.
2. Review the information carefully, ensuring the loan amount, collateral, rate, and duration are correct.

### Step 7: Confirm and Sign

1. After reviewing your loan details, click Borrow.
2. Sign the transaction with your wallet to complete the loan creation process.

<img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXenLZMH8vSQYpMhkyxsBapJeScTJ7nwdhtqkTbgWl6jfk80RZjVFlGP7yW_SU8uVOPWRz-Wz2WDguxxjJvX5DCkM_-avOgLM-k41c9-Q1dr0DzC5VfdHKNZsdeLDO0P9PzRWARg5Q?key=uUZN19F4shulBnjhlrulQA" alt="" data-size="original">

<br>


# How To Repay a Loan

When your loan is close to or reaches its maturity date, you need to repay it to avoid liquidation and losing your collateral.

### Step 1: Go to My Account

1. Navigate to the Menu Fixed Rate Lending
2. Select My Account from the options.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXf_IFHzEZaVemPP9NrOwk2UkxZpRSGdlf2OIME-oa854xmeYY75lr4QOnARoAgtKF4TD4GVUkF2lPkknThbPPwmfGDaiVhITtpfQ9Y7uIR6S8Yz_cH3ZWjRUbduTgKdEUZST1qr?key=uUZN19F4shulBnjhlrulQA)

### Step 2: Select the Loan to Repay

1. In the My account screen, you will see a list of your active loans.
2. Choose the loan that you wish to repay.

### Step 3: Click Repay

1. Click on the Repay
2. This will initiate the loan repayment process.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe8gzZ8Ztcc38VAi9AOy5gtGGts6K1pLRGxg_tYFucEWOagnEBXn0y6Oxg_YfNNv-Iw3hyHqQqcRPTn8Ph_DZ3VRXf-OS0fikMyKyMRdfMw_c1Ki1GCNufoKN9nvwpDfg9wOg1r?key=uUZN19F4shulBnjhlrulQA)

### Step 4: Sign to Confirm

1. Sign the transaction through your wallet to complete the repayment.<br>


# Top-up Collateral

When your loan's Health Factor (HF) is low, you will need to top up additional collateral to keep your loan within a safe threshold and avoid liquidation.

### Step 1: Go to My Account

1. Navigate to the Menu Fixed Rate Lending
2. Select My Account from the options.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXf_IFHzEZaVemPP9NrOwk2UkxZpRSGdlf2OIME-oa854xmeYY75lr4QOnARoAgtKF4TD4GVUkF2lPkknThbPPwmfGDaiVhITtpfQ9Y7uIR6S8Yz_cH3ZWjRUbduTgKdEUZST1qr?key=uUZN19F4shulBnjhlrulQA)

### Step 2: Select the Loan to Top Up

1. In your account, find the loan that you need to modify.
2. Choose the loan with the low Health Factor (HF) that you wish to adjust.![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeNgnXBZv0r5yIJLTPaKmT38IuCl6apGHoJzd9bdykCQLNZBGN_-5YqEB-Tl9tdGt_m77Ke5dArSuBtlxwGuLWuAgKe4GgvuUNm5ZcKj-FJ6AM_ZRZKZ-noFWXB3GneAwXOZUBo?key=uUZN19F4shulBnjhlrulQA)

### Step 3: Add Collateral

1. You will be able to add more collateral to the loan, but you cannot reduce the existing collateral.
2. Select the token of collateral you want to add and enter the amount.

### Step 4: Review HF and Collateral Value

1. After adding collateral, review the updated Health Factor (HF) and the total collateral value.
2. Ensure that the HF is now within a safe range to avoid liquidation.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXd2xpTMnRVNCnO1HwUeaHuGlWtRuVl7ja1zOGhOEKuAcXornSIQjlFIWrmX6zCCwdd6frH9V_Y9NnzYkJoHtXrcgCedzP8fdoOMfPRDp_QcO0HyGFv8tsx6sXHJCACOYoEOxrc4?key=uUZN19F4shulBnjhlrulQA)

### Step 5: Sign to Confirm

1. Once you have reviewed the changes, click Topup.
2. Sign the transaction through your wallet to complete the modification.


# How To Redeem

When a pool reaches its maturity date, you can redeem your investment and earned interest using yT and pT.

### Step 1: Go to the Pool List

1. Navigate to the Menu Fixed Rate Lending
2. Select Fixed Term Deposit from the options. This will show you all your active pools.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdQEhZt05JfUdiUGbqCY-AnYleyedFPvWB8sguuirUFyEhP8mNP1vEAu1M1-fonmQJQp_ibIESdV1AcFzdCoIjxDDCXZF2Bi6_GDgrCetHwtmpg-jeNbidrdRCwF82c0jCmVRI?key=uUZN19F4shulBnjhlrulQA)

### Step 2: Select the Pool to Redeem

1. Find the pool that has reached its maturity date and from which you want to redeem your investment.
2. Click on the Redeem option to begin the redemption process.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcVGggbMsQ9NKZxnaZwbzB9jyoXBFnjXZg189oC8seUVhhufB4SumqOyOSQK5v86efrAL1x9LvCxMul_HhTarbZEr7zT9ifhku3dczb2E4XBw8gG3czRvo6rDIbxqPX6qtcwyff?key=uUZN19F4shulBnjhlrulQA)

### Step 3: Review Redemption Information

1. Review the information on the screen, including the amount you will receive and any other relevant details about your redemption.
2. Ensure everything is accurate before proceeding.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdfRRCzSQrTvgI6HfJqYSBN8W0KGEaydNq1L5YIncUPT8Yhj_1FfEHgUAGjCw4CeNnMDe4MvYgiR1F8H46aZnJ_Oe_nKTx2ILtnqH8pKXwyuWGfWCheNsWrfNFVfvbNboYHf3ID?key=uUZN19F4shulBnjhlrulQA)

#### Step 4: Sign to Confirm

1. Once you’ve reviewed the details, click Redeem.
2. Sign the transaction through your wallet to complete the redemption.


# How To Perform Mass Liquidation

When a loan is overdue or its Health Factor is ≤ 1, it becomes eligible for liquidation, which protects the lender’s funds by repaying the debt with the borrower’s collateral.

### Step 1: Access the Loan Liquidation List

1. Navigate to the Fixed Rate Lending menu.
2. Select Loan Liquidate from the options
3. You will see a list of loans eligible for liquidation.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfTkOHAjaH3IImIpzXxtFyLWMV3PDWJudK7brSvAhbw95FOu1c0fpvvWaBqqPcOdwA2AdH_mre70Uyid3xCGIOc6wAce4_yoQ9IJDFoQ6DRENkMfSV3CpqR95bnShTSgN8HnoUg?key=uUZN19F4shulBnjhlrulQA)

### Step 2: Select a Loan to Liquidate

1. Review the list and choose a loan based on the collateral you are willing to use.
2. Click the Liquidate button

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXc8HdKdmIbCO55WryLXEBa1MLRWzktObDG-8QaeGSo-BW5lh8krqts05b8hmwbKC5giUProU1zb5Lwjm_HS6AK39UuGNZgzD_NpN1ZuMTtpwm91H2e7ccq_3utVCsMvO7e08Kke?key=uUZN19F4shulBnjhlrulQA)

### &#x20;Step 3: Sign to Confirm

1. Once you’ve clicked Liquidate, a wallet prompt will appear.
2. Sign the transaction in your wallet to confirm and complete the liquidation.


# Flexible Pool Lending

###


# How To Supply Assets

Suppliers deposit assets into the Danogo Float pool to receive dTokens. Two supply transactions with different asset types are required.

### Step 1. Connect your wallet

1. Open the app and click Connect Wallet.
2. Select the type of wallet you use. For example, if you're using Eternl Wallet, choose Eternl from the supported wallets list.
3. Confirm and connect your wallet to the platform to proceed.

### Step 2. Select a token to supply:

1. On the [screen](https://preview.danogo.io/yield-aggregator), click on the “Supply APY” of the asset you want to supply to access the list of existing supply options for that token.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcgwVOM-5cIcEcwJTqtCja0b-yDR4qOH1WY5HvBI6E0i3SgnZMUaVBbdP9H218d8AkeJyMO5GWZmIlAIhHWaYSTVn1ioOMv8tzoHyvLkz2y44gB1jX4OLgOZzn7F4lzbkAzYUY2?key=uUZN19F4shulBnjhlrulQA)<br>

* On the supply option list screen, select Supply on Danogo Float.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdIGPxB9rid0kE_34GbVv6ASvgFTzm_DAABnEC_ujSdVjNlw3sA8Wp9l4j6PBAXiasQESdu1VtQABuFGF04VVwalZrAvQexDHPCH7IYqg70Bl05TJKBfcEWbsy50cEZJh73dgds?key=uUZN19F4shulBnjhlrulQA)

### Step 3. Enter Supply Amount.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXemEp1NvhCYOYgvlKaTH3jUX-lFqxts9IeV9gbfBv4_RA5wQ-cRkdLjaNRCwAt0DtAw37iNefhDuf_KdlrVWaoIoecMNPBQR9dwBgQuzr8xfifpqlK2s9nKFC1ZOliq251AaCxw?key=uUZN19F4shulBnjhlrulQA)

### Step 4. Confirm and Sign


# How To Withdraw Assets

Suppliers can withdraw assets from Danogo Float by returning dTokens for the equivalent amount, including interest. Partial or full withdrawals are each completed in a single transaction.

### Step 1: Connect your wallet

### Step 2: Select Token to Withdraw

* On the[ screen](https://preview.danogo.io/yield-aggregator), click "Supply APY" of the asset you want to withdraw.
* Select Withdraw on Danogo Float.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdIGPxB9rid0kE_34GbVv6ASvgFTzm_DAABnEC_ujSdVjNlw3sA8Wp9l4j6PBAXiasQESdu1VtQABuFGF04VVwalZrAvQexDHPCH7IYqg70Bl05TJKBfcEWbsy50cEZJh73dgds?key=uUZN19F4shulBnjhlrulQA)

### Step 3: Enter the withdrawal amount<br>

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdlYA3-E7k2TNit37Dq4j-_V3Tu06yDNT9hKfrkp33rDGmmp0v9_TiQsO036g_VaFwujGNcC-Dh2bHbufihBI1R9nOR808cDy1QSCwPMqTO8fFtLP9ZFEwUGlCwtt-MYdLyuzqj?key=uUZN19F4shulBnjhlrulQA)

### Step 4: Review Remaining Supply

### Step 5: Confirm & sign&#x20;


# How to Create Floating Interest Rate Loans

To borrow on Danogo, users must provide sufficient collateral—Tokens, qTokens, or dTokens. Borrowing requires one transaction without collateral and another with collateral supplied.

### Step 1: Connect your wallet

### Step 2: Choose a token to borrow

* On the [screen](https://preview.danogo.io/yield-aggregator), click on the “Borrow APR” of the asset you want to borrow.<br>

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcUTvFKscNeRPn13ZxKgNZEdS58rZEMBmHUya9WTTBiyihq1-xXPtQw456D9tT4CIttsVFKANdtLNcODwoTJ1C7CrHFbpfpGvnPErb87oCV0cD0Vjs-2Mld1V_3j-JGUc5qii9E?key=uUZN19F4shulBnjhlrulQA)<br>

* Select "Borrow" in Danogo Float

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXea7CsOlnRCX8W3K9q8UbxFG8oOoNB4YgnuvSqInyI1eVNcfeIFeYGUBmajYcHugFCTNVEcaxQCaLVvrDzN6i8VwDvgJcy453GMXK3q3_pEe9iMLfc3vlqx-rgB_fzD_dYhJ9I?key=uUZN19F4shulBnjhlrulQA)

### Step 3: Select and enter the collateral

* Choose collateral from the list of allowed tokens in your wallet. You can use up to a maximum of three types of collateral for each loan.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfALFMlPOwURlqCC6dv3suyoKkRuixTZCaKCaU-2H1OpC1BcL7LIVPF5PpFXeuH9PbPju6KbBMHZL5xLOf4VKPDVzcrzcqJkMuGNpfglZP8Z1JCwJV2pHg6d-8mTOHTK_dhJICF?key=uUZN19F4shulBnjhlrulQA)<br>

* Enter collateral amount

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeOgHaf7xjWhp8eaV9O476HawyBZxWR84MRB0BFnYzxbyq9GEGtvR3AcLzR-9Hxbkrn4Fwr6DpPFgYQvOidfJoHQFTc8lT-QIlvbpno-GK3mXvHz4JiOdorHzbwXiieVPJLIUJn?key=uUZN19F4shulBnjhlrulQA)

### Step 4: Supply collateral to earn interest. (If you do not choose to supply collateral, skip this step.)

* Check the “Supply collateral to earn interest” checkbox if you want to earn interest from your collateral. Make sure the entered collateral amount is at least the minimum required for a successful supply.<br>

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdQXnBS8E3lbPK0witUtVBJlhYm2I_vPQbLRG3jwojPeQpSRooeUecvmJe4oXuwMwUTOPA8GKo4B--LCz78u6KyuLCGFe7wbZlkF_3J0UcoEhAGrMLBwjK83vw_n_Fzh2FhEFXj?key=uUZN19F4shulBnjhlrulQA)

### Step 5: Enter the borrowed amount

* Enter the desired loan amount. The maximum borrowable asset amount is calculated based on the collateral entered above.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdtOfnMQI24iQC1MT0cUIRa2Kzv6MWrWoJTANPTAtqJhBfqm2Pr-f_mQvL4PoSZtOVNkhFE77bISYVuNt3XC-m6R8itwqTiTHVpGeenSUtlHFeFy-N29NZeK_psBdVicij1rYSI?key=uUZN19F4shulBnjhlrulQA)

### Step 6: Review the loan

* The system automatically calculates the Health Factor (HF) based on the entered collateral amount and borrow amount. Make sure HF > 1 to successfully create a loan.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcD2Ro77TTlHkZcenqKtq25CgCcow1ut3k_U5-4RwoKPucJwo9lxd9_cCbMdjV41__MTMiRAiqFWtHPHjlHVJ3uzJ5MoLGOySjBUuhUJjtkca5gj78b54o9JAWuHrn9UG0xfYE?key=uUZN19F4shulBnjhlrulQA)

### Step 7: Confirm & Sign


# How To Modify Loans

Borrowers can modify their loans by adjusting both the collateral and loan amounts. One transaction increases both, while another decreases both.

### Step 1: Connect your wallet&#x20;

### Step 2: Select the loan you want to modify.

* On the [screen](https://preview.danogo.io/yield-aggregator), click on the “Borrow APR” of the asset you want to modify.<br>

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcUTvFKscNeRPn13ZxKgNZEdS58rZEMBmHUya9WTTBiyihq1-xXPtQw456D9tT4CIttsVFKANdtLNcODwoTJ1C7CrHFbpfpGvnPErb87oCV0cD0Vjs-2Mld1V_3j-JGUc5qii9E?key=uUZN19F4shulBnjhlrulQA)<br>

* Select "Modify Loan" on Danogo Float.<br>

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeGi5H0p-2sb2NSq-p4cKorQkdX_oWJwRkTL9uy5vWbAdsDmNvpYXJqVyq8ApIzxedMZyet-owh9J5SB-a2yDdGGJfPXOBsszAXg1NI3CrU9xVZ-Pta8W6qowqgmgaF0581gSc?key=uUZN19F4shulBnjhlrulQA)

### Step 3: Update collateral

* Increase Collateral: You can increase the current collateral amount or add a new type of collateral (note that a maximum of 3 types of collateral can be selected).
* Decrease Collateral: You can reduce the collateral amount or completely withdraw one type of collateral. When withdrawing collateral from the loan, you can choose to receive it in one of three token types: the original token, qToken, or dToken.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcpWoQd7QUQi-6_UcMVtvBh0nxMbte24L-5Nu0vKj5JN7fMOujVSPZ1VJsfqcLP-eqTp2t4M2P6i3dJ5d8vfA8B3vlgp63kpmp9JTfsTdUpUU87JuYKMgN4SuDUjMrxAZ987dM?key=uUZN19F4shulBnjhlrulQA)

### Step 4: Update the Borrow amount

* Increase or decrease the borrow amount by adjusting the current loan value.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXd7nPKqwlF4Hjmrcf6YVYR1f-aegJ7J93q4JIUKBtXWHF5ckv2uX28L29KcywC6dfzLxLyg6I7eUhWI7odn76FFURU30sPHEc-w6l9KshMy2-FNi5h7BO9dPolH6oSD0UIqQe49?key=uUZN19F4shulBnjhlrulQA)&#x20;

### Step 5: Review the loan

* The system automatically calculates the Health Factor (HF) based on the entered collateral amount and borrow amount. Make sure HF > 1 to successfully modify the loan.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXc8-0QTjCKFKm5fGX1Ukr6fGNhWCB0lQFsS7KteKi3tYUE8Rr_SbvZG5hZkM_niTpw0aP-EoQgtmrIRb8xL5-47bx_KJJyA7xhgODia5nsmWF5RuNolNIdi_pcBUPmjP_CSfYn0?key=uUZN19F4shulBnjhlrulQA)

### Step 6: Confirm & Sign


# How To Repay Loan

Borrowers can fully repay their loan by setting the borrowed amount to zero in a single transaction.

### Step 1: Connect your wallet

1. Select the loan you want to repay.

* On the [screen](https://preview.danogo.io/yield-aggregator), click on the “Borrow APR” of the asset you want to repay.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcUTvFKscNeRPn13ZxKgNZEdS58rZEMBmHUya9WTTBiyihq1-xXPtQw456D9tT4CIttsVFKANdtLNcODwoTJ1C7CrHFbpfpGvnPErb87oCV0cD0Vjs-2Mld1V_3j-JGUc5qii9E?key=uUZN19F4shulBnjhlrulQA)

* Select "Modify Loan" on Danogo Float.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeGi5H0p-2sb2NSq-p4cKorQkdX_oWJwRkTL9uy5vWbAdsDmNvpYXJqVyq8ApIzxedMZyet-owh9J5SB-a2yDdGGJfPXOBsszAXg1NI3CrU9xVZ-Pta8W6qowqgmgaF0581gSc?key=uUZN19F4shulBnjhlrulQA)

### Step 2: Repay all loans

* Update the borrow amount to 0.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXddIRphAbTif2QfJzFOAlfqb6K3fo8UkNoeqLoTGb3tUUQn4NAsB_BVsS2Fyh8-ULaid1RsvxhFjTBnK7LXSpopNB9KRf_MkaYZ1gzIBvMoUckbU6TjNCXN3CCSUZLQD4ujlvo?key=uUZN19F4shulBnjhlrulQA)

### Step 3: Review the loan

* The system updates the Debt to 0 and displays the “Repay All” button.

### Step 4: Confirm & Sign


# Leverage Trading

### What is Leverage Trading?

Leverage Trading allows traders to borrow funds (leverage) to open positions larger than their own capital. This means:

* You can amplify profits if the market moves in your favor.
* You can take long positions (betting the price will go up) or short positions (betting the price will go down).
* You don’t need to hold the underlying asset to speculate on its price.
* You can use leverage to take advantage of market volatility.

### Benefits

* Amplified returns: Trade larger positions with less upfront capital.
* Short selling: Earn profits when markets decline.
* Efficient capital use: Keep more of your funds available while still trading at scale.
* Risk management: When used carefully (moderate leverage, diversification), leverage can help hedge other positions.

### Risks

* Liquidation risk: If your margin falls below the maintenance requirement, your position can be liquidated.
* Magnified losses: Losses grow as fast as profits when the market moves against you.
* Interest & funding costs: Holding leveraged positions often requires paying interest on borrowed funds or periodic funding rates.
* Market liquidity risk: In volatile markets, spreads can widen and execution may be less favorable.
* Complexity: Requires strong understanding of margin, fees, and collateral mechanics.

### Assets and Collateral

Collateral requirement: You must deposit collateral to open and maintain leveraged positions.

Margin usage: Collateral determines your initial margin (to open) and maintenance margin (to keep the position open).

Fee payments: Fees, interest, and funding costs may be deducted directly from collateral

Accepted assets: Danogo defines which tokens can be used as collateral (commonly stablecoins and major tokens).


# How to Open Position

1. Go to mainscreen: <https://app.danogo.io/leverage-trading>
2. Connect wallet
   * Click on button Connect Wallet
   * On popup Connect Wallet, click on chosen wallet

     * The system only displays wallets for which you have installed the plugin.
     *

     ```
     <figure><img src="/files/70PvXuQMhramnOsIQL7Y" alt=""><figcaption></figcaption></figure>
     ```
3. Choose Pair to trading

   * Click on the trading pair which you want to trade
   *

   ```
   <figure><img src="/files/u2XjP0pC5i50wUUI0EaR" alt=""><figcaption></figcaption></figure>
   ```
4. On the right panel, input position Information
   \*

   ```
   <figure><img src="/files/wfISw5lW2Us3ouaWR3Zh" alt=""><figcaption></figcaption></figure>
   ```

   * Select position type : Long/Short
   * Choose deposit token:
     * Click on icon dropdown to change deposit token
     * On popup, choose token
       \*

       ```
       <figure><img src="/files/29stRg7vCDv7MxFwrI9R" alt=""><figcaption></figcaption></figure>
       ```
   * Input collateral amount
   * Choose leverage
   * Check Position information and click on Open Long/Short
     \*

     ```
     <figure><img src="/files/3iB8G9ccNkfQdJk0nmjD" alt=""><figcaption></figcaption></figure>
     ```
   * Sign the transaction

Video guide:

{% embed url="<https://youtu.be/j3-vQthoejU?si=VEwpdGp1O_bbJ6OA>" %}


# How to Close Position

1. Go to main screen: <https://app.danogo.io/leverage-trading>
   \*

   ```
   <figure><img src="/files/OaM6rrx6BsPC0UDDdNtw" alt=""><figcaption></figcaption></figure>
   ```
2. Connect wallet (If not connected)
3. On position list, select position that you want to close
4. Click Close button
5. Sign the transaction


# Video Guides

## Buy & Sell Optim Bonds on Danogo

Got Optim bonds you need to liquidate and trade? Looking for boosted return on your ADA?

**Key Highlights**

* How Optim Finance is empowering small stake pool operators
* The benefits of delegating ADA to a stake pool for ISPOs
* A look at Danogo's marketplace: the solution for peer-to-peer bond trading

{% embed url="<https://www.youtube.com/watch?t=4s&v=-FfKZx25k2w>" %}
Thanks to [Pete | Cardano ₳mbassador, SPO, YTer](https://twitter.com/astroboysoup)
{% endembed %}

## DeFi | Danogo: Optim Finance Bond Secondary Market

Danogo is a platform that enables the secondary market for Optim Finance bonds. This means buying and selling bonds issued by SPOs with a higher yield than traditional staking provides.

{% embed url="<https://www.youtube.com/watch?v=plOR251d4yY>" %}
Thanks to [Martin | Latin Stake Pools | ITZA](https://twitter.com/LatinStakePools)
{% endembed %}

## DeFi | Danogo: How to Open or Close a Leverage Trading Position

{% embed url="<https://youtu.be/j3-vQthoejU?si=VEwpdGp1O_bbJ6OA>" %}


# FAQ

##

<br>


# Danogo Dex

## **Can I make 10x or 100x investing in Bond?**

No, it is very unlikely you will make that kind of return investing in Bond. Fixed Income investment (Bond) is meant to be safe, where you will **NOT** lose your capital, but you will also make a lower return! Investing in Optim Bond is like buying government treasuries, which is very safe and there is **NO** chance of default, the only risk you have is Smart Contract risk where hackers can drain the smart contract.

## **Who should invest in Bond?**

Bonds are meant to be SAFE investment that is Capital Protected, that means you will NEVER lose your capital. So Bonds are for low risk investors who do not expect 10x or 100x return.

Typical portfolio allocation, most investors will put the bulk of their assets in Bonds, where your capital is protected and only allocate 20% to 40% into high risk investments like Altcoins where you can lose all your capital!

## **Should I buy Bonds on Danogo or Optim site?**

There are trade-offs for buying on each site. To buy a Bond on Optim, you have to deposit Ada into a lending Pool waiting for the Pool to be filled. Sometimes, it takes weeks or months for a Pool to be filled and you will NOT earn any staking rewards while waiting in the Pool. The best time to buy Bond on Optim site is when the Pool is about to be filled, so you have to keep watching the Pool. Sometimes pools with high yield fill up really fast and you miss the chance to buy altogether.

On Danogo, you put in a Buy order, you deposit Ada but retain all your staking right and still earn your staking rewards until you receive the Bond. Thus, if you do not have free time to keep monitoring Optim Pools, you can simply enter your target yield on Danogo site & wait for someone to sell you the Bond. So in this case, you might not get the Highest yield possible but you dont have to spend time watching market all the time too!

On Optim site, you can only subscribe for Bond with fixed duration, 3, 6 or 12 months. So if you want to invest in a different time frame then you have to buy on Danogo.

## **I am new to Bond trading, how do I learn with minimal risk?**

The best way to learn is by trying.

To reduce risk, you should try buying a SHORT duration bond on Danogo, that will mature in 2-8 weeks, as long as the yield you buy is above 3.5%, it is higher than what you get for Staking then it is a good deal! You can wait a few weeks till the bond matures, then redeem at Optim site, just like a normal Fixed Deposit at your TradFi Bank!

## **Should I sell my Bonds on Danogo or on Optim?**

You can only redeem your Optim Bonds for Ada at the Bond maturity on Optim site. So if you need Ada earlier, you will have to sell on Danogo.

Beside that, if you want to change your investment strategy to hold a different Bond duration. Like you bought 3-months Bond A at 5.33% a 4 weeks ago, there is a new 12-months Bond B at 6.5% available, and you dont need your Ada in the next 6 months, it is better to sell off your 3-month Bond A at 6% then buy the 12-month Bond B at 6.5% to get better return. You can only do this on Danogo site.

## **Is Danogo smart contract accurate and rug-free?**

Danogo smart contract is open-source, guaranteeing transparency and can be verified by anyone for its accuracy. By enabling instant swaps in the same Cardano transaction, Danogo smart contract ensures that there is NO risk when buying or selling on the platform. So once the transaction completes, everything is in your wallet.

On the other hand, when bidding or listing, there's still risk because you will have to deposit your asset. But don't worry, Danogo has been verified very carefully to mitigate this. And the community helps too. Anyone can actively verify the smart contract's integrity at any time to make sure everything's okay and keep the platform safe via this [link: https://github.com/Danogo2023/bonds-dex.](https://github.com/Danogo2023/bonds-dex)

<br>

<br>


# Danogo Staking Bond

## **What is Danogo Staking Bond?**

A Danogo Staking Bond is a loan agreement for non-custodial lending of staking rights to Borrowers. A smart contract locks lender’s ADA and allows a borrower to attach their stake key for a specified duration as long as conditions are met (interest paid)

## **What is a borrow request?**

A Borrow Request is a Borrow Offer that is still waiting for lenders to provide liquidity

A Borrow Request is the set of conditions (duration, volume, and interest rate) for a loan that the borrower agrees to when issuing a bond.

## **What are Danogo Staking Bond Tokens?**

Danogo Bond Tokens are tokens representing a lender’s fractional position in a bond loan. At maturity, they can be swapped for the original ADA plus all accrued interest. Each bond token is worth 100 ADA.<br>

## **What are Danogo Bond Borrower Tokens?**

Danogo Bond Borrower Tokens are tokens representing a borrower’s fractional position of a bond loan. They can be used to change stake key attached to the loan

## **When are Danogo Bond Tokens issued?**

Danogo Bond tokens are issued instantly upon liquidity provision by lenders, even for partial matches, eliminating the need to wait for loans to be fully filled

## **Why do the borrower have to pay a premium when creating a borrow request?**

Premium is the initial interest amount , min ADA and processing fee for seeking available liquidity, paid when a borrow request is issued.

This upfront interest is intended to ensure that when the loan request is provided liquidity, the created bond will have enough interest to stay above the Interest Buffer minimum threshold

## **Can I change the borrow request?**

A Borrow Request can be canceled anytime after it has been created and the borrow volume has not been fully disbursed. Only borrower can cancel their borrow request

Borrower also can change stake key attach to the borrow request

## **Can I repay interest in installments?**

Yes. For bonds with durations greater than 10 epochs, borrowers may repay a minimum initial interest payment of 10 epochs, while the remaining interest can be paid later. However, the borrower must maintain a minimum interest buffer of 6 epochs. If not, the bond will incur a penalty

## **Is there a penalty for a bond closing before maturity?**

When the bond fails to maintain the Interest Buffer above the minimum threshold, it can be closed immediately.

At redemption, the lender may receive additional interest for up to 6 epochs of Interest Buffer and regain the original ADA immediately

## **What is an Interest Buffer (or Minimum Interest Buffer)?**

Minimum Interest Buffer is the minimum amount of interest that must be kept in the bond at all times. If the interest buffer is not maintained, the ADA in the smart contract is no longer locked and the lender can redeem it, at which point the borrower loses the ability to attach their stake key

## **When can a bond be canceled/closed?**

An Active bond can be closed if the borrower does not fulfill the bond's terms by failing to provide adequate interest to maintain the Interest Buffer above the minimum threshold (6 epochs).

An active bond can also be closed once it reaches maturity.

Detailed instructions to redeem closable bonds: [link](https://danogo.io/text-guide-bond)

## **How do I exchange Bond Tokens for underlying ADA plus interest at maturity?**

You redeem ADA by clicking the gift icon button on bond info at “[Danogo.io](http://danogo.io/) -> My Account -> My Bond” . This icon is only visible when bond is closable


# Yield Aggregator

## **What is Yield Aggregator?**

We aggregate data on borrowing and lending deals from the Smart Contracts of various Lending Protocols.

Our platform organizes and sorts this information to display the best available interest rates, helping you make informed decisions easily and efficiently.

## **Is it safe to perform transactions on Yield Aggregator?**

Transactions on Yield Aggregator are safe. All transactions are built and interact directly with the Smart Contract of the protocol you choose.

The transactions you perform on the Yield Aggregator platform can be viewed on the Smart Contract of the corresponding protocol, and vice versa.

## **What can I do with Yield Aggregator?**

With Yield Aggregator, you can supply assets to earn interest or borrow funds against your collateral.

You can withdraw your supplied assets anytime or modify/repay your loan. Any actions you take on the protocol’s DApp are also synced back to Yield Aggregator, ensuring seamless integration.

## **Do the Supply APY and Borrow APR change when I supply or borrow?**

It depends on the protocol you choose.

In some lending protocols (such as Liqwid, Lenfi), the Supply APY and Borrow APR change based on the balance between the amount of assets supplied and the amount borrowed, known as the utilization rate:

* This rate is dynamic and can adjust over time based on the overall supply and borrow within the lending protocol. As more people supply or borrow assets, the rates are updated to reflect the current market conditions.

For other protocols (such as Danogo, Optim, etc.), the supply APY and borrow APR will be fixed after you supply/borrow.

## **What is the health factor?**

The health factor is a measure of how safe your loan is compared to the collateral you have provided.

* High health factor: Your loan is safe, with a low risk of being liquidated.
* Low health factor: Your loan is at higher risk; if the value of your collateral decreases or your loan amount increases, you could be liquidated.
  * Most lending protocols start liquidation when the health factor reaches 1.

Simply put, keeping a high health factor helps you avoid losing your collateral when the market fluctuates.


# Fixed Pool Lending

## I got an error when building the loan liquidation.

1. ### <sup>What does “Transaction is outside of its validity interval. Please try again.” mean?</sup>

   ### <sup>The epoch duration on testnet is shorter than on mainnet. If your transaction was built during the transition between epochs, it may be considered "outside of range." Please try again in a few minutes.</sup>
2. ### <sup>What does “Evaluate Failed: Someone just swiped your UTXO! Hurry up & retry before it happens again!” mean ?</sup>

   ### <sup>This means someone else has already completed the transaction you were trying to perform (e.g., a liquidation), and they got there first. Please reload the loan list and try again with a different loan</sup>
3. ### <sup>I got “Evaluate Failed: Someone just swiped your UTXO!” and it keeps happening even after trying other loans — what should I do?</sup>

   ### <sup>This issue might be caused by your wallet extension not syncing properly. Try the following steps:</sup>

   **Step 1**: Disconnect your wallet from Danogo\
   **Step 2**: Open your wallet extension and refresh or sync the wallet (e.g., in Eternl, click the refresh icon to resync UTXOs)\
   **Step 3**: Reconnect your wallet to Danogo\
   **Step 4**: Try the liquidation again\
   \
   This usually resolves UTXO desync errors caused by wallet extensions.

## What does “Evaluate Failed: Not enough tokens to liquidate” mean?

This means your wallet doesn’t have enough tokens required to perform a liquidation. Please faucet more tokens at: <https://preview.danogo.io/testnet-faucet>

Note: You can only faucet once every 24 hours.\
If you’ve hit the limit, consider using a different wallet to faucet and send tokens to your current test wallet.

## What does “Evaluate Failed: Loan was liquidated” mean?

This message appears when multiple users try to liquidate the same loan at the same time, but someone else has completed the action before you.

&#x20;The loan has already been liquidated by another user. Please reload the loan list and try again with a different loan

## Why do I see “User declined to sign the transaction” when using the Eternl wallet?&#x20;

This issue may occur because Eternl (version v2.0.5.6) sometimes opens the signing tab in a new browser window, which can lead to errors or failed signing.

To avoid this issue, we recommend switching to the Lace wallet for a smoother experience.

Note: If you use a new wallet with a different address from your original one, don’t forget to re-register your new wallet using [\[this form\]](https://docs.google.com/forms/d/e/1FAIpQLSfCMDoeWJkfNBSp3jfa8xVw_qN2qVnswLjzUIfkkT6FyBfr5w/viewform?usp=sharing).

This ensures we can accurately track your testnet progress and rewards.

## When I try to liquidate, it just keeps loading and the wallet signing popup never appears, what should I do?&#x20;

This issue is commonly reported when using Eternl wallet version v2.0.5.6. The transaction appears to be stuck at the loading stage, and the signing window never shows up

To avoid this issue, we recommend switching to the Lace wallet for a smoother experience.

Note: If you use a new wallet with a different address from your original one, don’t forget to re-register your new wallet using [\[this form\]](https://docs.google.com/forms/d/e/1FAIpQLSfCMDoeWJkfNBSp3jfa8xVw_qN2qVnswLjzUIfkkT6FyBfr5w/viewform?usp=sharing).

This ensures we can accurately track your testnet progress and rewards.

## How can I liquidate a loan?

When a loan becomes overdue or its Health Factor is less than or equal to 1, it becomes eligible for liquidation.\
Liquidation helps protect the lender’s funds by repaying the loan using the borrower’s collateral.

\
**Step 1:** Access the Loan Liquidation List

* Go to the Fixed Rate Lending menu
* Select Loan Liquidation
* You'll see a list of loans eligible for liquidation

**Step 2:** Select a Loan to Liquidate

* Review the list and choose a loan you want to liquidate
* Click the Liquidate button

**Step 3:** Sign to Confirm

* A wallet pop-up will appear
* Sign the transaction to complete the liquidation

## How can I create a fixed-rate loan?

**Step 1:** Choose a Token to Borrow\
Once your wallet is connected, you will be directed to the Loan Creation screen.

* Select the token you want to borrow from the available list.

**Step 2:** Choose Collateral Token, Fixed Rate, and Loan Duration

* Select the Collateral Token you will use to back your loan. Choose the Loan Duration from the available options.
* Based on your selected collateral and duration, choose a corresponding Fixed Interest Rate.

**Step 3**: Enter the Borrow Amount

* Enter the amount of tokens you wish to borrow.
* Make sure it does not exceed the pool’s available liquidity.

**Step 4**: Adjust Health Factor (HF)

* Set your desired Health Factor, which affects how much collateral is required.A higher HF = lower liquidation risk.
* The required collateral will be auto-calculated based on your HF.\
  You cannot manually increase collateral beyond what is required for the selected HF.

**Step 5**: Confirm and Sign

* Click the Borrow button\
  Sign the transaction in your wallet to confirm and create the loan

## How can I top up my loan?

Topping up your loan allows you to increase your collateral to maintain a safe Health Factor and avoid liquidation.

**Step 1**: Go to My Account

* Navigate to the Fixed Rate Lending menu
* Select My Account from the options

**Step 2**: Select the Loan to Top Up

* In your account dashboard, locate the loan you want to modify
* Choose the one with a low Health Factor (HF) that needs adjustment

**Step 3**: Add Collateral

* You can add more collateral, but you cannot remove existing collateral
* Select the collateral token and enter the amount you want to add

**Step 4**: Review HF and Collateral Value

* After entering the top-up amount, review the updated Health Factor and total collateral value
* Ensure the new HF is within a safe range to avoid liquidation

**Step 5**: Sign to Confirm

* Click Top Up
* Sign the transaction in your wallet to confirm and apply the changes

## If I use ADA as collateral, will I still receive staking rewards?

Yes! If you use ADA as collateral, you still:

* Receive staking rewards as usual
* Retain your voting rights in Cardano governance

\
\ <br>

<br>

<br>

<br>


# Leverage Trading

1. ### What is the difference between spot trading and leverage trading?

→ Spot trading means buying/selling assets you actually own. Leverage trading means borrowing funds to amplify your exposure to price movements without directly owning the full amount of the asset.

2. ### Do I need to own the asset to short it?

→ No. Danogo allows you to open short positions without holding the underlying asset.

3. ### How much capital do I need to start trading with leverage on Danogo?

It depends on the leverage you choose and the asset you trade. Danogo displays the required initial margin before you open a position.<br>

4. ### What is the maximum leverage supported?

→ Maximum leverage varies per market and asset. Check directly in the Danogo app for the latest leverage limits.<br>

5. ### What assets can be used as collateral?

→ Typically stablecoins (like USDM, USDA) and major assets approved by Danogo. Always confirm in the interface for the current collateral list.

6. ### Can I change or add collateral after opening a position?

→ For now, no. This feature will be added in near future

7. ### How can I avoid liquidation?

→ Use moderate leverage, monitor your margin closely, and avoid oversized positions compared to your collateral.

8. ### What happens to my collateral if I get liquidated?

→  Collateral will be sold to cover your losses. You may lose all collateral tied to the position. However, if after repaying the loan there is any remaining collateral left, you will be able to withdraw the remaining collateral.

9. ### How is the liquidation price calculated?

→ It depends on your entry price, leverage, and collateral. Danogo displays the estimated liquidation price before you confirm a trade.

10. ### Can I set stop-loss and take-profit orders?

→ For now, no. This feature will be added in near future

11. ### How are funding rates applied?

→ The funding rate represents the interest cost of the borrowed funds used to open a leveraged position. This rate is dynamic and changes based on the borrowing interest rate of the underlying lending pool.

12. ### Are there overnight fees?

→ Yes. These are the funding costs, which represent the interest on the borrowed funds. The interest is accrued continuously from the moment you open the position until you close it

13. ### What fees will I pay?

→ Trading fees (position open/close fees), interest on borrowed funds

14. ### Is Danogo non-custodial?

→ Yes. Positions and collateral are managed on-chain through Cardano smart contracts. Users retain control of their funds, subject to protocol rules.

15. ### Can Danogo go offline? What happens if the app is down?

→ If the web app is unavailable, positions remain live on-chain. Orders and liquidations continue to function via smart contracts.

16. ### What should I do if I experience a liquidation but think it was incorrect?

→ You can review transaction details on-chain. If you believe there was a system error, you may contact support, but liquidations executed on-chain are typically final

17. ### Can I keep a leveraged position open long term?

→ Yes, but you’ll be subject to funding fees and interest. These costs can accumulate, so it’s important to calculate the impact before holding long-term positions.

<br>


# User Case


# Going Long (betting the price will rise)

**Example:  If you believe ADA will increase from $0.40 to $0.60 after a major upgrade:**

* Instead of buying ADA with $100 directly, you use 5x leverage.
* You deposit $100 as collateral, borrow $400 from the pool, and open a $500 ADA position.
* If ADA rises 50%, your position becomes $750. After repaying the $400 loan + interest, you keep \~$350. Profit is 3.5x higher than just holding spot ADA.
* Use Case: Amplify upside when you have high conviction in bullish market moves.

<br>


# Going Short (betting the price will fall)

**Example: You expect BTC to drop from $65,000 to $60,000 after negative macroeconomic news.**

* You deposit $1,000 as collateral and use 3x leverage.
* Danogo borrows BTC on your behalf, swaps it into stablecoins, and locks those as collateral.
* If BTC falls, you buy it back cheaper to repay the loan, keeping the difference as profit.
* Use Case: Hedge against portfolio downside or profit from bearish market trends.


# Integration

To accelerate adoption and ecosystem growth, **Danogo is open to integrations** from developers, platforms, wallets, dApps, and ecosystem partners. Whether you’re building a frontend for lending, a yield optimizer, or a dashboard, we offer **flexible integration options** via APIs and SDKs.

### ⚙️ Integration Options

#### 🔗 **RESTful APIs**

Danogo offers public and secure API endpoints that support for different use cases such as:

* Get List of Pools to show on an aggregator&#x20;
* Create a Loan
* ...

### 🧪 **Testnet Access**

We provide a full **Preview Testnet** environment for development and simulation:

* Use test ADA and stablecoins (USDM, DJED, etc.)
* Simulate borrowing, lending
* View contract behavior and tx structure

**Testnet portal:** <https://preview.danogo.io>

### 🤝 Ideal Integration Partners

* **Wallets**: Add fixed lending as a native feature
* **DEXs**: Integrate lending and borrowing layers
* **Yield aggregators**: Optimize across Danogo pools
* **dApps**: Plug into composable financial primitives


# Guide to Build Transaction Create Fixed Loan

## Purpose

Guide on how to Build Transaction Create Fixed Rate Loan based on Danogo APIs&#x20;

## Steps to Build Transaction Create Loan

### Step 1: Get Required Parameters

Use the API to get necessary parameters for Create Loan.

### Step 2: **Understand Redeemer Structure**:

#### Fixed LendingAction Redeemer Structure

* LendingAction redeemer structure for Create Loan:

```
pub type LendingAction {
  indexers: RedeemerIndexer,
  pool_in_idx: Int, // Required
  loan_in_idx: Int, // Optional
  protocol_script_idx: Int, // Required
  protocol_config_idx: Int, // Required
  fee_ou_idx: Int, // Required if fee > 0
}

pub type RedeemerIndexer {
  CreatePool{..}
  RedeemPool{..}
  CreateLoan { pool_ou_idx: Int, loan_ou_idx: Int }
  ...
}
```

* Specific example for Create Loan:

```
LendingAction {
  indexers: CreateLoan { pool_ou_idx: 1, loan_ou_idx: 2 },
  pool_in_idx: 0,
  loan_in_idx: -1,
  protocol_script_idx: 1,
  protocol_config_idx: 2,
  fee_ou_idx: 0,
}
```

* Diagnostic Notation form:

```
121([_ 123([_ 1, 2]), 0, -1, 1, 2, 0])
```

#### Leverage LendingAction Redeemer Structure

* LendingAction redeemer structure for Topup Withdraw:

```
pub type LendingAction {
  CreatePool {..}
  UpdateMarketParam {..}
  TopupWithdraw { protocol_cfg_ref_idx: Int, pools: List<PoolMarketIndexer> }
  ...
}

pub type PoolMarketIndexer {
  pool_out_idx: Int,
  fee_out_idx: Option<Int>,
  market_ref_idx: Int,
}
```

* Specific example for Topup Withdraw:

```
TopupWithdraw {
  protocol_cfg_ref_idx: 0,
  pools: [
    PoolMarketIndexer {
      pool_out_idx: 0,
      market_ref_idx: 1,
      fee_out_idx: None,
    },
  ],
}
```

* Diagnostic Notation form:

```
123([_ 0, [_ 121([_ 0, 122([]), 1])]])
```

#### Staking Contract StakingContractAction Redeemer Structure

* StakingContractAction redeemer structure for Topup Withdraw Staking:

```
pub type StakingContractAction {
  CreateContract {..}
  TopupWithdrawStaking(Int) // staking contract out_idx
  ...
}
```

* Specific example for Topup Withdraw Staking:

```
TopupWithdrawStaking(0)
```

* Diagnostic Notation form:

```
122([_ 0])
```

#### OraclePriceCalcRdmr Redeemer Structure

* OraclePriceCalcRdmr redeemer structure:

```
pub type OraclePriceCalcRdmr {
  global_config_idx: Int,
  oracle_path_idxs: List<Int>,
  oracle_idxs: List<(UTxOTarget, OracleUtxoType, Int)>,
  prices: OraclePriceInfo,
  borrow_rates: Pairs<YieldToken, Basis>,
}

pub type UTxOTarget {
  Ref
  Out
  In
}

pub type OracleUtxoType {
  TOrcfaxFsp
  TOrcfaxFs
  TLiqwidMarketState
  TLiqwidMarketParam
  TLiqwidOracleV2
  TDanogoPool
  TIndigo
  TDjed
  TDanogoStaking
  TMinswapLP
  TLiqwidOracleV1
  TSplashLiquidityPoolCpammG1
  TSplashLiquidityPoolCpammG2
  TSplashLiquidityPoolCpammG3
  TSplashLiquidityPoolStable
  TCharli3
  TMinswapLPStable
}

// Pairs<ToToken, Pairs<FromToken, PRational>>,
pub type OraclePriceInfo =
  Pairs<TupleAsset, Pairs<TupleAsset, (CalcType, PRational)>>

// 0: Normal
// 1: Splash
pub type CalcType =
  Int
```

* Specific example:

```
OraclePriceCalcRdmr {
  global_config_idx: 3,
  oracle_path_idxs: [2],
  oracle_idxs: [(Ref, TLiqwidMarketState, 1), (Ref, TLiqwidMarketParam, 0)],
  // Price from qdjed to djed
  prices: [Pair(djed, [Pair(qdjed, (0, PRational(3, 5)))])],
  borrow_rates: [Pair(qdjed, 663)],
}
```

* Diagnostic Notation form:

```
121([_
    3,
    [_ 2],
    [_
        [_ 121([]), 123([]), 1],
        [_ 121([]), 124([]), 0],
    ],
    {_
        [_
            h'919d4c2c9455016289341b1a14dedf697687af31751170d56a31466e',
            h'74444a4544',
        ]: {_
            [_
                h'6f262e859569d245aab15265a902dccf33f790a57227ea30edbbdef4',
                h'',
            ]: [_ 0, 121([_ 3, 5])],
        },
    },
    {_
        [_
            h'6f262e859569d245aab15265a902dccf33f790a57227ea30edbbdef4',
            h'',
        ]: 663,
    },
])
```

### Step 3: **Create Transaction**:

Use the obtained parameters to create transaction for fixed loan.

1. **Validity range**: Set validity range for transaction
   * Ensure time to live <= 6 minutes.
2. **Input**:

* Note: Information like `outRef`, `address`, `coin`, `multiAssets` are fully returned from API.
  * PoolInUtxo: Pool you want to borrow from.
    * Spend redeemer: Build according to Fixed LendingAction redeemer CreateLoan structure, ensure correct index specification.
  * leveragePoolInUtxo: Leverage pool to withdraw base token for lending, returned from API.
    * Spend redeemer: Build according to Leverage LendingAction redeemer TopupWithdraw structure, ensure correct index specification.
  * stakingContractInUtxo: Staking Contract pool to withdraw base token for lending, returned from API.
    * Spend redeemer: Build according to StakingContractAction redeemer TopupWithdrawStaking structure, ensure correct index specification.
  * Input from wallet containing tokens needed as collateral for the loan.

3. **Output**:
   * PoolOutUtxo: Pool output after borrowing.
     * Pool output UTxO information is fully returned from API.
   * LoanOutUtxo: Loan output.
     * Loan output UTxO information is returned from API, except for `loanMaturity`.
       * `loanMaturity`: Loan maturity time. Calculated as lower bound + loanDuration in milliseconds.
     * **Note**:
       * Address returned from API only includes loan script payment key, if you want to receive rewards from loan when delegating to pool, need to specify borrower's stake key for loan address.
   * FeeOutUtxo: Transaction fee output.
     * Fee output UTxO information is fully returned from API.
     * No need to create output if not returned by API.
   * leveragePoolOutUtxo: Leverage output after withdrawing base token for lending.
     * Leverage output UTxO information is fully returned from API.
     * No need to create output if not returned by API.
   * stakingContractOutUtxo: Staking Contract output after withdrawing base token for lending.
     * Staking Contract output UTxO information is fully returned from API.
     * No need to create output if not returned by API.
   * withdrawalFeeOutUtxo: Withdrawal fee output.
     * Withdrawal fee output UTxO information is fully returned from API.
     * No need to create output if not returned by API.
4. **Reference Input**:
   * Add all reference inputs returned from API.
5. **Withdrawal**:

* **OraclePriceCalcRdmr**
  * Add withdrawal to reward address with reward amount as returned from API.
  * Reward redeemer: Has OraclePriceCalcRdmr redeemer structure:
    * `prices` information returned from API. With `borrowToken` as `ToToken` and `collateralToken` as `FromToken`.
    * `global_config_idx`, `oracle_path_idxs` and `oracle_idxs` information taken from reference inputs.
    * For `oracle_idxs`, if UTxO is in output then `UTxOTarget` is `Out`, if in reference input then `UTxOTarget` is `Ref`, no `In` case in Create Fixed Loan.
    * CalcType in `prices`: Always 0 in Create Fixed Loan case.
* **Withdraw Staking Reward (Optional)**
  * Reward address with reward amount as returned from API.
  * Redeemer: Build according to StakingContractAction redeemer TopupWithdrawStaking structure.

6. **Mint**:
   * API returns complete mint information including `policyId`, `assets` and `redeemerType`.
   * With `redeemerType` being:
     * `FIXED`: Add mint with `policyId` and `assets` set with Fixed LendingAction CreateLoan redeemer.
     * `LEVERAGE`: Add mint with `policyId` and `assets` set with Leverage LendingAction TopupWithdraw redeemer.
     * `STAKING`: Add mint with `policyId` and `assets` set with StakingContractAction TopupWithdrawStaking redeemer.
7. **Auxiliary Data**:
   * Add metadata for `loanOwnerNft` according to information returned from API. (Optional)

**Note**: After sorting inputs and reference inputs according to chain sort order, need to get correct index to specify in redeemers.


# Guide to Create a Flexible Loan Transaction

Objective

Guide to create a loan transaction from the Flexible Pool Lending based on API:&#x20;

<https://docs.danogo.io/developers/integration/apis/loan>

{% stepper %}
{% step %}

### Step 1: Get Required Parameters

Use the provided API to get necessary information for the transaction.
{% endstep %}

{% step %}

### Step 2: Understanding Redeemer Structures

#### Float LendingAction Redeemer Structure

* LendingAction redeemer structure for Create Loan:

{% code title="LendingAction (type)" %}

```
pub type LendingAction {
    CreatePool {..}
    UpdateMarketParam {..}
    TopupWithdraw {..}
    CreateLoan {
        pool_out_idx: Int, // Required
        loan_out_idx: Int, // Required
        fee_out_idx: Option<Int>, // Required if fee > 0
        protocol_cfg_ref_idx: Int, // Required
        market_ref_idx: Int, // Required
        pool_in_out_ref: OutputReference, // Required
    }
}
```

{% endcode %}

* Concrete example for Create Loan:

```
CreateLoan {
        pool_out_idx: 2,
        loan_out_idx: 1,
        fee_out_idx: Some(0),
        protocol_cfg_ref_idx: 1,
        market_ref_idx: 0,
        pool_in_out_ref: pool_in.output_reference,
}
```

* Diagnostic Notation form:

```
124_0([_
        2,
        1,
        121([_ 0]),
        1,
        0,
        121_0([_
                h'516a6e6806e9dc771c3dce9a5fa27a4e6ec994b4609839c4df42778e9bd63bc5',
                0,
        ]),
])
```

***

#### Staking Contract StakingContractAction Redeemer Structure

* StakingContractAction redeemer structure for Topup Withdraw Staking:

```
pub type StakingContractAction {
    CreateContract {..}
    TopupWithdrawStaking(Int) // staking contract out_idx
    ...
}
```

* Concrete example for Topup Withdraw Staking:

```
TopupWithdrawStaking(0)
```

* Diagnostic Notation form:

```
122([_ 0])
```

***

#### OraclePriceCalcRdmr Redeemer Structure

* OraclePriceCalcRdmr redeemer structure:

```
pub type OraclePriceCalcRdmr {
  global_config_idx: Int,
  // List<Int>
  // Serialized list of indices of OraclePath UTxOs in reference inputs, each containing price path configurations. Each index is encoded as a single byte.
  oracle_path_idxs: ByteArray,
  // List<(UTxOTarget, OracleUtxoType, Index)>
  // Serialized oracle source specifications containing: (UTxO location type, oracle type, index). Encoded as 3 bytes per oracle: byte 1 = UTxO target type (0=Ref, 1=Out, 2=In), byte 2 = oracle type constant, byte 3 = index value
  oracle_idxs: ByteArray,
  prices: OraclePriceInfo,
  borrow_rates: Pairs<YieldToken, Basis>,
}

pub type UTxOTarget {
    Ref
    Out
    In
}

pub type OracleUtxoType {
    TOrcfaxFsp
    TOrcfaxFs
    TLiqwidMarketState
    TLiqwidMarketParam
    TLiqwidOracleV2
    TDanogoPool
    TIndigo
    TDjed
    TDanogoStaking
    TMinswapLP
    TLiqwidOracleV1
    TSplashLiquidityPoolCpammG1
    TSplashLiquidityPoolCpammG2
    TSplashLiquidityPoolCpammG3
    TSplashLiquidityPoolStable
    TCharli3
    TMinswapLPStable
}

// Pairs<ToToken, Pairs<FromToken, PRational>>,
pub type OraclePriceInfo =
    Pairs<TupleAsset, Pairs<TupleAsset, (CalcType, PRational)>>

// 0: Normal
// 1: Splash
pub type CalcType =
    Int
```

* Concrete example:

```
OraclePriceCalcRdmr {
  global_config_idx: 2,
  oracle_path_idxs: h'05', // [5]
  oracle_idxs: h'010800020d01' // [(Out, TDanogoStaking, 0), (In, TSplashLiquidityPoolCpammG3, 1)],
  // Price from sAda to Ada and from fUSDM to Ada
  prices: [Pair(Ada, [Pair(sAda, (0, PRational(63278285520, 62837134123))), Pair(fUSDM, (1, PRational(186046204, 181197120)))])],
  borrow_rates: None,
}

```

* Diagnostic Notation form:

```
121_0([_
    2,
    h'05',
    h'010800020d01',
    {
        [_ h'', h'']: {
            [_
                h'703d581d9a657d1326aea6a754cdcf191efb22133a62a181951156cf',
                h'',
            ]: [_ 0, 121_0([_ 63278285520_3, 62837134123_3])],
            [_
                h'834a15101873b4e1ddfaa830df46792913995d8738dcde34eda27905',
                h'665553444d',
            ]: [_ 1, 121_0([_ 186046204_2, 181197120_2])],
        },
    },
    {},
])
```

{% endstep %}

{% step %}

### Step 3: Create Transaction

Follow these substeps to craft the transaction. Convert API-returned times (milliseconds) to the format expected by your tooling.

{% stepper %}
{% step %}

#### Validity Range

* Ensure transaction time-to-live (TTL) <= 6 minutes.
* Transaction start time is set to value from `PoolOutputUtxo.datum.interestTime`.
* API returns data in milliseconds, convert to appropriate format for your tool.
  {% endstep %}

{% step %}

#### Inputs

Note: All `outRef`, `address`, `coin`, `multiAssets` information is provided by the API.

* PoolInUtxo: Pool you want to borrow from.
  * Spend redeemer: Build according to Float's LendingAction redeemer CreateLoan structure, ensure correct index specifications.
* StakingContractInUtxo: Staking Contract pool to withdraw base token for lending, returned by API.
  * Spend redeemer: Build according to StakingContractAction redeemer TopupWithdrawStaking structure, ensure correct index specifications.
* Input from wallet containing tokens needed for loan collateral.
  {% endstep %}

{% step %}

#### Outputs

* PoolOutUtxo: Pool output after borrowing.
  * All pool output UTxO information is provided by API.
* LoanOutUtxo: Loan output.
  * All loan output UTxO information is provided by API.
  * Note: Address returned by API only includes loan script payment key. If you want to receive rewards from loan when delegating to pool, specify borrower's stake key for loan address.
* FeeOutUtxo: Transaction fee output.
  * All fee output UTxO information is provided by API.
  * Not required if API doesn't return it.
* StakingContractOutUtxo: Staking Contract output after withdrawing base token for lending.
  * All Staking Contract output UTxO information is provided by API.
  * Not required if API doesn't return it.
* WithdrawalFeeOutUtxo: Withdrawal fee output.
  * All withdrawal fee output UTxO information is provided by API.
  * Not required if API doesn't return it.
    {% endstep %}

{% step %}

#### Reference Inputs

Add all reference inputs returned in API.
{% endstep %}

{% step %}

#### Withdrawal

* OraclePriceCalcRdmr
  * Add withdrawal to reward address with reward amount as returned by API.
  * Reward redeemer: Has OraclePriceCalcRdmr redeemer structure:
    * `prices` information returned by API. With `borrowToken` as `ToToken` and `collateralToken` as `FromToken`.
    * `global_config_idx`, `oracle_path_idxs` and `oracle_idxs` information from reference inputs.
    * For `oracle_idxs`, if UTxO is in output then `UTxOTarget` is `Out`; if in reference input then `UTxOTarget` is `Ref`. (No `In` case in Create Float Loan.)
    * CalcType in `prices`: Always 1 for Create Float Loan.
* Withdraw Staking Reward (Optional)
  * Reward address with reward amount as returned by API.
  * Redeemer: Build according to StakingContractAction redeemer TopupWithdrawStaking structure.
    {% endstep %}

{% step %}

#### Mint

* API returns complete mint information including `policyId`, `assets` and `redeemerType`.
* For `redeemerType`:
  * `FLOAT`: Add mint with `policyId` and `assets` set with Float's LendingAction CreateLoan redeemer.
  * `STAKING`: Add mint with `policyId` and `assets` set with StakingContractAction TopupWithdrawStaking redeemer.
    {% endstep %}

{% step %}

#### Auxiliary Data

* Add metadata for loanOwnerNft according to information returned by API (Optional).

Note: After sorting inputs and reference inputs according to chain sort order, ensure correct index specification in redeemers.
{% endstep %}
{% endstepper %}
{% endstep %}
{% endstepper %}


# Lending APIs


# Loan

## Get available loan offers

> \- Get all available loan offers, filter by loan tokens, collateral tokens, loan maturity and pagination with page/pageSize

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"tags":[{"name":"Loan"}],"servers":[{"url":"https://danogo-lending.preview.tekoapis.net","description":"Preview"},{"url":"https://danogo-lending.tekoapis.com","description":"Mainnet"}],"paths":{"/api/v1/get-available-loan-offers":{"post":{"tags":["Loan"],"summary":"Get available loan offers","description":"- Get all available loan offers, filter by loan tokens, collateral tokens, loan maturity and pagination with page/pageSize","operationId":"getAvailableLoanOffers","requestBody":{"content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"loanTokens":{"type":"array","description":"Filter by list loan tokens","items":{"type":"string","format":"{policyId}.{assetName}","description":"Token id of Loan Token","nullable":false}},"collateralTokens":{"type":"array","minItems":1,"maxItems":50,"description":"List of Collateral Tokens, in format \"{policyId}.{assetName}\", for filtering Pools","items":{"type":"string","format":"{policyId}.{assetName}","description":"Token id of Collateral Token","nullable":false}},"loanMaturity":{"type":"integer","format":"int64","description":"- Loan Maturity in milliseconds, for filtering Pools with maturity greater than this value.\n- If Null return Loan offer with float rate\n","nullable":true}}},{"type":"object","properties":{"page":{"type":"integer","default":1,"description":"Current page, for high performance try to use pagination.offset instead!"},"pageSize":{"type":"integer","nullable":false,"description":"Page size"}}}]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"data":{"type":"object","required":["pagination"],"properties":{"loans":{"type":"array","minItems":0,"maxItems":50,"description":"List Available Loans","items":{"type":"object","required":["loanToken"],"properties":{"loanToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Loan Token"},"loanOffers":{"type":"array","description":"List loan offers","items":{"type":"object","description":"Loan offer","required":["poolId","borrowRate","minBorrowAmount","availableLiquidity"],"properties":{"poolId":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Pool NFT"},"borrowRate":{"type":"integer","description":"Borrow Rate in basis point","nullable":false},"loanDuration":{"type":"integer","description":"Loan duration in days, for loan offer with fixed rate","nullable":true},"minBorrowAmount":{"type":"string","format":"bigint","nullable":true,"description":"The minimum borrow amount when create loan"},"availableLiquidity":{"type":"string","format":"bigint","nullable":false,"description":"Amount of token available in liquidity of Pool"},"collaterals":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","description":"Collateral token and its liquidation threshold","required":["collateralToken","liquidationThreshold"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of the Collateral token"},"liquidationThreshold":{"type":"integer","nullable":false,"description":"Liquidation threshold of collateral token in basis points"}}}}}}}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","format":"int32","description":"Current page, start from 1","nullable":false},"pageSize":{"type":"integer","format":"int32","description":"Page size","nullable":false},"total":{"type":"integer","format":"int32","description":"Total items","nullable":false}},"required":["page","pageSize","total"]}}}}}]}}}},"default":{"description":"An unexpected error response","content":{"application/json":{"schema":{"title":"runtimeError","allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"error":{"type":"string","deprecated":true,"description":"do NOT use this field anymore! Use code & message instead!"},"details":{"type":"array","items":{"title":"protobufAny","type":"object","properties":{"typeUrl":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","description":"Must be a valid serialized protocol buffer of the above specified type.","format":"byte"}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n  Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n  Example 4: Pack and unpack a message in Go\n\n      foo := &pb.Foo{...}\n      any, err := ptypes.MarshalAny(foo)\n      ...\n      foo := &pb.Foo{}\n      if err := ptypes.UnmarshalAny(any, foo); err != nil {\n        ...\n      }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"}}}}]}}}}}}}}}
```

## Get Params for Create Fixed Rate Loan transaction

> \- Get parameters for Create Fixed Rate Loan Transaction\
> \- Documentation: <https://docs.danogo.io/developers/integration/how-to-build-transaction-to-create-a-fixed-rate-loan>

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"tags":[{"name":"Loan"}],"servers":[{"url":"https://danogo-lending.preview.tekoapis.net","description":"Preview"},{"url":"https://danogo-lending.tekoapis.com","description":"Mainnet"}],"paths":{"/api/v1/get-create-fixed-loan-params":{"post":{"tags":["Loan"],"summary":"Get Params for Create Fixed Rate Loan transaction","description":"- Get parameters for Create Fixed Rate Loan Transaction\n- Documentation: https://docs.danogo.io/developers/integration/how-to-build-transaction-to-create-a-fixed-rate-loan","operationId":"getCreateFixedLoanParams","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["poolId","borrowAmount","loanDuration","collateralTokens"],"properties":{"poolId":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of the Pool NFT from which the Loan will borrow"},"borrowAmount":{"type":"string","format":"bigint","nullable":false,"description":"Amount of token to borrow, in base unit"},"loanDuration":{"type":"integer","nullable":false,"description":"Loan duration in days"},"collaterals":{"type":"array","minItems":1,"maxItems":50,"description":"List of collaterals","items":{"type":"object","required":["collateralToken","collateralAmount"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Collateral token"},"collateralAmount":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Collateral token"}}}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"data":{"type":"object","required":["inputs","outputs","withdrawals","mint","referenceInputs"],"properties":{"inputs":{"type":"object","description":"Inputs info for building transaction, required either liqwidInUtxo or floatPoolInUtxo","required":["poolInUtxo","floatPoolInUtxo"],"properties":{"poolInUtxo":{"allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]},{"description":"- UTxO of Fixed Pool, used for input\n- Spending redeemer struct:\n  - Redeemer Indexer: Index for Create loan\n    - Pool Out Index: Int - Index of Pool UTxO in outputs\n    - Loan Out Index: Int - Index of Loan UTxO in outputs\n  - Pool In Index: Int - Index of Pool UTxO in inputs\n  - Loan In Index: Int - Index of Loan UTxO in inputs (Null when Create new loan)\n  - Protocol Script Index: Int - Index of Protocol Script UTxO in reference inputs\n  - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n  - Fee Out Index: Int - Index of Fee UTxO in outputs (Null when Fee = 0)"}]},"floatPoolInUtxo":{"allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]},{"description":"- UTxO of Float Pool, used for input\n- Spending redeemer struct:\n  - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n  - Pool Market Ref Indexers: List\\<PoolMarketIndexer\\>\n    - Pool Out Index: Int - Index of Pool UTxO in outputs\n    - Fee Out Index: Option\\<Int\\> - Index of Fee UTxO in outputs (Null when Fee = 0)\n    - Market Ref Index: Int - Index of Market Ref UTxO in reference inputs"}]},"stakingContractInUtxo":{"allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]},{"description":"- UTxO of Staking Contract Pool, used for input\n- Spending redeemer struct:\n  - Pool Out Index: Int - Index of Pool UTxO in outputs"}]}}},"outputs":{"type":"object","description":"Outputs info for building transaction","required":["poolOutUtxo","loanOutUtxo"],"properties":{"poolOutUtxo":{"description":"UTxO of Fixed Pool","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["supplyToken","supplyYieldToken","circulatingPTSupply","circulatingYTSupply","supplyMaturity","collaterals","baseInterestRate","gradient","maxLoanDuration","activeLoanCount","feeCollected","minBorrowAmount"],"properties":{"supplyToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of supply token of Pool"},"supplyYieldToken":{"type":"string","format":"{policyId}.{assetName}","nullable":true,"description":"Token id of substitute token of supply token"},"circulatingPTSupply":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Pool PT in circulating"},"circulatingYTSupply":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Pool YT in circulating"},"supplyMaturity":{"type":"integer","nullable":false,"description":"Maturity timestamp of Pool"},"collaterals":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","description":"Collateral token with its price and liquidation threshold","required":["collateralToken","liquidationThreshold"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of the Collateral token"},"liquidationThreshold":{"type":"integer","nullable":false,"description":"Liquidation threshold of collateral token in basis points"}}}},"baseInterestRate":{"type":"integer","nullable":false,"description":"Base Interest Rate in basis points"},"gradient":{"type":"integer","nullable":false,"description":"Gradient in basis points"},"maxLoanDuration":{"type":"integer","nullable":false,"description":"Max loan duration in milliseconds"},"activeLoanCount":{"type":"integer","nullable":false,"description":"Number of Active Loan borrowed from Pool"},"feeCollected":{"type":"boolean","nullable":false,"description":"True if the fee has been collected from the pool, false otherwise"},"minBorrowAmount":{"type":"string","format":"bigint","nullable":true,"description":"The minimum borrow amount when create loan"}}}}}]},"loanOutUtxo":{"description":"UTxO of Fixed Loan, borrower must add collateral to multiAssets","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["loanProfitFee","loanAmount","loanOwnerNftName"],"properties":{"loanProfitFee":{"type":"string","format":"bigint","nullable":true,"description":"Loan profit fee in datum of Loan UTxO, set when building the Tx"},"loanAmount":{"type":"string","format":"bigint","nullable":false,"description":"Debt amount of token in Loan UTxO"},"loanMaturity":{"type":"number","format":"int64","nullable":true,"description":"Maturity timestamp of Loan in milliseconds, set to loan maturity when building the Tx"},"loanOwnerNftName":{"type":"string","format":"{assetName}","nullable":false,"description":"Token id asset name of Loan Owner NFT"}}}}}]},"feeOutUtxo":{"description":"Output UTxO detail for building Transaction","type":"object","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},"floatPoolOutUtxo":{"allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["totalSupply","circulatingDToken","totalBorrow","borrowApy","undistributedFee","interestIndex","interestTime","alternativeSupplyTokens"],"properties":{"totalSupply":{"type":"string","format":"bigint","nullable":false,"description":"Total supply in pool, in base unit"},"circulatingDToken":{"type":"string","format":"bigint","nullable":false,"description":"Total dToken minted - total dToken burned"},"totalBorrow":{"type":"string","format":"bigint","nullable":false,"description":"Total borrow in pool, in base unit"},"borrowRate":{"type":"integer","nullable":false,"description":"Borrow rate in basis point"},"undistributedFee":{"type":"string","format":"bigint","nullable":false,"description":"Protocol fee not distributed for supplier, in base unit"},"interestIndex":{"type":"string","format":"bigint","nullable":false,"description":"Interest index"},"interestTime":{"type":"number","format":"int64","nullable":false,"description":"updated market state timestamp in millisecond"},"alternativeSupplyTokens":{"type":"array","description":"List of alternative supply tokens in pools","items":{"type":"object","required":["token","latestExchangeRateNum","latestExchangeRateDen"],"properties":{"token":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of alternative token"},"latestExchangeRateNum":{"type":"string","format":"bigint","nullable":false,"description":"Numerator of exchange alternative token rate has been captured at the last interest time"},"latestExchangeRateDen":{"type":"string","format":"bigint","nullable":false,"description":"Denominator of exchange qToken rate has been captured at the last interest time"}}}}}}}}]},"stakingContractOutUtxo":{"type":"object","description":"UTxO of Staking Contract contains ADA of users","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["totalSupply","circulatingSToken","validUntil"],"properties":{"totalSupply":{"type":"string","format":"bigint","nullable":false,"description":"total supply of staking contract"},"circulatingSToken":{"type":"string","format":"bigint","nullable":false,"description":"circulating sToken for this staking contract"},"validUntil":{"type":"integer","format":"int64","nullable":false,"description":"The maximum time until which the exchange rate between sADA and ADA is accepted, determinedby the end time of the epoch containing the transaction start time in milliseconds"}}}}}]},"withdrawalFeeOutUtxo":{"description":"Output UTxO detail for building Transaction","type":"object","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}}}},"withdrawals":{"type":"array","minItems":1,"maxItems":2,"description":"Withdrawals info for building transaction, include Reward Address Script Hash, coin and withdrawal redeemer","items":{"type":"object","required":["rewardAddressScriptHash","coin"],"properties":{"rewardAddressScriptHash":{"type":"string","format":"bech32","description":"Script Hash of reward address, used for withdrawal","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"Number of ADA to withdrawal","nullable":false},"withdrawalRedeemer":{"type":"object","description":"- Withdrawal Redeemer Struct:\n  - Global Config Index: Int - Index of Global Config UTxO in reference inputs\n  - Oracle Path Indexes: ByteArray(List\\<Int\\>) - List Index of Oracle Path UTxO in reference inputs, convert to ByteArray\n  - Oracle Price Indexes: ByteArray(List\\<OraclePriceIndex\\>) - List Index of Oracle Price UTxO in reference inputs or outputs, group by Oracle Source Type and convert to ByteArray\n    - OraclePriceIndex: <UtxoTarget, OracleType, Index> - Index of Oracle Price UTxO\n      - UtxoTarget: Enum - UTxO in reference inputs or outputs, include:\n        - REF\n        - OUT\n        - IN\n      - OracleType: Enum - Type of Oracle Price UTxO, include:\n        - ORCFAX_FSP\n        - ORCFAX_FS\n        - LIQWID_MARKET_STATE\n        - LIQWID_MARKET_PARAM\n        - LIQWID_ORACLE_V1\n        - LIQWID_ORACLE_V2\n        - DANOGO_FLOAT_POOL\n        - INDIGO\n        - DJED\n        - DANOGO_STAKING\n        - MINSWAP_LP\n        - SPLASH_LP_CFMM_G1\n        - SPLASH_LP_CFMM_G2\n        - SPLASH_LP_CFMM_G3\n        - SPLASH_LP_STABLE\n      - Index: Int - Index of Oracle Price UTxO in reference inputs or outputs\n  - Prices: List\\<OraclePrice\\> - List of prices of collateralToken/borrowToken\n    - OraclePrice: List\\<(CalcType, prices)\\> - Prices of each collateral token\n      - CalcType: Int - 0: Normal, 1: Splash\n  - Borrow Rates: List\\<BorrowRate\\> - List of borrow rates from Yield Protocols associated with Danogo Lending (e.g., Liqwid)","required":["prices"],"properties":{"prices":{"type":"array","minItems":1,"maxItems":50,"description":"List of prices of token pairs (A/B)","items":{"type":"object","required":["borrowToken","oraclePrices"],"properties":{"borrowToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Borrow token"},"oraclePrices":{"type":"array","minItems":1,"maxItems":50,"description":"Prices of each collateral token","items":{"type":"object","required":["collateralToken","priceNum","priceDen"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Collateral token"},"priceNum":{"type":"string","format":"bigint","nullable":true,"description":"Numerator of Collateral token price in Supply token"},"priceDen":{"type":"string","format":"bigint","nullable":true,"description":"Denominator of Collateral token price in Supply token"}}}}}}},"borrowRates":{"type":"array","minItems":1,"maxItems":50,"description":"List of borrow rates from Yield Protocols associated with Danogo Lending (e.g., Liqwid)","items":{"type":"object","properties":{"yieldToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Yield token"},"borrowRate":{"type":"integer","nullable":false,"description":"borrow rate in basis points"}}}}}}}}},"mint":{"type":"object","description":"- Mint info for building transaction with multiAssets\n  - MultiAssets: List token to mint/burn when create loan, include:\n    - Loan Owner NFT: Owner NFT token send to borrower\n    - Loan Validity Token: Token used for loan validity, include in Loan UTxO\n    - Liqwid qToken: The qToken is burned when withdrawing from the Liqwid Pool UTxO\n  - Minting redeemer struct (Fixed):\n    - Reddemer Indexer: Index for Create loan\n      - Pool Out Index: Int - Index of Pool UTxO in outputs\n      - Loan Out Index: Int - Index of Loan UTxO in outputs\n    - Pool In Index: Int - Index of Pool UTxO in inputs\n    - Loan In Index: Int - Index of Loan UTxO in inputs (Null when Create new loan)\n    - Protocol Script Index: Int - Index of Protocol Script UTxO in reference inputs\n    - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n    - Fee Out Index: Int - Index of Fee UTxO in outputs (Null when Fee = 0)\n  - Minting redeemer struct (Float):\n    - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n    - Pool Market Ref Indexers: List\\<PoolMarketIndexer\\>\n      - Pool Out Index: Int - Index of Pool UTxO in outputs\n      - Fee Out Index: Option\\<Int\\> - Index of Fee UTxO in outputs (Null when Fee = 0)\n      - Market Ref Index: Int - Index of Market Ref UTxO in reference inputs\n  - Minting redeemer struct (Staking Contract):\n    - Pool Out Index: Int - Index of Pool UTxO in outputs","required":["multiAssets"],"properties":{"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets","redeemerType"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}},"redeemerType":{"type":"string","enum":["FIXED","FLOAT","FLOAT","STAKING"],"description":"Redeemer type, used when building the transaction; each type requires a different redeemer structure"}}}}}},"referenceInputs":{"type":"array","minItems":1,"maxItems":50,"description":"List of UTxO output reference required to be included in transaction as reference inputs","items":{"type":"object","required":["outRef","type"],"properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","nullable":false,"description":"Output Reference of UTxO"},"type":{"type":"string","enum":["POOL_SCRIPT","LOAN_SCRIPT","ORACLE_PRICE_SCRIPT","GLOBAL_CONFIG","ORACLE_PATH","ORACLE_PRICE","PROTOCOL_SCRIPT","PROTOCOL_CONFIG","LIQWID_MARKET_STATE","LIQWID_MARKET_PARAM","ORCFAX_FSP","ORCFAX_FS","LIQWID_ORACLE","DANOGO_FLOAT_POOL","INDIGO","DJED","DANOGO_STAKING","MINSWAP_LP","STAKING_CONTRACT_SCRIPT","FLOAT_PROTOCOL_CONFIG","FLOAT_POOL_SCRIPT","FLOAT_POOL_CONFIG","FLOAT_LOAN_SCRIPT"],"description":"Type of UTxO OutRef, used for reference inputs and indexer in redeemer"}}}},"auxiliaryData":{"description":"Auxiliary data associated with the loan, follows CIP-25","type":"object","properties":{"loanOwnerNftMetadata":{"allOf":[{"type":"object","description":"Metadata associated with the loan owner's NFT, follows CIP-25"},{"title":"tokenMetadata","type":"object","description":"CIP-25 token metadata","required":["name","image"],"properties":{"name":{"type":"string","description":"Display name of token","nullable":false},"image":{"type":"string","description":"Image URL of token on ipfs","nullable":false},"description":{"type":"string","description":"Description of token","nullable":true}}}]}}}}}}}]}}}},"default":{"description":"An unexpected error response","content":{"application/json":{"schema":{"title":"runtimeError","allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"error":{"type":"string","deprecated":true,"description":"do NOT use this field anymore! Use code & message instead!"},"details":{"type":"array","items":{"title":"protobufAny","type":"object","properties":{"typeUrl":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","description":"Must be a valid serialized protocol buffer of the above specified type.","format":"byte"}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n  Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n  Example 4: Pack and unpack a message in Go\n\n      foo := &pb.Foo{...}\n      any, err := ptypes.MarshalAny(foo)\n      ...\n      foo := &pb.Foo{}\n      if err := ptypes.UnmarshalAny(any, foo); err != nil {\n        ...\n      }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"}}}}]}}}}}}}}}
```

## Get Params for Create Float Rate Loan transaction

> Get parameters for Create Float Rate Loan Transaction

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"tags":[{"name":"Loan"}],"servers":[{"url":"https://danogo-lending.preview.tekoapis.net","description":"Preview"},{"url":"https://danogo-lending.tekoapis.com","description":"Mainnet"}],"paths":{"/api/v1/get-create-float-loan-params":{"post":{"tags":["Loan"],"summary":"Get Params for Create Float Rate Loan transaction","description":"Get parameters for Create Float Rate Loan Transaction","operationId":"getCreateFloatLoanParams","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["borrowToken","borrowAmount","collateralTokens"],"properties":{"borrowToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id, concat of asset policyId with asset name (Case ADA, id = \"\")"},"borrowAmount":{"type":"string","format":"bigint","nullable":false,"description":"Amount of token to borrow, in base unit"},"collaterals":{"type":"array","minItems":1,"maxItems":50,"description":"List of collaterals","items":{"type":"object","required":["collateralToken","collateralAmount"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Collateral token"},"collateralAmount":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Collateral token"}}}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"data":{"type":"object","required":["inputs","outputs","withdrawals","mint","referenceInputs"],"properties":{"inputs":{"type":"object","description":"Inputs info for building transaction","required":["poolInUtxo"],"properties":{"stakingContractInUtxo":{"allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]},{"description":"- UTxO of Staking Contract Pool, used for input\n- Spending redeemer struct:\n  - Pool Out Index: Int - Index of Pool UTxO in outputs"}]},"poolInUtxo":{"allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]},{"description":"- UTxO of Pool, used for input\n- Spending redeemer struct:\n  - Pool Out Index: Int - Index of Pool UTxO in outputs\n  - Loan Out Index: Int - Index of Loan UTxO in outputs\n  - Fee Out Index: Int - Index of Fee UTxO in outputs\n  - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n  - Market Ref Index: Int - Index of Market Ref UTxO in reference inputs\n  - Pool In OutRef: String - OutRef of Pool UTxO in inputs"}]}}},"outputs":{"type":"object","description":"Outputs info for building transaction","required":["poolOutUtxo","loanOutUtxo"],"properties":{"poolOutUtxo":{"allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["totalSupply","circulatingDToken","totalBorrow","borrowApy","undistributedFee","interestIndex","interestTime","alternativeSupplyTokens"],"properties":{"totalSupply":{"type":"string","format":"bigint","nullable":false,"description":"Total supply in pool, in base unit"},"circulatingDToken":{"type":"string","format":"bigint","nullable":false,"description":"Total dToken minted - total dToken burned"},"totalBorrow":{"type":"string","format":"bigint","nullable":false,"description":"Total borrow in pool, in base unit"},"borrowRate":{"type":"integer","nullable":false,"description":"Borrow rate in basis point"},"undistributedFee":{"type":"string","format":"bigint","nullable":false,"description":"Protocol fee not distributed for supplier, in base unit"},"interestIndex":{"type":"string","format":"bigint","nullable":false,"description":"Interest index"},"interestTime":{"type":"number","format":"int64","nullable":false,"description":"updated market state timestamp in millisecond"},"alternativeSupplyTokens":{"type":"array","description":"List of alternative supply tokens in pools","items":{"type":"object","required":["token","latestExchangeRateNum","latestExchangeRateDen"],"properties":{"token":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of alternative token"},"latestExchangeRateNum":{"type":"string","format":"bigint","nullable":false,"description":"Numerator of exchange alternative token rate has been captured at the last interest time"},"latestExchangeRateDen":{"type":"string","format":"bigint","nullable":false,"description":"Denominator of exchange qToken rate has been captured at the last interest time"}}}}}}}}]},"loanOutUtxo":{"description":"UTxO of Float Loan, borrower must add collateral to multiAssets","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["loanOwnerToken","loanToken","loanAmount","initialInterestIndex"],"properties":{"loanOwnerToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Loan Owner NFT, null if loan was liquidated"},"loanToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Loan Token"},"loanAmount":{"type":"string","format":"bigint","nullable":false,"description":"loan amount in lovelace"},"initialInterestIndex":{"type":"string","format":"bigint","nullable":false,"description":"captured interest index when create loan or modify loan"}}}}}]},"feeOutUtxo":{"description":"Output UTxO detail for building Transaction","type":"object","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},"stakingContractOutUtxo":{"type":"object","description":"UTxO of Staking Contract contains ADA of users","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["totalSupply","circulatingSToken","validUntil"],"properties":{"totalSupply":{"type":"string","format":"bigint","nullable":false,"description":"total supply of staking contract"},"circulatingSToken":{"type":"string","format":"bigint","nullable":false,"description":"circulating sToken for this staking contract"},"validUntil":{"type":"integer","format":"int64","nullable":false,"description":"The maximum time until which the exchange rate between sADA and ADA is accepted, determinedby the end time of the epoch containing the transaction start time in milliseconds"}}}}}]}}},"withdrawals":{"type":"array","minItems":1,"maxItems":2,"description":"Withdrawals info for building transaction, include Reward Address Script Hash, coin and withdrawal redeemer","items":{"type":"object","required":["rewardAddressScriptHash","coin"],"properties":{"rewardAddressScriptHash":{"type":"string","format":"bech32","description":"Script Hash of reward address, used for withdrawal","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"Number of ADA to withdrawal","nullable":false},"withdrawalRedeemer":{"type":"object","description":"- Withdrawal Redeemer Struct:\n  - Global Config Index: Int - Index of Global Config UTxO in reference inputs\n  - Oracle Path Indexes: ByteArray(List\\<Int\\>) - List Index of Oracle Path UTxO in reference inputs, convert to ByteArray\n  - Oracle Price Indexes: ByteArray(List\\<OraclePriceIndex\\>) - List Index of Oracle Price UTxO in reference inputs or outputs, group by Oracle Source Type and convert to ByteArray\n    - OraclePriceIndex: <UtxoTarget, OracleType, Index> - Index of Oracle Price UTxO\n      - UtxoTarget: Enum - UTxO in reference inputs or outputs, include:\n        - REF\n        - OUT\n        - IN\n      - OracleType: Enum - Type of Oracle Price UTxO, include:\n        - ORCFAX_FSP\n        - ORCFAX_FS\n        - LIQWID_MARKET_STATE\n        - LIQWID_MARKET_PARAM\n        - LIQWID_ORACLE_V1\n        - LIQWID_ORACLE_V2\n        - DANOGO_FLOAT_POOL\n        - INDIGO\n        - DJED\n        - DANOGO_STAKING\n        - MINSWAP_LP\n        - SPLASH_LP_CFMM_G1\n        - SPLASH_LP_CFMM_G2\n        - SPLASH_LP_CFMM_G3\n        - SPLASH_LP_STABLE\n      - Index: Int - Index of Oracle Price UTxO in reference inputs or outputs\n  - Prices: List\\<OraclePrice\\> - List of prices of collateralToken/borrowToken\n    - OraclePrice: List\\<(CalcType, prices)\\> - Prices of each collateral token\n      - CalcType: Int - 0: Normal, 1: Splash\n  - Borrow Rates: List\\<BorrowRate\\> - List of borrow rates from Yield Protocols associated with Danogo Lending (e.g., Liqwid)","required":["prices"],"properties":{"prices":{"type":"array","minItems":1,"maxItems":50,"description":"List of prices of token pairs (A/B)","items":{"type":"object","required":["borrowToken","oraclePrices"],"properties":{"borrowToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Borrow token"},"oraclePrices":{"type":"array","minItems":1,"maxItems":50,"description":"Prices of each collateral token","items":{"type":"object","required":["collateralToken","priceNum","priceDen"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Collateral token"},"priceNum":{"type":"string","format":"bigint","nullable":true,"description":"Numerator of Collateral token price in Supply token"},"priceDen":{"type":"string","format":"bigint","nullable":true,"description":"Denominator of Collateral token price in Supply token"}}}}}}},"borrowRates":{"type":"array","minItems":1,"maxItems":50,"description":"List of borrow rates from Yield Protocols associated with Danogo Lending (e.g., Liqwid)","items":{"type":"object","properties":{"yieldToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Yield token"},"borrowRate":{"type":"integer","nullable":false,"description":"borrow rate in basis points"}}}}}}}}},"mint":{"type":"object","description":"- Mint info for building transaction with multiAssets\n  - MultiAssets: List token to mint/burn when create loan, include:\n    - Loan Owner NFT: Owner NFT token send to borrower\n    - Loan Validity Token: Token used for loan validity, include in Loan UTxO\n    - Float dToken: The dToken is burned when withdrawing from the Float Pool UTxO\n    - Liqwid qToken: The qToken is burned when withdrawing from the Liqwid Pool UTxO\n  - Minting redeemer struct (Float):\n    - Pool Out Index: Int - Index of Pool UTxO in outputs\n    - Loan Out Index: Int - Index of Loan UTxO in outputs\n    - Fee Out Index: Int - Index of Fee UTxO in outputs\n    - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n    - Market Ref Index: Int - Index of Market Ref UTxO in reference inputs\n    - Pool In OutRef: String - OutRef of Pool UTxO in inputs\n  - Minting redeemer struct (Float):\n    - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n    - Pool Market Ref Indexers: List\\<PoolMarketIndexer\\>\n      - Pool Out Index: Int - Index of Pool UTxO in outputs\n      - Fee Out Index: Option\\<Int\\> - Index of Fee UTxO in outputs (Null when Fee = 0)\n      - Market Ref Index: Int - Index of Market Ref UTxO in reference inputs\n  - Minting redeemer struct (Staking Contract):\n    - Pool Out Index: Int - Index of Pool UTxO in outputs","required":["multiAssets"],"properties":{"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets","redeemerType"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}},"redeemerType":{"type":"string","enum":["FIXED","FLOAT","FLOAT","STAKING"],"description":"Redeemer type, used when building the transaction; each type requires a different redeemer structure"}}}}}},"referenceInputs":{"type":"array","minItems":1,"maxItems":50,"description":"List of UTxO output reference required to be included in transaction as reference inputs","items":{"type":"object","required":["outRef","type"],"properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","nullable":false,"description":"Output Reference of UTxO"},"type":{"type":"string","enum":["POOL_SCRIPT","POOL_CONFIG","LOAN_SCRIPT","STAKING_CONTRACT_SCRIPT","ORACLE_PRICE_SCRIPT","GLOBAL_CONFIG","ORACLE_PATH","ORACLE_PRICE","PROTOCOL_CONFIG","LIQWID_MARKET_STATE","LIQWID_MARKET_PARAM","ORCFAX_FSP","ORCFAX_FS","LIQWID_ORACLE","DANOGO_FLOAT_POOL","INDIGO","DJED","DANOGO_STAKING","MINSWAP_LP","SPLASH_LP_CFMM_G3"],"description":"Type of UTxO OutRef, used for reference inputs and indexer in redeemer"}}}}}}}}]}}}},"default":{"description":"An unexpected error response","content":{"application/json":{"schema":{"title":"runtimeError","allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"error":{"type":"string","deprecated":true,"description":"do NOT use this field anymore! Use code & message instead!"},"details":{"type":"array","items":{"title":"protobufAny","type":"object","properties":{"typeUrl":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","description":"Must be a valid serialized protocol buffer of the above specified type.","format":"byte"}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n  Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n  Example 4: Pack and unpack a message in Go\n\n      foo := &pb.Foo{...}\n      any, err := ptypes.MarshalAny(foo)\n      ...\n      foo := &pb.Foo{}\n      if err := ptypes.UnmarshalAny(any, foo); err != nil {\n        ...\n      }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"}}}}]}}}}}}}}}
```

## Get Params for Create Loan to Submit GA Transaction

> Get parameters for Create Loan to Submit GA Transaction\
> Note: API response doesn't include proposal procedures due to object complication, client needs to build themselves.<br>

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"tags":[{"name":"Loan"}],"servers":[{"url":"https://danogo-lending.preview.tekoapis.net","description":"Preview"},{"url":"https://danogo-lending.tekoapis.com","description":"Mainnet"}],"paths":{"/api/v1/get-create-loan-ga-params":{"post":{"tags":["Loan"],"summary":"Get Params for Create Loan to Submit GA Transaction","description":"Get parameters for Create Loan to Submit GA Transaction\nNote: API response doesn't include proposal procedures due to object complication, client needs to build themselves.\n","operationId":"getCreateLoanToSubmitGAParams","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"poolId":{"type":"string","format":"{policyId}.{assetName}","description":"Token id of the Pool NFT from which the Loan will borrow"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"data":{"type":"object","required":["inputs","outputs","withdrawal","mint","referenceInputs"],"properties":{"poolId":{"type":"string","description":"Token id of the Pool NFT of the Fixed Rate Pool to borrow from."},"gaTreasuryAddress":{"type":"string","format":"bech32","nullable":true,"description":"Stake address of GA Treasury SC, used for receiving reward after Governance Action finalized."},"loanFee":{"type":"string","format":"bigint (lovelace)","description":"The loan fee that user must pay to the lending pool for each governance action, included of:\n- pool's loan interest\n- collector fee / minAda\n- loan origination fee\n"},"govActionParams":{"description":"Parameters for Gov Action, used when building the transaction","type":"object","properties":{"lastGuardrails":{"type":"string","description":"The optional guardrails script defined in the constitution. This script is executed by the ledger alongside the hard-coded ledger rules and applies only to PROTOCOL_PARAMETER_CHANGE and TREASURY_WITHDRAWALS proposals.\n"},"lastGuardrailsScriptOutRef":{"type":"string","description":"The guardrails script has been put on a UTxO so that it can be used as reference script in Treasury Withdrawal and Protocol Parameter Change proposals. [See more](https://book.world.dev.cardano.org/env-mainnet.html#guardrails-reference-script-utxo)"},"lastEnactedNoConfidenceGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type NO_CONFIDENCE."},"lastEnactedUpdateCommitteeGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type UPDATE_COMMITTEE."},"lastEnactedNewConstitutionGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type NEW_CONSTITUTION."},"lastEnactedHardForkGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type HARD_FORK_INITIATION."},"lastEnactedProtocolParamChangeGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type PROTOCOL_PARAMETER_CHANGE."},"currentProtocolVersion":{"type":"string","description":"The current protocol version in Cardano."},"committeeVotingThreshold":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The voting threshold for committee approval"}]},"protocolParameters":{"title":"Cardano Protocol Parameters","type":"object","properties":{"maxBlockBodySize":{"type":"string","format":"int64","description":"Maximum size of a block body in bytes."},"maxTxSize":{"type":"string","format":"int64","description":"Maximum size of a transaction in bytes."},"maxBlockHeaderSize":{"type":"string","format":"int64","description":"Maximum size of a block header in bytes."},"maxValueSize":{"type":"string","format":"int64","description":"Maximum value size in bytes."},"maxTxExecutionMemUnits":{"type":"string","format":"int64","description":"Maximum memory units in a single transaction"},"maxTxExecutionStepUnits":{"type":"string","format":"int64","description":"Maximum step units in a single transaction"},"maxBlockExecutionMemUnits":{"type":"string","format":"int64","description":"Maximum memory units in a single block"},"maxBlockExecutionStepUnits":{"type":"string","format":"int64","description":"Maximum step units in a single block"},"maxCollateralInputs":{"type":"string","format":"int64","description":"Maximum number of collateral inputs in a single transaction."},"txFeePerByte":{"type":"string","format":"int64","description":"The fee per byte for transactions."},"txFeeFixed":{"type":"string","format":"int64","description":"The fixed fee for transactions."},"stakeAddressDeposit":{"type":"string","format":"int64","description":"The deposit required for stake key registration."},"stakePoolDeposit":{"type":"string","format":"int64","description":"The deposit required for pool registration."},"monetaryExpansion":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The rate of monetary expansion."}]},"treasuryCut":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The rate at which the treasury will grow over time."}]},"minPoolCost":{"type":"string","format":"int64","description":"The minimum cost to maintain a pool."},"utxoCostPerByte":{"type":"string","format":"int64","description":"The minimum Lovelace deposit per byte for serialized UTxOs."},"executionMemUnitPrices":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"Price for memory usage in script execution."}]},"executionStepUnitPrices":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"Price for step execution in script execution."}]},"poolPledgeInfluence":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The influence of pool pledge on governance actions."}]},"poolRetireMaxEpoch":{"type":"string","format":"int64","description":"The maximum epoch for pool retirement."},"stakePoolTargetNum":{"type":"string","format":"int64","description":"The desired number of stake pools in the system."},"costModels":{"description":"Cost model data for different versions of Plutus scripts.","type":"object","properties":{"plutusV1":{"type":"array","description":"The cost model for Plutus v1 scripts, typically containing 166 integers representing resource usage costs.","items":{"type":"integer"}},"plutusV2":{"type":"array","description":"The cost model for Plutus v2 scripts, typically containing 175 integers representing resource usage costs.","items":{"type":"integer"}},"plutusV3":{"type":"array","description":"The cost model for Plutus v3 scripts, typically containing 223 integers representing resource usage costs.","items":{"type":"integer"}}}},"collateralPercentage":{"type":"string","format":"int64","description":"The percentage of collateral required for scripts."},"pvtMotionNoConfidence":{"type":"number","format":"double","description":"The pool voting threshold for a motion of no confidence."},"pvtCommitteeNormal":{"type":"number","format":"double","description":"The pool voting threshold for constitutional committee decisions."},"pvtCommitteeNoConfidence":{"type":"number","format":"double","description":"The pool voting threshold for constitutional committee actions under no confidence."},"pvtHardForkInitiation":{"type":"number","format":"double","description":"The pool voting threshold for approving a hard fork initiation."},"pvtPPSecurityGroup":{"type":"number","format":"double","description":"The pool voting threshold for changes to the protocol parameters security group."},"dvtMotionNoConfidence":{"type":"number","format":"double","description":"The drep voting threshold for a motion of no confidence."},"dvtCommitteeNormal":{"type":"number","format":"double","description":"The drep voting threshold for constitutional committee decisions."},"dvtCommitteeNoConfidence":{"type":"number","format":"double","description":"The drep voting threshold for constitutional committee actions under no confidence."},"dvtUpdateToConstitution":{"type":"number","format":"double","description":"The drep voting threshold for approving constitutional changes."},"dvtHardForkInitiation":{"type":"number","format":"double","description":"The drep voting threshold for approving a hard fork."},"dvtPPNetworkGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters network group."},"dvtPPEconomicGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters economic group."},"dvtPPTechnicalGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters technical group."},"dvtPPGovGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters governance group."},"dvtTreasuryWithdrawal":{"type":"number","format":"double","description":"The drep voting threshold for treasury withdrawals."},"govActionLifetime":{"type":"string","format":"int64","description":"The maximum lifetime of a governance action in epochs, after which it will be considered expired."},"govActionDeposit":{"type":"string","format":"int64","description":"The required deposit for submitting a governance action."},"dRepDeposit":{"type":"string","format":"int64","description":"The deposit required for DRep registration."},"dRepActivity":{"type":"string","format":"int64","description":"The activity period in epochs before a DRep is considered inactive."},"committeeMinSize":{"type":"string","format":"int64","description":"The minimum number of members required for a constitutional committee to function."},"committeeMaxTermLength":{"type":"string","format":"int64","description":"The maximum number of epochs a committee member can serve before their term expires."},"minFeeRefScriptCostPerByte":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The minimum fee charged per byte for reference scripts used in transactions."}]}}}}},"inputs":{"type":"object","description":"Inputs info for building transaction","required":["poolInUtxo","floatPoolInUtxo"],"properties":{"poolInUtxo":{"allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]},{"description":"- UTxO of Fixed Pool, used for input\n- Spending redeemer struct:\n  - Redeemer Indexer: Index for Create loan GA (List of LoanGAPoolIndexer)\n    - Pool In Index: Int - Index of Pool UTxO in inputs\n    - Pool Out Index: Int - Index of Pool UTxO in outputs\n    - LoanGA Out Index: Int - Index of LoanGA UTxO in outputs\n  - Pool In Index: Int - Index of Pool UTxO in inputs\n  - LoanGA In Index: Int - Index of LoanGA UTxO in inputs (Null when Create new loan)\n  - Protocol Script Index: Int - Index of Protocol Script UTxO in reference inputs\n  - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n  - Fee Out Index: Int - Index of Fee UTxO in outputs (Null when Fee = 0)"}]},"floatPoolInUtxo":{"description":"UTxO detail for building Transaction","title":"UTxO model","type":"object","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]},"stakingContractInUtxo":{"description":"UTxO detail for building Transaction","title":"UTxO model","type":"object","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]}}},"outputs":{"type":"object","description":"Outputs info for building transaction","required":["poolOutUtxo","loanGAOutUtxo","floatPoolOutUtxo"],"properties":{"poolOutUtxo":{"description":"UTxO of Fixed Pool","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["supplyToken","supplyYieldToken","circulatingPTSupply","circulatingYTSupply","supplyMaturity","collaterals","baseInterestRate","gradient","maxLoanDuration","activeLoanCount","feeCollected","minBorrowAmount"],"properties":{"supplyToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of supply token of Pool"},"supplyYieldToken":{"type":"string","format":"{policyId}.{assetName}","nullable":true,"description":"Token id of substitute token of supply token"},"circulatingPTSupply":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Pool PT in circulating"},"circulatingYTSupply":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Pool YT in circulating"},"supplyMaturity":{"type":"integer","nullable":false,"description":"Maturity timestamp of Pool"},"collaterals":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","description":"Collateral token with its price and liquidation threshold","required":["collateralToken","liquidationThreshold"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of the Collateral token"},"liquidationThreshold":{"type":"integer","nullable":false,"description":"Liquidation threshold of collateral token in basis points"}}}},"baseInterestRate":{"type":"integer","nullable":false,"description":"Base Interest Rate in basis points"},"gradient":{"type":"integer","nullable":false,"description":"Gradient in basis points"},"maxLoanDuration":{"type":"integer","nullable":false,"description":"Max loan duration in milliseconds"},"activeLoanCount":{"type":"integer","nullable":false,"description":"Number of Active Loan borrowed from Pool"},"feeCollected":{"type":"boolean","nullable":false,"description":"True if the fee has been collected from the pool, false otherwise"},"minBorrowAmount":{"type":"string","format":"bigint","nullable":true,"description":"The minimum borrow amount when create loan"}}}}}]},"loanGAOutUtxo":{"description":"UTxO of Fixed LoanGA","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"title":"Reference script in UTxO","type":"object","properties":{"refScriptCborHex":{"type":"string","nullable":true,"description":"CBOR hex of reference script"},"refScriptHash":{"type":"string","nullable":true,"description":"Script hash of reference script"}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["loanProfitFee","loanAmount"],"properties":{"loanProfitFee":{"type":"string","format":"bigint","nullable":false,"description":"Fee amount (extracted from loan profit) that will be collected at LoanGA Collection","default":"90000000"},"loanAmount":{"type":"string","format":"bigint","nullable":false,"description":"Debt amount of token in LoanGA UTxO","default":"100000000000"}}}}}]},"feeOutUtxo":{"description":"Output UTxO detail for building Transaction","type":"object","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},"floatPoolOutUtxo":{"allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["totalSupply","circulatingDToken","totalBorrow","borrowApy","undistributedFee","interestIndex","interestTime","alternativeSupplyTokens"],"properties":{"totalSupply":{"type":"string","format":"bigint","nullable":false,"description":"Total supply in pool, in base unit"},"circulatingDToken":{"type":"string","format":"bigint","nullable":false,"description":"Total dToken minted - total dToken burned"},"totalBorrow":{"type":"string","format":"bigint","nullable":false,"description":"Total borrow in pool, in base unit"},"borrowRate":{"type":"integer","nullable":false,"description":"Borrow rate in basis point"},"undistributedFee":{"type":"string","format":"bigint","nullable":false,"description":"Protocol fee not distributed for supplier, in base unit"},"interestIndex":{"type":"string","format":"bigint","nullable":false,"description":"Interest index"},"interestTime":{"type":"number","format":"int64","nullable":false,"description":"updated market state timestamp in millisecond"},"alternativeSupplyTokens":{"type":"array","description":"List of alternative supply tokens in pools","items":{"type":"object","required":["token","latestExchangeRateNum","latestExchangeRateDen"],"properties":{"token":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of alternative token"},"latestExchangeRateNum":{"type":"string","format":"bigint","nullable":false,"description":"Numerator of exchange alternative token rate has been captured at the last interest time"},"latestExchangeRateDen":{"type":"string","format":"bigint","nullable":false,"description":"Denominator of exchange qToken rate has been captured at the last interest time"}}}}}}}}]},"stakingContractOutUtxo":{"type":"object","description":"UTxO of Staking Contract contains ADA of users","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["totalSupply","circulatingSToken","validUntil"],"properties":{"totalSupply":{"type":"string","format":"bigint","nullable":false,"description":"total supply of staking contract"},"circulatingSToken":{"type":"string","format":"bigint","nullable":false,"description":"circulating sToken for this staking contract"},"validUntil":{"type":"integer","format":"int64","nullable":false,"description":"The maximum time until which the exchange rate between sADA and ADA is accepted, determinedby the end time of the epoch containing the transaction start time in milliseconds"}}}}}]},"withdrawalFeeOutUtxo":{"description":"Output UTxO detail for building Transaction","type":"object","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}}}},"withdrawal":{"type":"object","description":"Withdrawal info for building transaction, include Reward Address Script Hash, coin and withdrawal redeemer","required":["rewardAddressScriptHash","coin","withdrawalRedeemer"],"properties":{"rewardAddressScriptHash":{"type":"string","format":"bech32","description":"Script Hash of reward address, used for withdrawal","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"Number of ADA to withdrawal","nullable":false},"withdrawalRedeemer":{"type":"object","description":"- Withdrawal Redeemer Struct:\n  - Global Config Index: Int - Index of Global Config UTxO in reference inputs\n  - Oracle Path Indexes: ByteArray(List\\<Int\\>) - List Index of Oracle Path UTxO in reference inputs, convert to ByteArray\n  - Oracle Price Indexes: ByteArray(List\\<OraclePriceIndex\\>) - List Index of Oracle Price UTxO in reference inputs or outputs, group by Oracle Source Type and convert to ByteArray\n    - OraclePriceIndex: <UtxoTarget, OracleType, Index> - Index of Oracle Price UTxO\n      - UtxoTarget: Enum - UTxO in reference inputs or outputs, include:\n        - REF\n        - OUT\n        - IN\n      - OracleType: Enum - Type of Oracle Price UTxO, include:\n        - ORCFAX_FSP\n        - ORCFAX_FS\n        - LIQWID_MARKET_STATE\n        - LIQWID_MARKET_PARAM\n        - LIQWID_ORACLE_V1\n        - LIQWID_ORACLE_V2\n        - DANOGO_FLOAT_POOL\n        - INDIGO\n        - DJED\n        - DANOGO_STAKING\n        - MINSWAP_LP\n        - SPLASH_LP_CFMM_G1\n        - SPLASH_LP_CFMM_G2\n        - SPLASH_LP_CFMM_G3\n        - SPLASH_LP_STABLE\n      - Index: Int - Index of Oracle Price UTxO in reference inputs or outputs\n  - Prices: List\\<OraclePrice\\> - List of prices of collateralToken/borrowToken\n    - OraclePrice: List\\<(CalcType, prices)\\> - Prices of each collateral token\n      - CalcType: Int - 0: Normal, 1: Splash\n  - Borrow Rates: List\\<BorrowRate\\> - List of borrow rates from Yield Protocols associated with Danogo Lending (e.g., Liqwid)","required":["prices"],"properties":{"prices":{"type":"array","minItems":1,"maxItems":50,"description":"List of prices of token pairs (A/B)","items":{"type":"object","required":["borrowToken","oraclePrices"],"properties":{"borrowToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Borrow token"},"oraclePrices":{"type":"array","minItems":1,"maxItems":50,"description":"Prices of each collateral token","items":{"type":"object","required":["collateralToken","priceNum","priceDen"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Collateral token"},"priceNum":{"type":"string","format":"bigint","nullable":true,"description":"Numerator of Collateral token price in Supply token"},"priceDen":{"type":"string","format":"bigint","nullable":true,"description":"Denominator of Collateral token price in Supply token"}}}}}}},"borrowRates":{"type":"array","minItems":1,"maxItems":50,"description":"List of borrow rates from Yield Protocols associated with Danogo Lending (e.g., Liqwid)","items":{"type":"object","properties":{"yieldToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Yield token"},"borrowRate":{"type":"integer","nullable":false,"description":"borrow rate in basis points"}}}}}},"stakeAddress":{"type":"string","format":"bech32","description":"Stake address of staking contract, used for withdrawal if staking contract involved","nullable":true},"stakeRewards":{"type":"string","format":"bigint","nullable":true,"description":"Rewards of stake address in lovelace"}}},"mint":{"type":"object","description":"- Mint info for building transaction with multiAssets\n  - MultiAssets: List token to mint/burn when create loan GA, include:\n    - Loan NFT: NFT token used for loan validity, include in LoanGA UTxO\n    - Float dToken: The dToken is burned when withdrawing from the Float Pool UTxO\n  - Minting redeemer struct:\n    - Redeemer Indexer: Index for Create loan GA\n      - Pool Out Index: Int - Index of Pool UTxO in outputs\n      - LoanGA Out Index: Int - Index of LoanGA UTxO in outputs\n    - Pool In Index: Int - Index of Pool UTxO in inputs\n    - LoanGA In Index: Int - Index of LoanGA UTxO in inputs (Null when Create new loan)\n    - Protocol Script Index: Int - Index of Protocol Script UTxO in reference inputs\n    - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n    - Fee Out Index: Int - Index of Fee UTxO in outputs (Null when Fee = 0)","required":["multiAssets"],"properties":{"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},"referenceInputs":{"type":"array","minItems":1,"maxItems":50,"description":"List of UTxO output reference required to be included in transaction as reference inputs","items":{"type":"object","required":["outRef","type"],"properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","nullable":false,"description":"Output Reference of UTxO"},"type":{"type":"string","enum":["POOL_SCRIPT","LOAN_SCRIPT","ORACLE_PRICE_SCRIPT","GLOBAL_CONFIG","ORACLE_PATH","ORACLE_PRICE","PROTOCOL_SCRIPT","PROTOCOL_CONFIG","ORCFAX_FSP","ORCFAX_FS","DANOGO_FLOAT_POOL","INDIGO","DJED","DANOGO_STAKING","MINSWAP_LP"],"description":"Type of UTxO OutRef, used for reference inputs and indexer in redeemer"}}}}}}}}]}}}},"default":{"description":"An unexpected error response","content":{"application/json":{"schema":{"title":"runtimeError","allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"error":{"type":"string","deprecated":true,"description":"do NOT use this field anymore! Use code & message instead!"},"details":{"type":"array","items":{"title":"protobufAny","type":"object","properties":{"typeUrl":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","description":"Must be a valid serialized protocol buffer of the above specified type.","format":"byte"}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n  Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n  Example 4: Pack and unpack a message in Go\n\n      foo := &pb.Foo{...}\n      any, err := ptypes.MarshalAny(foo)\n      ...\n      foo := &pb.Foo{}\n      if err := ptypes.UnmarshalAny(any, foo); err != nil {\n        ...\n      }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"}}}}]}}}}}}}}}
```


# Utility

## Calculate max loan amount

> \- Calculate max loan amount of a pool, based on collateral amount and health factor

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"tags":[{"name":"Utility"}],"servers":[{"url":"https://danogo-lending.preview.tekoapis.net","description":"Preview"},{"url":"https://danogo-lending.tekoapis.com","description":"Mainnet"}],"paths":{"/api/v1/calculate-max-loan-amount":{"post":{"tags":["Utility"],"summary":"Calculate max loan amount","description":"- Calculate max loan amount of a pool, based on collateral amount and health factor","operationId":"calculateMaxLoanAmount","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["loanToken","healthFactor","collateralTokens"],"properties":{"loanToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of loan token"},"healthFactor":{"type":"number","format":"double","nullable":false,"description":"Health factor of this loan"},"collateralTokens":{"type":"array","minItems":1,"maxItems":50,"description":"List of collaterals used by Loan","items":{"type":"object","required":["collateralToken","collateralAmount","liquidationThreshold"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Collateral token"},"collateralAmount":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Collateral token"},"liquidationThreshold":{"type":"integer","nullable":false,"description":"Liquidation threshold of collateral token in basis points"}}}},"borrowRate":{"type":"integer","nullable":true,"description":"Borrow rate of this Pool in bais point, used for calculating max loan amount of Fixed Pool"},"loanDuration":{"type":"integer","nullable":true,"description":"Loan duration in days, used for calculating max loan amount of Fixed Pool"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"data":{"type":"object","required":["maxBorrowAmount","maxLoanAmount"],"properties":{"maxBorrowAmount":{"type":"string","format":"bigint","nullable":false,"description":"Max borrow amount user can borrow, in base unit"},"maxLoanAmount":{"type":"string","format":"bigint","nullable":false,"description":"Max loan amount user need to paid when repaying loan, in base unit"}}}}}]}}}},"default":{"description":"An unexpected error response","content":{"application/json":{"schema":{"title":"runtimeError","allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"error":{"type":"string","deprecated":true,"description":"do NOT use this field anymore! Use code & message instead!"},"details":{"type":"array","items":{"title":"protobufAny","type":"object","properties":{"typeUrl":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","description":"Must be a valid serialized protocol buffer of the above specified type.","format":"byte"}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n  Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n  Example 4: Pack and unpack a message in Go\n\n      foo := &pb.Foo{...}\n      any, err := ptypes.MarshalAny(foo)\n      ...\n      foo := &pb.Foo{}\n      if err := ptypes.UnmarshalAny(any, foo); err != nil {\n        ...\n      }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"}}}}]}}}}}}}}}
```

## Calculate health factor

> \- Calculate health factor of a loan, based on loan amount and collateral amount

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"tags":[{"name":"Utility"}],"servers":[{"url":"https://danogo-lending.preview.tekoapis.net","description":"Preview"},{"url":"https://danogo-lending.tekoapis.com","description":"Mainnet"}],"paths":{"/api/v1/calculate-health-factor":{"post":{"tags":["Utility"],"summary":"Calculate health factor","description":"- Calculate health factor of a loan, based on loan amount and collateral amount","operationId":"calculateHealthFactor","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["loanToken","loanAmount","collateralTokens"],"properties":{"loanToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of loan token"},"loanAmount":{"type":"string","format":"bigint","nullable":false,"description":"Loan amount"},"collateralTokens":{"type":"array","minItems":1,"maxItems":50,"description":"List of collaterals used by Loan","items":{"type":"object","required":["collateralToken","collateralAmount","liquidationThreshold"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Collateral token"},"collateralAmount":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Collateral token"},"liquidationThreshold":{"type":"integer","nullable":false,"description":"Liquidation threshold of collateral token in basis points"}}}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"data":{"type":"object","required":["healthFactor","totalCollateralAmount"],"properties":{"healthFactor":{"type":"number","format":"double","nullable":false,"description":"Health factor collateraled based on borrow amount and collateral amount"},"totalCollateralAmount":{"type":"string","format":"bigint","nullable":false,"description":"Total collateral amount in base unit"}}}}}]}}}},"default":{"description":"An unexpected error response","content":{"application/json":{"schema":{"title":"runtimeError","allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"error":{"type":"string","deprecated":true,"description":"do NOT use this field anymore! Use code & message instead!"},"details":{"type":"array","items":{"title":"protobufAny","type":"object","properties":{"typeUrl":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","description":"Must be a valid serialized protocol buffer of the above specified type.","format":"byte"}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n  Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n  Example 4: Pack and unpack a message in Go\n\n      foo := &pb.Foo{...}\n      any, err := ptypes.MarshalAny(foo)\n      ...\n      foo := &pb.Foo{}\n      if err := ptypes.UnmarshalAny(any, foo); err != nil {\n        ...\n      }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"}}}}]}}}}}}}}}
```


# Models

## The FixedPoolUTxO object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"FixedPoolUTxO":{"description":"UTxO of Fixed Pool","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["supplyToken","supplyYieldToken","circulatingPTSupply","circulatingYTSupply","supplyMaturity","collaterals","baseInterestRate","gradient","maxLoanDuration","activeLoanCount","feeCollected","minBorrowAmount"],"properties":{"supplyToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of supply token of Pool"},"supplyYieldToken":{"type":"string","format":"{policyId}.{assetName}","nullable":true,"description":"Token id of substitute token of supply token"},"circulatingPTSupply":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Pool PT in circulating"},"circulatingYTSupply":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Pool YT in circulating"},"supplyMaturity":{"type":"integer","nullable":false,"description":"Maturity timestamp of Pool"},"collaterals":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","description":"Collateral token with its price and liquidation threshold","required":["collateralToken","liquidationThreshold"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of the Collateral token"},"liquidationThreshold":{"type":"integer","nullable":false,"description":"Liquidation threshold of collateral token in basis points"}}}},"baseInterestRate":{"type":"integer","nullable":false,"description":"Base Interest Rate in basis points"},"gradient":{"type":"integer","nullable":false,"description":"Gradient in basis points"},"maxLoanDuration":{"type":"integer","nullable":false,"description":"Max loan duration in milliseconds"},"activeLoanCount":{"type":"integer","nullable":false,"description":"Number of Active Loan borrowed from Pool"},"feeCollected":{"type":"boolean","nullable":false,"description":"True if the fee has been collected from the pool, false otherwise"},"minBorrowAmount":{"type":"string","format":"bigint","nullable":true,"description":"The minimum borrow amount when create loan"}}}}}]}}}}
```

## The FixedLoanUTxO object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"FixedLoanUTxO":{"description":"UTxO of Fixed Loan, borrower must add collateral to multiAssets","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["loanProfitFee","loanAmount","loanOwnerNftName"],"properties":{"loanProfitFee":{"type":"string","format":"bigint","nullable":true,"description":"Loan profit fee in datum of Loan UTxO, set when building the Tx"},"loanAmount":{"type":"string","format":"bigint","nullable":false,"description":"Debt amount of token in Loan UTxO"},"loanMaturity":{"type":"number","format":"int64","nullable":true,"description":"Maturity timestamp of Loan in milliseconds, set to loan maturity when building the Tx"},"loanOwnerNftName":{"type":"string","format":"{assetName}","nullable":false,"description":"Token id asset name of Loan Owner NFT"}}}}}]}}}}
```

## The FixedLoanGAUTxO object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"FixedLoanGAUTxO":{"description":"UTxO of Fixed LoanGA","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"title":"Reference script in UTxO","type":"object","properties":{"refScriptCborHex":{"type":"string","nullable":true,"description":"CBOR hex of reference script"},"refScriptHash":{"type":"string","nullable":true,"description":"Script hash of reference script"}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["loanProfitFee","loanAmount"],"properties":{"loanProfitFee":{"type":"string","format":"bigint","nullable":false,"description":"Fee amount (extracted from loan profit) that will be collected at LoanGA Collection","default":"90000000"},"loanAmount":{"type":"string","format":"bigint","nullable":false,"description":"Debt amount of token in LoanGA UTxO","default":"100000000000"}}}}}]}}}}
```

## The FloatPoolUTxO object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"FloatPoolUTxO":{"allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["totalSupply","circulatingDToken","totalBorrow","borrowApy","undistributedFee","interestIndex","interestTime","alternativeSupplyTokens"],"properties":{"totalSupply":{"type":"string","format":"bigint","nullable":false,"description":"Total supply in pool, in base unit"},"circulatingDToken":{"type":"string","format":"bigint","nullable":false,"description":"Total dToken minted - total dToken burned"},"totalBorrow":{"type":"string","format":"bigint","nullable":false,"description":"Total borrow in pool, in base unit"},"borrowRate":{"type":"integer","nullable":false,"description":"Borrow rate in basis point"},"undistributedFee":{"type":"string","format":"bigint","nullable":false,"description":"Protocol fee not distributed for supplier, in base unit"},"interestIndex":{"type":"string","format":"bigint","nullable":false,"description":"Interest index"},"interestTime":{"type":"number","format":"int64","nullable":false,"description":"updated market state timestamp in millisecond"},"alternativeSupplyTokens":{"type":"array","description":"List of alternative supply tokens in pools","items":{"type":"object","required":["token","latestExchangeRateNum","latestExchangeRateDen"],"properties":{"token":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of alternative token"},"latestExchangeRateNum":{"type":"string","format":"bigint","nullable":false,"description":"Numerator of exchange alternative token rate has been captured at the last interest time"},"latestExchangeRateDen":{"type":"string","format":"bigint","nullable":false,"description":"Denominator of exchange qToken rate has been captured at the last interest time"}}}}}}}}]}}}}
```

## The FloatLoanUTxO object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"FloatLoanUTxO":{"description":"UTxO of Float Loan, borrower must add collateral to multiAssets","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["loanOwnerToken","loanToken","loanAmount","initialInterestIndex"],"properties":{"loanOwnerToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Loan Owner NFT, null if loan was liquidated"},"loanToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Loan Token"},"loanAmount":{"type":"string","format":"bigint","nullable":false,"description":"loan amount in lovelace"},"initialInterestIndex":{"type":"string","format":"bigint","nullable":false,"description":"captured interest index when create loan or modify loan"}}}}}]}}}}
```

## The StakingContractUTxO object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"StakingContractUTxO":{"type":"object","description":"UTxO of Staking Contract contains ADA of users","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["totalSupply","circulatingSToken","validUntil"],"properties":{"totalSupply":{"type":"string","format":"bigint","nullable":false,"description":"total supply of staking contract"},"circulatingSToken":{"type":"string","format":"bigint","nullable":false,"description":"circulating sToken for this staking contract"},"validUntil":{"type":"integer","format":"int64","nullable":false,"description":"The maximum time until which the exchange rate between sADA and ADA is accepted, determinedby the end time of the epoch containing the transaction start time in milliseconds"}}}}}]}}}}
```

## The OracleWitdrawalRedeemerStruct object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"OracleWitdrawalRedeemerStruct":{"type":"object","description":"- Withdrawal Redeemer Struct:\n  - Global Config Index: Int - Index of Global Config UTxO in reference inputs\n  - Oracle Path Indexes: ByteArray(List\\<Int\\>) - List Index of Oracle Path UTxO in reference inputs, convert to ByteArray\n  - Oracle Price Indexes: ByteArray(List\\<OraclePriceIndex\\>) - List Index of Oracle Price UTxO in reference inputs or outputs, group by Oracle Source Type and convert to ByteArray\n    - OraclePriceIndex: <UtxoTarget, OracleType, Index> - Index of Oracle Price UTxO\n      - UtxoTarget: Enum - UTxO in reference inputs or outputs, include:\n        - REF\n        - OUT\n        - IN\n      - OracleType: Enum - Type of Oracle Price UTxO, include:\n        - ORCFAX_FSP\n        - ORCFAX_FS\n        - LIQWID_MARKET_STATE\n        - LIQWID_MARKET_PARAM\n        - LIQWID_ORACLE_V1\n        - LIQWID_ORACLE_V2\n        - DANOGO_FLOAT_POOL\n        - INDIGO\n        - DJED\n        - DANOGO_STAKING\n        - MINSWAP_LP\n        - SPLASH_LP_CFMM_G1\n        - SPLASH_LP_CFMM_G2\n        - SPLASH_LP_CFMM_G3\n        - SPLASH_LP_STABLE\n      - Index: Int - Index of Oracle Price UTxO in reference inputs or outputs\n  - Prices: List\\<OraclePrice\\> - List of prices of collateralToken/borrowToken\n    - OraclePrice: List\\<(CalcType, prices)\\> - Prices of each collateral token\n      - CalcType: Int - 0: Normal, 1: Splash\n  - Borrow Rates: List\\<BorrowRate\\> - List of borrow rates from Yield Protocols associated with Danogo Lending (e.g., Liqwid)","required":["prices"],"properties":{"prices":{"type":"array","minItems":1,"maxItems":50,"description":"List of prices of token pairs (A/B)","items":{"type":"object","required":["borrowToken","oraclePrices"],"properties":{"borrowToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Borrow token"},"oraclePrices":{"type":"array","minItems":1,"maxItems":50,"description":"Prices of each collateral token","items":{"type":"object","required":["collateralToken","priceNum","priceDen"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Collateral token"},"priceNum":{"type":"string","format":"bigint","nullable":true,"description":"Numerator of Collateral token price in Supply token"},"priceDen":{"type":"string","format":"bigint","nullable":true,"description":"Denominator of Collateral token price in Supply token"}}}}}}},"borrowRates":{"type":"array","minItems":1,"maxItems":50,"description":"List of borrow rates from Yield Protocols associated with Danogo Lending (e.g., Liqwid)","items":{"type":"object","properties":{"yieldToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Yield token"},"borrowRate":{"type":"integer","nullable":false,"description":"borrow rate in basis points"}}}}}}}}}
```

## The OutputUTxO object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"OutputUTxO":{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}}}}}
```

## The MultiAssets object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"MultiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}}}
```

## The MintMultiAssets object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"MintMultiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets","redeemerType"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}},"redeemerType":{"type":"string","enum":["FIXED","FLOAT","FLOAT","STAKING"],"description":"Redeemer type, used when building the transaction; each type requires a different redeemer structure"}}}}}}}
```

## The GovActionParams object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"GovActionParams":{"type":"object","description":"Parameters for Gov Action, used when building the transaction","properties":{"lastGuardrails":{"type":"string","description":"The optional guardrails script defined in the constitution. This script is executed by the ledger alongside the hard-coded ledger rules and applies only to PROTOCOL_PARAMETER_CHANGE and TREASURY_WITHDRAWALS proposals.\n"},"lastGuardrailsScriptOutRef":{"type":"string","description":"The guardrails script has been put on a UTxO so that it can be used as reference script in Treasury Withdrawal and Protocol Parameter Change proposals. [See more](https://book.world.dev.cardano.org/env-mainnet.html#guardrails-reference-script-utxo)"},"lastEnactedNoConfidenceGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type NO_CONFIDENCE."},"lastEnactedUpdateCommitteeGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type UPDATE_COMMITTEE."},"lastEnactedNewConstitutionGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type NEW_CONSTITUTION."},"lastEnactedHardForkGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type HARD_FORK_INITIATION."},"lastEnactedProtocolParamChangeGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type PROTOCOL_PARAMETER_CHANGE."},"currentProtocolVersion":{"type":"string","description":"The current protocol version in Cardano."},"committeeVotingThreshold":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The voting threshold for committee approval"}]},"protocolParameters":{"title":"Cardano Protocol Parameters","type":"object","properties":{"maxBlockBodySize":{"type":"string","format":"int64","description":"Maximum size of a block body in bytes."},"maxTxSize":{"type":"string","format":"int64","description":"Maximum size of a transaction in bytes."},"maxBlockHeaderSize":{"type":"string","format":"int64","description":"Maximum size of a block header in bytes."},"maxValueSize":{"type":"string","format":"int64","description":"Maximum value size in bytes."},"maxTxExecutionMemUnits":{"type":"string","format":"int64","description":"Maximum memory units in a single transaction"},"maxTxExecutionStepUnits":{"type":"string","format":"int64","description":"Maximum step units in a single transaction"},"maxBlockExecutionMemUnits":{"type":"string","format":"int64","description":"Maximum memory units in a single block"},"maxBlockExecutionStepUnits":{"type":"string","format":"int64","description":"Maximum step units in a single block"},"maxCollateralInputs":{"type":"string","format":"int64","description":"Maximum number of collateral inputs in a single transaction."},"txFeePerByte":{"type":"string","format":"int64","description":"The fee per byte for transactions."},"txFeeFixed":{"type":"string","format":"int64","description":"The fixed fee for transactions."},"stakeAddressDeposit":{"type":"string","format":"int64","description":"The deposit required for stake key registration."},"stakePoolDeposit":{"type":"string","format":"int64","description":"The deposit required for pool registration."},"monetaryExpansion":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The rate of monetary expansion."}]},"treasuryCut":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The rate at which the treasury will grow over time."}]},"minPoolCost":{"type":"string","format":"int64","description":"The minimum cost to maintain a pool."},"utxoCostPerByte":{"type":"string","format":"int64","description":"The minimum Lovelace deposit per byte for serialized UTxOs."},"executionMemUnitPrices":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"Price for memory usage in script execution."}]},"executionStepUnitPrices":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"Price for step execution in script execution."}]},"poolPledgeInfluence":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The influence of pool pledge on governance actions."}]},"poolRetireMaxEpoch":{"type":"string","format":"int64","description":"The maximum epoch for pool retirement."},"stakePoolTargetNum":{"type":"string","format":"int64","description":"The desired number of stake pools in the system."},"costModels":{"description":"Cost model data for different versions of Plutus scripts.","type":"object","properties":{"plutusV1":{"type":"array","description":"The cost model for Plutus v1 scripts, typically containing 166 integers representing resource usage costs.","items":{"type":"integer"}},"plutusV2":{"type":"array","description":"The cost model for Plutus v2 scripts, typically containing 175 integers representing resource usage costs.","items":{"type":"integer"}},"plutusV3":{"type":"array","description":"The cost model for Plutus v3 scripts, typically containing 223 integers representing resource usage costs.","items":{"type":"integer"}}}},"collateralPercentage":{"type":"string","format":"int64","description":"The percentage of collateral required for scripts."},"pvtMotionNoConfidence":{"type":"number","format":"double","description":"The pool voting threshold for a motion of no confidence."},"pvtCommitteeNormal":{"type":"number","format":"double","description":"The pool voting threshold for constitutional committee decisions."},"pvtCommitteeNoConfidence":{"type":"number","format":"double","description":"The pool voting threshold for constitutional committee actions under no confidence."},"pvtHardForkInitiation":{"type":"number","format":"double","description":"The pool voting threshold for approving a hard fork initiation."},"pvtPPSecurityGroup":{"type":"number","format":"double","description":"The pool voting threshold for changes to the protocol parameters security group."},"dvtMotionNoConfidence":{"type":"number","format":"double","description":"The drep voting threshold for a motion of no confidence."},"dvtCommitteeNormal":{"type":"number","format":"double","description":"The drep voting threshold for constitutional committee decisions."},"dvtCommitteeNoConfidence":{"type":"number","format":"double","description":"The drep voting threshold for constitutional committee actions under no confidence."},"dvtUpdateToConstitution":{"type":"number","format":"double","description":"The drep voting threshold for approving constitutional changes."},"dvtHardForkInitiation":{"type":"number","format":"double","description":"The drep voting threshold for approving a hard fork."},"dvtPPNetworkGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters network group."},"dvtPPEconomicGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters economic group."},"dvtPPTechnicalGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters technical group."},"dvtPPGovGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters governance group."},"dvtTreasuryWithdrawal":{"type":"number","format":"double","description":"The drep voting threshold for treasury withdrawals."},"govActionLifetime":{"type":"string","format":"int64","description":"The maximum lifetime of a governance action in epochs, after which it will be considered expired."},"govActionDeposit":{"type":"string","format":"int64","description":"The required deposit for submitting a governance action."},"dRepDeposit":{"type":"string","format":"int64","description":"The deposit required for DRep registration."},"dRepActivity":{"type":"string","format":"int64","description":"The activity period in epochs before a DRep is considered inactive."},"committeeMinSize":{"type":"string","format":"int64","description":"The minimum number of members required for a constitutional committee to function."},"committeeMaxTermLength":{"type":"string","format":"int64","description":"The maximum number of epochs a committee member can serve before their term expires."},"minFeeRefScriptCostPerByte":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The minimum fee charged per byte for reference scripts used in transactions."}]}}}}}}}}
```

## The paginationRequestBody object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"paginationRequestBody":{"type":"object","properties":{"page":{"type":"integer","default":1,"description":"Current page, for high performance try to use pagination.offset instead!"},"pageSize":{"type":"integer","nullable":false,"description":"Page size"}}}}}}
```

## The baseApiResponse object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"baseApiResponse":{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}}}}}
```

## The protobufAny object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"protobufAny":{"title":"protobufAny","type":"object","properties":{"typeUrl":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","description":"Must be a valid serialized protocol buffer of the above specified type.","format":"byte"}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n  Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n  Example 4: Pack and unpack a message in Go\n\n      foo := &pb.Foo{...}\n      any, err := ptypes.MarshalAny(foo)\n      ...\n      foo := &pb.Foo{}\n      if err := ptypes.UnmarshalAny(any, foo); err != nil {\n        ...\n      }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"}}}}
```

## The baseApiErrorProto object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"baseApiErrorProto":{"title":"runtimeError","allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"error":{"type":"string","deprecated":true,"description":"do NOT use this field anymore! Use code & message instead!"},"details":{"type":"array","items":{"title":"protobufAny","type":"object","properties":{"typeUrl":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","description":"Must be a valid serialized protocol buffer of the above specified type.","format":"byte"}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n  Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n  Example 4: Pack and unpack a message in Go\n\n      foo := &pb.Foo{...}\n      any, err := ptypes.MarshalAny(foo)\n      ...\n      foo := &pb.Foo{}\n      if err := ptypes.UnmarshalAny(any, foo); err != nil {\n        ...\n      }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"}}}}]}}}}
```

## The paginationResponse object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"paginationResponse":{"type":"object","properties":{"page":{"type":"integer","format":"int32","description":"Current page, start from 1","nullable":false},"pageSize":{"type":"integer","format":"int32","description":"Page size","nullable":false},"total":{"type":"integer","format":"int32","description":"Total items","nullable":false}},"required":["page","pageSize","total"]}}}}
```

## The output\_utxo object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"output_utxo":{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}}}}}
```

## The utxo object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"utxo":{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]}}}}
```

## The token-metadata object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"token-metadata":{"title":"tokenMetadata","type":"object","description":"CIP-25 token metadata","required":["name","image"],"properties":{"name":{"type":"string","description":"Display name of token","nullable":false},"image":{"type":"string","description":"Image URL of token on ipfs","nullable":false},"description":{"type":"string","description":"Description of token","nullable":true}}}}}}
```

## The Ratio object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"Ratio":{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}}}}}
```

## The CostModels object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"CostModels":{"description":"Cost model data for different versions of Plutus scripts.","type":"object","properties":{"plutusV1":{"type":"array","description":"The cost model for Plutus v1 scripts, typically containing 166 integers representing resource usage costs.","items":{"type":"integer"}},"plutusV2":{"type":"array","description":"The cost model for Plutus v2 scripts, typically containing 175 integers representing resource usage costs.","items":{"type":"integer"}},"plutusV3":{"type":"array","description":"The cost model for Plutus v3 scripts, typically containing 223 integers representing resource usage costs.","items":{"type":"integer"}}}}}}}
```

## The ProtocolParameters object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"ProtocolParameters":{"title":"Cardano Protocol Parameters","type":"object","properties":{"maxBlockBodySize":{"type":"string","format":"int64","description":"Maximum size of a block body in bytes."},"maxTxSize":{"type":"string","format":"int64","description":"Maximum size of a transaction in bytes."},"maxBlockHeaderSize":{"type":"string","format":"int64","description":"Maximum size of a block header in bytes."},"maxValueSize":{"type":"string","format":"int64","description":"Maximum value size in bytes."},"maxTxExecutionMemUnits":{"type":"string","format":"int64","description":"Maximum memory units in a single transaction"},"maxTxExecutionStepUnits":{"type":"string","format":"int64","description":"Maximum step units in a single transaction"},"maxBlockExecutionMemUnits":{"type":"string","format":"int64","description":"Maximum memory units in a single block"},"maxBlockExecutionStepUnits":{"type":"string","format":"int64","description":"Maximum step units in a single block"},"maxCollateralInputs":{"type":"string","format":"int64","description":"Maximum number of collateral inputs in a single transaction."},"txFeePerByte":{"type":"string","format":"int64","description":"The fee per byte for transactions."},"txFeeFixed":{"type":"string","format":"int64","description":"The fixed fee for transactions."},"stakeAddressDeposit":{"type":"string","format":"int64","description":"The deposit required for stake key registration."},"stakePoolDeposit":{"type":"string","format":"int64","description":"The deposit required for pool registration."},"monetaryExpansion":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The rate of monetary expansion."}]},"treasuryCut":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The rate at which the treasury will grow over time."}]},"minPoolCost":{"type":"string","format":"int64","description":"The minimum cost to maintain a pool."},"utxoCostPerByte":{"type":"string","format":"int64","description":"The minimum Lovelace deposit per byte for serialized UTxOs."},"executionMemUnitPrices":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"Price for memory usage in script execution."}]},"executionStepUnitPrices":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"Price for step execution in script execution."}]},"poolPledgeInfluence":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The influence of pool pledge on governance actions."}]},"poolRetireMaxEpoch":{"type":"string","format":"int64","description":"The maximum epoch for pool retirement."},"stakePoolTargetNum":{"type":"string","format":"int64","description":"The desired number of stake pools in the system."},"costModels":{"description":"Cost model data for different versions of Plutus scripts.","type":"object","properties":{"plutusV1":{"type":"array","description":"The cost model for Plutus v1 scripts, typically containing 166 integers representing resource usage costs.","items":{"type":"integer"}},"plutusV2":{"type":"array","description":"The cost model for Plutus v2 scripts, typically containing 175 integers representing resource usage costs.","items":{"type":"integer"}},"plutusV3":{"type":"array","description":"The cost model for Plutus v3 scripts, typically containing 223 integers representing resource usage costs.","items":{"type":"integer"}}}},"collateralPercentage":{"type":"string","format":"int64","description":"The percentage of collateral required for scripts."},"pvtMotionNoConfidence":{"type":"number","format":"double","description":"The pool voting threshold for a motion of no confidence."},"pvtCommitteeNormal":{"type":"number","format":"double","description":"The pool voting threshold for constitutional committee decisions."},"pvtCommitteeNoConfidence":{"type":"number","format":"double","description":"The pool voting threshold for constitutional committee actions under no confidence."},"pvtHardForkInitiation":{"type":"number","format":"double","description":"The pool voting threshold for approving a hard fork initiation."},"pvtPPSecurityGroup":{"type":"number","format":"double","description":"The pool voting threshold for changes to the protocol parameters security group."},"dvtMotionNoConfidence":{"type":"number","format":"double","description":"The drep voting threshold for a motion of no confidence."},"dvtCommitteeNormal":{"type":"number","format":"double","description":"The drep voting threshold for constitutional committee decisions."},"dvtCommitteeNoConfidence":{"type":"number","format":"double","description":"The drep voting threshold for constitutional committee actions under no confidence."},"dvtUpdateToConstitution":{"type":"number","format":"double","description":"The drep voting threshold for approving constitutional changes."},"dvtHardForkInitiation":{"type":"number","format":"double","description":"The drep voting threshold for approving a hard fork."},"dvtPPNetworkGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters network group."},"dvtPPEconomicGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters economic group."},"dvtPPTechnicalGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters technical group."},"dvtPPGovGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters governance group."},"dvtTreasuryWithdrawal":{"type":"number","format":"double","description":"The drep voting threshold for treasury withdrawals."},"govActionLifetime":{"type":"string","format":"int64","description":"The maximum lifetime of a governance action in epochs, after which it will be considered expired."},"govActionDeposit":{"type":"string","format":"int64","description":"The required deposit for submitting a governance action."},"dRepDeposit":{"type":"string","format":"int64","description":"The deposit required for DRep registration."},"dRepActivity":{"type":"string","format":"int64","description":"The activity period in epochs before a DRep is considered inactive."},"committeeMinSize":{"type":"string","format":"int64","description":"The minimum number of members required for a constitutional committee to function."},"committeeMaxTermLength":{"type":"string","format":"int64","description":"The maximum number of epochs a committee member can serve before their term expires."},"minFeeRefScriptCostPerByte":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The minimum fee charged per byte for reference scripts used in transactions."}]}}}}}}
```

## The utxo-ref-script object

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"components":{"schemas":{"utxo-ref-script":{"title":"Reference script in UTxO","type":"object","properties":{"refScriptCborHex":{"type":"string","nullable":true,"description":"CBOR hex of reference script"},"refScriptHash":{"type":"string","nullable":true,"description":"Script hash of reference script"}}}}}}
```


# Concentrated Liquidity Pool Integration\_BK

## Purpose

Guide on how to Build Transaction Swap Concentrated Pool Token:

* Example transaction: [`https://preprod.cardanoscan.io/transaction/04d7b78eed6960c51db4e0128304225469db8bb45277d9278717749f50b19271`](https://preprod.cardanoscan.io/transaction/04d7b78eed6960c51db4e0128304225469db8bb45277d9278717749f50b19271)

## Steps to Build a Transaction Swap Token

{% stepper %}
{% step %}

### Retrieve Necessary Parameters

Use the APIs to retrieve the necessary parameters for the Token Swap operation.
{% endstep %}

{% step %}

### Build the Redeemer Structure

**Concentrated ExchangeActionRedeemer Structure:**

To optimize data size and allow one transaction (txn) to swap across multiple pools simultaneously, the Redeemer is a ByteArray, where each field has a defined index and byte size.

* ExchangeActionRedeemer structure for Token Swap:

```rust
pub type ExchangeActionRedeemer {
    in_idx: Int, // 1 byte: pool or staking
    action: ExchangeAction // 1 byte
}

pub type ExchangeAction {
    CreatePool(CreatePoolParams)
    // platform_fee_out_idx > 0 if platform_fee_X/Y > 0
    ModifyLiquidity(Int, List<ModifyLiquidityParams>)
    // (UTxOType, LicenseIdx)
    WithdrawPlatformFee((Int, Int) ,List<WithdrawPlatformFeeParams>)
    Swap(List<SwapParams>)
    // platfrom_fee_out_idx
    ClaimUndefined((Int, Int) ,List<ClaimUndefinedParams>)
    DelegatePool
}

type SwapParams {
    pool_in_idx: Int, // 1 byte
    pool_out_idx: Int, // 1 byte
    delta_amount: Int, // 32 byte (Int256)
}
```

* Diagnostic Notation format:

```
h'0103...' // Swap Action = 03
```

* CBOR format:

```
  58240103... // 36 bytes (<in_idx><action><pool_in_idx><pool_out_idx><delta_amount>)
```

{% endstep %}

{% step %}

### Create the Transaction

Use the retrieved parameters to create the token swap transaction.

* Note: To minimize DDoS attacks in multi-hop pools, each pool, when swapped, will collect ADA fees according to protocol\_config.swap\_fee and add them to the Pool Datum:

  ```
  pool_out_datum.total_swap_fee=pool_in_datum.total_swap_fee+protocol_config.swap_fee
  ```
* If swap\_fee = 0, no fee will be charged.
* The above fee is updated by Admin NFT.

{% stepper %}
{% step %}

#### Validity range

* Ensure the time-to-live (TTL) <=6 minutes.
  {% endstep %}

{% step %}

#### Input

* Note: The `outRef`, `address`, `coin`, and `multiAssets` information is fully returned by the API.
  * PoolInUtxo: The pool you intend to swap tokens with.
    * Spend Redeemer: Build the redeemer according to the **ExchangeActionRedeemer** Swap structure for Concentrated Pool, ensuring the specified indices are correct.
    * The input Pool UTxO must have the valid PoolNFT:
      * pool\_in\_asset\[PoolNFT] = 1
        {% endstep %}

{% step %}

#### Output

* PoolOutUtxo: The output of the pool after the swap.
  * All information for the pool output UTxO is fully returned by the API.
  * The pool datum structure must adhere to the correct order:

```
type PoolDatum {
    // Pool liquidity pair used for trading
    token_X: TupleAsset,
    token_Y: TupleAsset,
    //
    lp_fee_rate: Basis, // LP fee decided by pool creator
    platform_fee_X: Int, // platform fee accumulated on each swap transaction collected in token X
    platform_fee_Y: Int, // platform fee accumulated on each swap transaction collected in token Y
    total_swap_fee: Int, // total swap_fee (ADA) accumulated
    // to save costs, onchain will let offchain calculate sqrt price
    sqrt_lower_price: PRational,
    sqrt_upper_price: PRational,
    // min X, min Y to avoid DDOS when ModifyLiquidity and Swap
    min_x_change: Int,
    min_y_change: Int,
    circulating_lp_token: Int, // current lp token in circulation, changed when supply/withdraw liquidity
    last_withdraw_epoch: Int // the last epoch when a withdrawal was made from the pool
}
```

* Diagnostic Notation format:

```
24_0(<<121_0([_
     [_
         h'9a614be30284aa88eb845da7657b5d0a235f1b95628b23c08050d502',
         h'6655534441',
     ],
     [_
         h'834a15101873b4e1ddfaa830df46792913995d8738dcde34eda27905',
         h'665553444d',
     ],
     0,
     0,
     0,
     121_0([_ 15811388300841898_3, 10000000000000000_3]),
     121_0([_ 17320508075688772_3, 10000000000000000_3]),
     1090866_2,
     399256_2,
     10000000_2,
     65339_1,
])>>)
```

{% endstep %}

{% step %}

#### Reference Input

* Add all reference inputs from [SDK](https://github.com/danogo-finance/clmm-sdk) .
  {% endstep %}

{% step %}

#### Withdrawal

* **Withdraw Redeemer**:
  * Add a withdrawal to the reward address with the reward amount from [SDK](https://github.com/danogo-finance/clmm-sdk).
  * The reward redeemer has the **ExchangeActionRedeemer** structure.
* **Withdraw Staking Reward**: Must add staking withdrawal if the staking reward amount is greater than 0.
  * Staking reward address with the reward amount from [SDK](https://github.com/danogo-finance/clmm-sdk).
  * Staking redeemer: Built according to the **ExchangeActionRedeemer** structure.
    {% endstep %}
    {% endstepper %}

**Note**: After sorting the inputs and reference inputs according to the chain's sort order, ensure the correct indices are used when specifying them in the redeemers.
{% endstep %}
{% endstepper %}


# Concentrated Liquidity Pool Integration 1

{% stepper %}
{% step %}

### Retrieve Necessary Parameters

Use the APIs to retrieve the necessary parameters for the Token Swap operation.

Example transaction: <https://preprod.cardanoscan.io/transaction/dbc4653b23fa52c11d6f657141bc32c56818481dc0796e1d65526dd35f382005>
{% endstep %}

{% step %}

### Build the Redeemer Structure

To optimize data size and allow one transaction to swap across multiple pools simultaneously, the Redeemer is a ByteArray, where each field has a defined index and byte size.

Concentrated ExchangeActionRedeemer Structure:

{% code title="" %}

```
pub type ExchangeActionRedeemer {
    in_idx: Int, // 1 byte: pool or staking
    action: ExchangeAction // 1 byte
}

pub type ExchangeAction {
  CreatePool(CreatePoolParams)
    // platform_fee_out_idx > 0 if platform_fee_X/Y > 0
    ModifyLiquidity(Int, List<ModifyLiquidityParams>)
    // (UTxOType, LicenseIdx)
    WithdrawPlatformFee((Int, Int) ,List<WithdrawPlatformFeeParams>)
    Swap(List<SwapParams>)
    // platfrom_fee_out_idx
    ClaimUndefined((Int, Int) ,List<ClaimUndefinedParams>)
    DelegatePool
}

type SwapParams {
    pool_in_idx: Int, // 1 byte
    pool_out_idx: Int, // 1 byte
    delta_amount: Int, // 32 byte (Int256)
}
```

{% endcode %}

* Diagnostic Notation format:

```
h'0103...' // Swap Action = 03
```

* CBOR format:

```
58240103... // 36 bytes (<in_idx><action><pool_in_idx><pool_out_idx><delta_amount>)
```

{% endstep %}

{% step %}

### Create the Transaction

Use the retrieved parameters to create the token swap transaction.

{% stepper %}
{% step %}

#### Validity range

* Set the validity range for the transaction.
* Ensure the time-to-live (TTL) <= 6 minutes.
  {% endstep %}

{% step %}

#### Input

* Note: The `outRef`, `address`, `coin`, and `multiAssets` information is fully returned by the API.
* PoolInUtxo: The pool you intend to swap tokens with.
  * Spend Redeemer: Build the redeemer according to the ExchangeActionRedeemer Swap structure for Concentrated Pool, ensuring the specified indices are correct.
  * The input Pool UTxO must have the valid PoolNFT:
    * `pool_in_asset[PoolNFT] = 1`
      {% endstep %}

{% step %}

#### Output

* PoolOutUtxo: The output of the pool after the swap.
  * All information for the pool output UTxO is fully returned by the API.
  * The pool datum structure must adhere to the correct order:

{% code title="" %}

```
type PoolDatum {
       // Pool liquidity pair used for trading
       token_X: TupleAsset,
       token_Y: TupleAsset,
       //
       lp_fee_rate: Basis, // LP fee decided by pool creator
       platform_fee_X: Int, // platform fee accumulated on each swap transaction collected in token X
       platform_fee_Y: Int, // platform fee accumulated on each swap transaction collected in token Y
       // to save costs, onchain will let offchain calculate sqrt price
       sqrt_lower_price: PRational,
       sqrt_upper_price: PRational,
       // min X, min Y to avoid DDOS when ModifyLiquidity and Swap
       min_x_change: Int,
       min_y_change: Int,
       circulating_lp_token: Int, // current lp token in circulation, changed when supply/withdraw liquidity
       last_withdraw_epoch: Int // the last epoch when a withdrawal was made from the pool
   }
```

{% endcode %}

* Diagnostic Notation format example:

```
24_0(<<121_0([_
     [_
         h'9a614be30284aa88eb845da7657b5d0a235f1b95628b23c08050d502',
         h'6655534441',
     ],
     [_
         h'834a15101873b4e1ddfaa830df46792913995d8738dcde34eda27905',
         h'665553444d',
     ],
     0,
     0,
     0,
     121_0([_ 15811388300841898_3, 10000000000000000_3]),
     121_0([_ 17320508075688772_3, 10000000000000000_3]),
     1090866_2,
     399256_2,
     10000000_2,
     65339_1,
 ])>>)
```

{% endstep %}

{% step %}

#### Reference Input

* Add all reference inputs from [SDK](https://github.com/danogo-finance/clmm-sdk) .
  {% endstep %}

{% step %}

#### Withdrawal

* Withdraw Redeemer:
  * Add a withdrawal to the reward address with the reward amount from [SDK](https://github.com/danogo-finance/clmm-sdk).
  * The reward redeemer has the ExchangeActionRedeemer structure.
* Withdraw Staking Reward:
  * Must add staking withdrawal if the staking reward amount is greater than 0.
  * Staking reward address with the reward amount from [SDK](https://github.com/danogo-finance/clmm-sdk).
  * Staking redeemer: Built according to the ExchangeActionRedeemer structure.
    {% endstep %}
    {% endstepper %}

{% hint style="info" %}
After sorting the inputs and reference inputs according to the chain's sort order, ensure the correct indices are used when specifying them in the redeemers.
{% endhint %}
{% endstep %}
{% endstepper %}


# Concentrated Liquidity Pool Integration

## Purpose

Guide on how to Build Transaction Swap Concentrated Pool Token:

* Example transaction on preprod: <https://preprod.cardanoscan.io/transaction/77a2a7786629f9280a9e0653e07d8bf153376555307efd3d066fd6ebae881140> &#x20;
* Example transaction on mainnet: <https://cardanoscan.io/transaction/402a6320fe48781cf103d42951c22fc0aeb782a35c9306db1ba258397b02d65b>

### **Constants**

**Preprod**:

```
POOL_SCRIPT_HASH="04041c3c6ba87b33f2c9eb7f7dbeae3b26003c3e199d438bb99932a2"
POOL_SCRIPT_OUT_REF="2e19cca74e3badcab26aef7574aa1885ba97228a254ca227ba2f79f2b75fd136#0"
PROTOCOL_SCRIPT_HASH="26ec271e96420bd548932f350e76ea38590da68e12f0f55bd5473f67"
PROTOCOL_CONFIG_OUT_REF="3775af36f485f9c97101ee5b9b360c34f0f8e12186bc9060f358b7fc8ce468a4#0"
```

**Mainnet**:

```
POOL_SCRIPT_HASH="d8b69fc53637bcfadbc4469083f706bc293f4d9d2296646c5ca167bb"
POOL_SCRIPT_OUT_REF="64d111b957e7d7848ffdde5149aa77fa4090a7fa1ad0ac108067900614848501#0"
PROTOCOL_SCRIPT_HASH="fa991bc2f9c4206e72d713bc3487a72e7901057cabb8d364bebeef8f"
PROTOCOL_CONFIG_OUT_REF="2cafd7c92f7093e5229af274be83dea660b0590b4174bbed79ba662b44fbd1ee#0"
```

## Steps to Build a Transaction Swap Token

### Step 1: Retrieve Necessary Parameters

* Call the API [GetListConcentratedPool](https://dapp-indexers.api.danogo.io/api/v1/concentrated/pools) to get list pools. For example, to get all pools with given token pair:

Mainnet API:

```bash
curl 'https://dapp-indexers.api.danogo.io/api/v1/concentrated/pools?limit=20&offset=&tokenA=&tokenB=1f3aec8bfe7ea4fe14c5f121e2a92e301afe414147860d557cac7e34.5553444378'
```

Preprod API:

```bash
curl 'https://liquidity-pair-preprod.dev.tekoapis.net/api/v1/concentrated/pools?limit=20&offset=&tokenA=&tokenB=9a614be30284aa88eb845da7657b5d0a235f1b95628b23c08050d502.6655534441'
```

* Use `lpToken` from each pool to call the API [GetConcentratedPoolParams](https://dapp-indexers.api.danogo.io/api/v1/concentrated/pool-params) to retrieve the necessary parameters from a pool:

Mainnet API:

```bash
curl 'https://dapp-indexers.api.danogo.io/api/v1/concentrated/pool-params?lpToken=d8b69fc53637bcfadbc4469083f706bc293f4d9d2296646c5ca167bb.d602bf16c7710f7453bd18fcb156beb2aa422ef57c8f4e780d243712'
```

Preprod API:

```bash
curl 'https://liquidity-pair-preprod.dev.tekoapis.net/api/v1/concentrated/pool-params?lpToken=9a614be30284aa88eb845da7657b5d0a235f1b95628b23c08050d502.6655534441'
```

### Step 2: **Build the Redeemer Structure**

#### Concentrated ExchangeActionRedeemer Structure:

To optimize data size and allow one transaction (txn) to swap across multiple pools simultaneously, the Redeemer is a ByteArray, where each field has a defined index and byte size.

* ExchangeActionRedeemer structure for Token Swap:

```rust
pub type ExchangeActionRedeemer {
    in_idx: Int, // 1 byte: protocol_config_idx for withdraw-zero pool_skh, pool_in_idx for others
    action: ExchangeAction // 1 byte
}

pub type ExchangeAction {
    CreatePool(CreatePoolParams)
    // platform_fee_out_idx > 0 if platform_fee_X/Y > 0
    ModifyLiquidity(Int, List<ModifyLiquidityParams>)
    // (UTxOType, LicenseIdx)
    WithdrawPlatformFee((Int, Int) ,List<WithdrawPlatformFeeParams>)
    Swap(List<SwapParams>)
    // platfrom_fee_out_idx
    ClaimUndefined((Int, Int) ,List<ClaimUndefinedParams>)
    DelegatePool
}

type SwapParams {
    pool_in_idx: Int, // 1 byte
    pool_out_idx: Int, // 1 byte
    delta_amount: Int, // 32 byte (Int256)
}
```

* Diagnostic Notation format:

```
h'0103...' // Swap Action = 03
```

* CBOR format (single pool):

```
  58240103... // 36 bytes (<in_idx><action><pool_in_idx><pool_out_idx><delta_amount>)
```

### Step 3: Create the Transaction

Use the retrieved parameters to create the token swap transaction.

* Note: To minimize DDoS attacks in multi-hop pools, each pool, when swapped, will collect ADA fees according to protocol\_config.swap\_fee and add them to the Pool Datum:

```
pool_out_datum.total_swap_fee=pool_in_datum.total_swap_fee+protocol_config.swap_fee
```

* Amount of `swapFee` to be charged and current `totalSwapFee` in Pool Datum is returned by API.

{% stepper %}
{% step %}

### Validity range

Set the validity range for the transaction.

* Ensure the time-to-live (TTL) <=6 minutes.
  {% endstep %}

{% step %}

### Input

* Note: The `outRef`, `address`, `coin`, and `multiAssets` information is fully returned by API Get Params.
  * PoolInUtxo: The pool you intend to swap tokens with.
    * Spend Redeemer: Build the redeemer according to the **ExchangeActionRedeemer** Swap structure for Concentrated Pool, ensuring the specified indices are correct.
    * The input Pool UTxO must have the valid PoolNFT:
      * pool\_in\_asset\[PoolNFT] = 1
        {% endstep %}

{% step %}

### Output

* PoolOutUtxo: The output of the pool after the swap.
  * delta\_amount > 0 -> Trader sells X, Pool receives X and pays Y. Simultaneously increases platform\_fee\_X accumulation.
    * poolChangeX = redeemer.delta\_amount
  * delta\_amount < 0 -> Trader sells Y, Pool receives Y and pays X. Simultaneously increases platform\_fee\_Y accumulation.
    * poolChangeY = -redeemer.delta\_amount
  * The pool datum structure must adhere to the correct order:

```rust
type PoolDatum {
    // Pool liquidity pair used for trading
    token_X: TupleAsset,
    token_Y: TupleAsset,
    //
    lp_fee_rate: Basis, // LP fee decided by pool creator
    platform_fee_X: Int, // platform fee accumulated on each swap transaction collected in token X
    platform_fee_Y: Int, // platform fee accumulated on each swap transaction collected in token Y
    total_swap_fee: Int, // total swap_fee (ADA) accumulated
    // to save costs, onchain will let offchain calculate sqrt price
    sqrt_lower_price: PRational,
    sqrt_upper_price: PRational,
    // min X, min Y to avoid DDOS when ModifyLiquidity and Swap
    min_x_change: Int,
    min_y_change: Int,
    circulating_lp_token: Int, // current lp token in circulation, changed when supply/withdraw liquidity
    last_withdraw_epoch: Int // the last epoch when a withdrawal was made from the pool
}

type ProtocolConfigDatum {
    platform_fee_rate: Basis, //% of LP Fee that the platform takes on each swap. Default = 1000
    swap_fee: Int //In Lovelace. The fee collected by the platform, to avoid DDoS by chainning multiple pools
}
```

* Temporary variables:

  * **basis = 10000**
  * **pool\_utxo\_min\_ada** = 3\_000\_000 (lovelace)
  * **poolinX**: `tokenAReserve` from the API
  * **poolinY**: `tokenBReserve` from the API
  * **poolinLPX**: liquidity of token X before the txn
    * if token X is ADA: = poolinX - pool\_in\_datum.platform\_fee\_x - pool\_in\_datum.total\_swap\_fee - pool\_utxo\_min\_ada
    * else: = poolinX - pool\_in\_datum.platform\_fee\_x
  * **poolinLPY**: liquidity of token Y before the txn = pool\_in\_asset\[Y] - pool\_in\_datum.platform\_fee\_y
  * $$\sqrt{P\_a} = pool\_in\_datum.sqrt\_lower\_price$$
  * $$\sqrt{P\_b} = pool\_in\_datum.sqrt\_upper\_price$$
  * $$L=CEIL(\frac{poolinLPY + poolinLPX\sqrt{P\_a}\sqrt{P\_b} + \sqrt{(poolinLPY-poolinLPX\sqrt{P\_a}\sqrt{P\_b})^2 + 4poolinLPXpoolinLPY\*P\_b}}{2(\sqrt{P\_b}-\sqrt{P\_a})})$$
  * $$X\_v=poolinLPX+CEIL(\frac{L}{\sqrt{P\_b}})$$
  * $$Y\_v=poolinLPY+CEIL(L\sqrt{P\_a})$$
  * $$offFee = 1-pool\_in\_datum.lp\_fee\_rate/basis$$

* Constraints:
  * |poolChangeX| >= pool\_in\_datum.min\_x\_change

  * |poolChangeY| >= pool\_in\_datum.min\_y\_change

  * IF pool\_in\_datum.token\_x == ""
    * Required withdrawal of the rewards by the pool's stake credential (before this action)

  * if poolChangeX > 0:
    * $$pool\_out\_datum.platform\_fee\_x = FLOOR(pool\_in\_datum.platform\_fee\_x + \frac{pool\_in\_datum.lp\_fee\_rate}{basis}\*\frac{platform\_fee\_rate}{basis}\*poolChangeX)$$

    * $$pool\_out\_datum.platform\_fee\_y = pool\_in\_datum.platform\_fee\_y$$

    * $$poolChangeY >= CEIL(X\_v\*Y\_v / (X\_v + poolChangeX \* offFee) - Y\_v)$$

  * else:
    * $$pool\_out\_datum.platform\_fee\_x = pool\_in\_datum.platform\_fee\_x$$
    * $$pool\_out\_datum.platform\_fee\_y = FLOOR(pool\_in\_datum.platform\_fee\_y + \frac{pool\_in\_datum.lp\_fee\_rate}{basis}\*\frac{platform\_fee\_rate}{basis}\*poolChangeY)$$
    * $$poolChangeX >= CEIL(X\_v\*Y\_v / (Y\_v + poolChangeY \* offFee) - X\_v)$$
    * pool\_out\_datum.last\_withdraw\_epoch = curEpoch
    * pool\_out\_datum.total\_swap\_fee = pool\_in\_datum.total\_swap\_fee + protocol\_config\_ref.swap\_fee

  * Other fields in datum are not changed:
    * pool\_out\_datum.lp\_fee\_rate = pool\_in\_datum.lp\_fee\_rate
    * pool\_out\_datum.token\_x = pool\_in\_datum.token\_x
    * pool\_out\_datum.token\_y = pool\_in\_datum.token\_y
    * pool\_out\_datum.sqrt\_lower\_price = pool\_in\_datum.sqrt\_lower\_price
    * pool\_out\_datum.sqrt\_upper\_price = pool\_in\_datum.sqrt\_upper\_price
    * pool\_out\_datum.circulating\_lp\_token = pool\_in\_datum.circulating\_lp\_token

  * Pool UTxO's address must not be changed

* Diagnostic Notation format:

```
24_0(<<121_0([_
     [_ h'', h''], // tokenX (ADA)
     [_
         h'834a15101873b4e1ddfaa830df46792913995d8738dcde34eda27905',
         h'665553444d',
     ], // tokenY
     30_0, // lp_fee_rate
     104495_2, // platform_fee_X
     6826_1, // platform_fee_Y
     2200000_2, // total_swap_fee
     121_0([_ 4472135954999579_3, 10000000000000000_3]), // sqrt_lower_price
     121_0([_ 6324555320336759_3, 10000000000000000_3]), // sqrt_upper_price
     348057_2, // min_x_change
     100000_2, // min_y_change
     997000000_2, // circulating_lp_token
     70711_2, // last_withdraw_epoch
 ])>>)
```

{% endstep %}

{% step %}

### Reference Input

* Add all reference inputs:
  * pool\_script\_out\_ref: current smart contract's out ref is `64d111b957e7d7848ffdde5149aa77fa4090a7fa1ad0ac108067900614848501#0`
  * protocol\_config\_out\_ref: returned by the API, field `pool.protocolConfigOutRef`
  * If withdraw staking, add staking\_script\_out\_ref: returned by the API, field `stakingUtxo.outRef`
    {% endstep %}

{% step %}

### Withdrawal

* **Withdraw Pool Script Hash**:
  * Add withdraw-zero: Add withdrawal to reward address of Pool Script Hash with reward amount = 0
    * Note: Pool Script Hash can be extracted using lpToken's policy ID from the API
  * Redeemer: Built according to the ExchangeActionRedeemer structure.
* **Withdraw Staking Reward**: Must add staking withdrawal if pool contains ADA and current\_epoch > pool\_datum.last\_withdraw\_epoch.
  * Check reward amount of pool script hash and add withdrawal to its reward account.
  * Redeemer: Built according to the **ExchangeActionRedeemer** structure.
    {% endstep %}
    {% endstepper %}

**Note**: After sorting the inputs and reference inputs according to the chain's sort order, ensure the correct indices are used when specifying them in the redeemers.

We've built a typescript SDK for your reference: [Here](https://github.com/dano-finance/clmm-sdk)&#x20;


