# Introduction

## Paddle Finance is a decentralized liquidity protocol that transforms asset management

Paddle Protocol is strategically focused on the bespoke asset market. As blockchain technology evolves and diversifies, we are seeing an increasing number of assets on the chain that defy standardization. This shift means that the scale of bespoke assets could potentially exceed that of standard assets, reflecting the real-world diversity where most assets are unique and not uniform. The use cases for bespoke assets are more extensive than many realize, which is why Paddle Protocol is committed to addressing this broad and varied market.

## The Market Size of Bespoke Assets

Paddle Protocol targets the bespoke asset market. With the development of more and more diversified use cases, more assets in the chain will not be standardized, and the scale of bespoke asset will be much larger than standard assets. Imagine in real worlds, most of the assets are not identical and standard - that is the concept Paddle Plan to serve. That is, in addition to the typical Non-Fungible Tokens (NFT), the scope also includes all types of bespoke tokens, certificates, new token standard, and alternative assets. Among them, the most representative types of bespoke assets include:

* Non-Fungible Tokens (NFTs)
* Ordinals or Inscriptions
* Liquidity Provider Tokens (LP Tokens): Tokens representing a share in a liquidity pool.&#x20;
* Fungible Tokens with Limited Liquidity: Such as Altcoins or Memes cryptocurrencies
* Real World Assets (RWAs): Physical assets digitized and traded on blockchain platforms.

## **Why Paddle Protocol was Developed**

Paddle Protocol was created to address the unique characteristics and challenges of bespoke assets. These assets, often scarce and valued as both investments and collectibles, face difficulties in trading due to their specialized properties. This includes assets like GameFi items and Liquidity Provider (LP) tokens, which carry embedded utility that traditional financial systems struggle to accommodate.

Furthermore, bespoke assets lack mature marketplaces, making financial settlement a major pain point. Paddle Protocol was developed to eliminate the need for mutual trust or centralized custodians, providing a seamless and secure platform for trading and liquidity.

**Empowering Bespoke Assets with Collateralized Loans**

We believe the optimal way to unlock the potential of these assets is through a versatile collateralized loan system. Paddle Protocol introduces various loan forms—ranging from peer-to-peer to crowd lending—to accommodate the diverse nature of these assets. This approach not only enhances their usability but also caters to the specific needs of different asset types.

**Extending Support Beyond Loans**

Moreover, Paddle expands this support to include broader leasing and sales markets, ensuring that liquidity can be maximized without compromising the assets' utility or financial value. This comprehensive strategy allows asset holders to fully exploit their bespoke assets, providing them with flexible options to generate liquidity while maintaining ownership.

**Maximizing Capital Efficiency**

Paddle is also introducing a new token standard that separates user rights from ownership, paving the way for zero-collateral borrowing and renting. This innovation will significantly increase capital efficiency, creating more opportunities for on-chain assets and expanding the potential of decentralized finance.


# Basket Collateral

Paddle Protocol goes beyond handling individual assets by incorporating the "Basket Collateral" concept, a strategy borrowed from traditional finance’s security lending and borrowing practices. This approach allows asset holders to consolidate multiple assets into a single financial contract, enhancing the overall utility of their portfolio.

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

**Benefits of Basket Collateral:**

1. **Efficiency in Transactions:** By grouping assets, such as multiple high-value NFTs, into one contract, asset holders can significantly reduce transaction costs. For example, instead of incurring tenfold gas fees for ten separate BTC NFTs, they can financialize all at once, saving on expenses and streamlining the process.
2. **Optimal Use of Low-Value Bespoke Assets:** Basket Collateral also proves ideal for enhancing the utility of lower-value bespoke assets. These can be bundled with main assets, allowing them to serve as complementary additions within a larger financial package.

This functionality not only makes high-value collateral loans or over-the-counter (OTC) trades more efficient but also optimizes the use of bespoke assets, providing a comprehensive solution that adapts to the diverse needs of asset holders.


# Collateral Loan

Paddle Finance extends the utility of bespoke assets for generating cash flow, while also incorporating mainstream assets through its collateralized loan services. This approach significantly boosts the turnover rate of the entire cryptocurrency asset market.

## **Addressing Market Challenges**

Paddle’s innovative product design tackles key issues related to bespoke asset pricing and circulation, effectively bridging the gap where other financial tools fall short. This unique positioning allows Paddle to address market needs that other loan products cannot, offering solutions that are just as effective for standard assets. For widely used collateral assets like ETH and WBTC, Paddle enhances borrowing flexibility and capital efficiency, making it an appealing choice for a diverse range of investors.

## **Diverse Loan Forms Tailored to User Needs**

### **Peer-To-Peer Lending:**

This traditional form allows borrowers to set their collaterals and loan parameters independently, with one lender participating per loan. Paddle facilitates setting up a lender in advance, ideal for meeting specific OTC loan demands.

### **Crowd Lending:**

Best suited for assets with low turnover rates, where value might fluctuate significantly. Paddle uses a crowdfunding model to allow a limited number of participants to decide voluntarily whether to lend, based on the initiated loan conditions and their desired capital contribution.

### **Pool Lending:**

An excellent choice for assets with high turnover rates and low risk, Pool Lending is tailored for assets that maintain high transaction volumes and stable values. Utilizing a liquidity pool-based approach, this method ensures rapid and efficient fundraising, enabling asset holders to secure loans quickly.

More detailed information and use cases will be provided in subsequent documentation.


# Peer-To-Peer Lending

Peer-To-Peer Lending represents the most traditional form of loan available in the market. This format allows borrowers to freely set their collaterals and loan parameters, with only one lender participating in each loan. Paddle supports this process by allowing borrowers to select their lender in advance, catering specifically to the needs of the over-the-counter (OTC) loan market.

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

## Collateral Treatment

Borrowers are not required to immediately deposit their collateral assets into the smart contract; instead, they simply need to authorize the transfer through MetaMask or another non-custodial wallet. The collateral assets are only transferred to the loan contract after a lender has successfully filled the loan.&#x20;

If a borrower moves their assets out of their account before the loan is filled, the lender will be unable to complete the loan order, resulting in an error message indicating that the loan cannot be filled due to the absence of the required collateral. This process ensures secure and user-friendly collateral handling, minimizing upfront commitments until the loan terms are met by a lender.

Once the loan is repaid, the borrower can redeem their assets from the secure vault.

## Loan Terms

### Customizable Items

* **Collateral:** Borrowers can choose to secure loans with single assets (such as ERC-20 or ERC-721 tokens) or a basket of assets.
* **Loan Currency:** The type of token the borrower wishes to receive from the lender.
* **Loan Amount:** The principal amount needed by the borrower.
* **Duration:** The time period for which the capital is needed.
* **Interest & APR:** The interest rate the borrower is willing to offer. The final interest payment is calculated based on the principal, the annual percentage rate (APR), and the actual duration of the loan.
* **Expiration:** The duration for which the loan offer will remain valid in the market.

### Pre-Set Items

* **Margin:** A borrower fee, calculated as a percentage of the principal, is deducted when a loan is filled by a lender. For example, with a 1% margin on a loan of 100 BERA, the borrower receives 99 BERA. However, the interest is calculated on the full 100 BERA, and the borrower must repay the entire principal plus interest by the loan's due date.
* **Lender Fee:** A lender fee calculated as a percentage of the interest is deducted upon repayment. For example, if 100 BERA interest on a 1000 BERA principal is due, lender will receive 90% of the interest (90 BERA), totaling 1090 BERA.
* **Repayment Method:**
  * **Lump Sum Payment:** Currently, the only repayment method where the borrower pays back the entire principal and interest in one single payment.
  * **Installment Plan (Coming Soon):** Borrowers can split the repayment into several terms, similar to a mortgage. This method reduces default risk and facilitates higher-value collateral loans and institutional-grade lending.

## Interest Calculation

Repayment Amount = Principle + Actual Loan Duration/365 x APR x Principle

## Minimum Interest

To safeguard lender rights and deter the use of unrealistically high Annual Percentage Rates (APRs) to attract short-term funds, Paddle implements a Minimum Interest policy. This policy ensures that borrowers are subject to a minimum interest charge to discourage early prepayment. Specifically, borrowers must pay at least 25% of the interest calculated as if the loan were held until just before its due date. This effectively acts as a penalty for borrowers who repay early, particularly if they do so before 25% of the loan duration has elapsed.

**Example:**

Consider Alice, who borrows 100 BERA against her NFT for a term of 12 months at an APR of 100%. If Alice decides to repay the loan overnight or within the first three months, she is still required to pay a minimum interest of 25 BERA (calculated as 100 BERA\* 100% APR \* 25%).

## Liquidation

If the borrower fails to repay the loan by the due date, the collaterals then become the property of the lender. The lender can claim these assets via our smart contract, ensuring a straightforward liquidation process. There is no price liquidation


# Peer-To-Crowd Lending

Coming Soon

Peer-To-Crowd Lending (Crowd Lending) at Paddle Finance is inspired by the concept of a syndicated loan. It is designed to accommodate both small investors, who may not have sufficient capital to engage in Peer-to-Peer (P2P) lending, and larger investors or institutions seeking efficient ways to initiate loans with substantial principal amounts. By employing a crowdfunding approach, Crowd Lending allows multiple participants to voluntarily engage in a transaction, significantly lowering the barriers for lender participation and enabling high-value collateral loans.

Crowd Lending will soon be live. Stay tuned to our social announcement.

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

## Collateral Treatment

Same as Crowd Lending, borrowers are not required to immediately deposit their collateral assets into the smart contract; instead, they simply need to authorize the transfer through MetaMask or another non-custodial wallet. The collateral assets are only transferred to the secure vault after a lender has successfully filled the loan.&#x20;

If a borrower moves their assets out of their account before the loan is filled, the lender will be unable to complete the loan order, resulting in an error message indicating that the loan cannot be filled due to the absence of the required collateral. This process ensures secure and user-friendly collateral handling, minimizing upfront commitments until the loan terms are met by a lender.

Once the loan is repaid, the borrower can redeem their assets from the secure vault.

## Loan Terms

### Customizable Items

* **Collateral:** Borrowers can choose to secure loans with single assets (such as ERC-20 or ERC-721 tokens) or a basket of assets.
* **Loan Currency:** The type of token the borrower wishes to receive from the lender.
* **Loan Amount:** The principal amount needed by the borrower.
* **Duration:** The time period for which the capital is needed.
* **Interest & APR:** The interest rate the borrower is willing to offer. The final interest payment is calculated based on the principal, the annual percentage rate (APR), and the actual duration of the loan.
* **Expiration:** The duration for which the loan offer will remain valid in the market.
* **Loan Mode:**
  * **FCFS Model (First Come, First Serve):** Lenders contribute any amount until the funding cap is reached.
  * **Subscription Model:** Lenders contribute within a specific timeframe. Over-subscriptions are allowed, and allocations are proportionally divided among lenders based on their contributions. Fundraising remains open until the designated period ends.

### Pre-Set Items

* **Margin:** A platform fee, calculated as a percentage of the principal, is deducted when a loan is filled by a lender. For example, with a 1% margin on a loan of 100 BERA, the borrower receives 99 BERA. However, the interest is calculated on the full 100 BERA, and the borrower must repay the entire principal plus interest by the loan's due date.
* **Lender Fee:** A fee calculated as a percentage of the interest is deducted upon repayment. For example, if 100 BERA interest on a 1000 BERA principal is due, lenders will receive 90% of the interest (90 BERA), totaling 1090 BERA.
* **Repayment Method:**
  * **Lump Sum Payment:** Currently, the only repayment method where the borrower pays back the entire principal and interest in one single payment.
  * **On The Fly (Coming Soon):** Allows the borrower to make payments at any time as long as the full amount is repaid before the due date.
  * **Installment Plan (Coming Soon):** Borrowers can split the repayment into several terms, similar to a mortgage. This method reduces default risk and facilitates higher-value collateral loans and institutional-grade lending within the BERA ecosystem.

## Interest Calculation

Repayment Amount = Principle + Actual Loan Duration/365 x APR x Principle

## Liquidation

If a borrower fails to repay the loan by the due date, the collateral becomes the property of the lenders. The process for liquidation varies depending on the type of collateral involved:

**ERC-20 Tokens:**

* At the time of liquidation, any remaining collateral that can be distributed is calculated based on the repayment ratio provided by the borrower.
* This remaining collateral is then allocated among the lenders according to their contribution ratios.

**ERC-721 Tokens or Other Non-Fungible Tokens (NFTs):**

* Liquidation for these assets begins with a liquidation auction.
* **Liquidation Auction:** This is a closed auction open only to the lenders and Paddle Gold Pass holders. The highest bidder wins the auction.
  * If the auction is successful, the proceeds from the auction are distributed among the lenders, based on their contribution ratios.
  * If the auction fails, the process moves to a liquidation sale.
* **Liquidation Sale:** The collateral is offered for sale on a secondary market, open to anyone. The selling price decreases daily until it approaches zero.
  * The funds obtained from the sale are then distributed to the lenders, according to their respective contribution ratios.


# OTC Exchange

Over-The-Counter (OTC) exchange is a common and effective mode of operation in both mature and newly formed ecosystems. It addresses liquidity issues for both makers (trade requesters) and takers (trade counterparties) without impacting market value. Traditionally, OTC service often relies on mutual trust or a centralized custodian.

Paddle's OTC service offers a non-custodial marketplace that allows anyone to initiate an OTC deal across the market. Here are the key terms and processes:

## OTC Terms

* **Given Assets**: The assets the maker is offering, which can be individual assets (such as ERC-20 or ERC-721 tokens) or a basket of assets.
* **Required Assets**: The assets the maker wishes to receive in exchange, which can also be individual assets (such as ERC-20 or ERC-721 tokens) or a basket of assets.
* **Expiration:** The period during which the OTC offer remains valid.
* **Counterparty:** The maker can specify the address of a particular taker to prevent others from taking their agreed deal. If no specific taker is designated, anyone from the market can fulfill the OTC request.

## Asset Treatment

Similar to our loan design, makers are not required to deposit their assets into the smart contract immediately. They only need to authorize the transfer via MetaMask or another non-custodial wallet. The assets will only be transferred and swapped to the counterparty after a taker has successfully filled the request.

If a maker moves their assets out of their account before the request is filled, the taker will encounter an error message stating that the request cannot be completed due to the absence of the required assets. This ensures secure and user-friendly asset handling, minimizing upfront commitments until the OTC terms are met by a taker.

## Fee or Expense

Initially, our OTC service will charge a fixed fee (now set as 0) to the taker for each swap (please refer to the [parameters](/v1-liquidity-solution/parameters) page for details). This fee may be adjusted in the future based on market conditions or decisions made by the Paddle DAO.


# Parameters

The current setup, designed for the free-trial period, will be adjusted based on future market conditions and aligned with our business model.

<table><thead><tr><th width="167">Parameters</th><th width="193">Value</th><th>Details</th><th>Applicable Modules</th></tr></thead><tbody><tr><td>Margin Rate</td><td>0%</td><td>A borrower fee, calculated as a percentage of the principal, is deducted when a loan is filled by a lender.</td><td><ul><li>Peer-To-Peer Lending</li></ul></td></tr><tr><td>Service Fee</td><td>0</td><td>A maker fee, calculated as a fixed amount per order, is charged when an OTC deal is filled by a maker.</td><td><ul><li>OTC Exchange</li></ul></td></tr><tr><td>Interest Fee Rate</td><td>0%</td><td>A lender fee calculated as a percentage of the interest is deducted upon repayment.</td><td><ul><li>Peer-To-Peer Lending</li></ul></td></tr><tr><td>Min. Interest</td><td>25%</td><td>Minimum interest even when early repayment.</td><td><ul><li>Peer-To-Peer Lending</li></ul></td></tr></tbody></table>


# Peer-To-Pool Lending

Isolated-Margin NFT Loan Market Coming Soon

Peer-To-Pool Lending is an ideal solution for NFTs with high turnover rates and low risk, especially those with stable value and high transaction volumes. Utilizing a Liquidity Pool-based approach, Paddle Protocol enables rapid and efficient fundraising, allowing asset holders to secure loans quickly.

Peer-To-Pool Lending will soon be live. Stay tuned to our social announcement.

<figure><img src="/files/8A5Ptm2g85U0mNJd7mO0" alt=""><figcaption></figcaption></figure>

## Core Mechanism

Paddle’s Peer-to-Pool Lending is an isolated-margin NFT loan market that offers permissionless and transparent financial services to NFT communities. Similar to Aave or Compound, it enables users to borrow and repay capital at any time with open-ended loan durations, but with a model specifically tailored for NFT-based liquidity.

### **Isolated-Margin Design for NFT Communities**

Each lending pool is isolated by NFT collection and settlement asset—ensuring that capital suppliers are only exposed to the projects they believe in, while significantly reducing systemic risk. Every pool has its own set of parameters, such as:

* Accepted Collateral
* Collateral Factor
* Interest Rate Model

For example:

* If you’re a supplier in the Steady Teddys / WBERA pool, only Steady Teddys holders can borrow WBERA using their NFTs.
* Yeetard holders would interact exclusively with the Yeetard / YEET pool.

This segmentation helps protect lenders while providing tailored access to liquidity for individual NFT communities.

### **Isolated Roles for Lenders and Borrowers**

To reduce confusion during the initial phase of our money market launch, each wallet can only act as either a borrower or a lender in any single pool.

Example: If you deposit your Steady Teddys NFTs into the Steady Teddys / WBERA pool as collateral (borrower role), you won’t be able to supply WBERA to that same pool as a lender — and vice versa.

Flexibility:

* You can still be a lender in one pool and a borrower in another.
* If you want to both lend and borrow in the same pool, simply use two separate wallet addresses.

Once the market matures, this restriction will be lifted, and users will be free to act as both lender and borrower within a single pool.

## **Per-Market Risk Calculation & Liquidation**

Paddle uses a per-market risk model, meaning each lending market (based on NFT collection and settlement asset) is assessed independently. The system calculates debt and collateral value separately for each market, so your positions in one pool do not affect those in another.

If the borrowing in a specific market exceeds the allowed limit, the collateral in that market becomes eligible for liquidation—regardless of your other holdings.

### Example:&#x20;

If your loan in the Steady Teddys / WBERA market exceeds the borrow limit, your Teddys NFTs in that pool can be liquidated—even if you have other NFTs (like Yeetards) deposited as collateral in a different pool. Those Yeetards will not be used to protect your Teddys position.

This structure keeps risk contained, ensures precise liquidation logic, and protects users from cross-market contagion.

{% hint style="info" %}
Borrow Limit of certain market = Σ Amount of **Collateral i** x Price of **Collateral i** x Collateral Factor of **Collateral i**
{% endhint %}

## Collateral Treatment

For Peer-To-Pool Lending, when a borrower initiates a loan request, the collateral assets are immediately deposited into a secure vault. This allows the borrower to access the funds right away. Once the loan is repaid, the borrower can redeem their assets from the secure vault.

## Advantages of Peer-To-Pool Lending

* **Quick Loan Access:** The streamlined process allows for fast loan issuance.
* **Open-Ended Loan Durations:** Users can borrow and repay capital at any time as long as the Borrow Limit Used does not exceed 100%.
* **Income Opportunities for Lenders:** Lenders earn interest and may benefit from excess asset resale.
* **Controlled Risks:** The liquidity pool structure manages and mitigates lending risks effectively.


# Market List

<table><thead><tr><th width="113.99993896484375">Chain</th><th width="205.29681396484375">Market</th><th>NFT  Address</th></tr></thead><tbody><tr><td>Berachain</td><td>Bullas/wgBERA</td><td>0x333814f5E16EEE61d0c0B03a5b6ABbD424B381c2</td></tr><tr><td>Berachain</td><td>Steady Teddys/WBERA</td><td>0x88888888A9361f15AAdBAca355A6B2938C6A674e</td></tr><tr><td>Berachain</td><td>Yeetard/YEET</td><td>0xa6B1948b42ea485c391730bb721d9f2001EBE504</td></tr></tbody></table>


# Paddle Interest Bearing Token (pToken)

Certificate of Supplying Capitals

Each market in Paddle NFT loan market is integrated through a separate pToken contract, which is an EIP-20 subsidiary that represents balances supplied to the protocol. By minting pTokens, users earn interest through the pToken's exchange rate, which increases in value subject to the underlying loan pool.

pTokens, which stand for "Paddle Interest Bearing Tokens", are derivatives of an underlying token and also the certificate of supplying capitals into corresponding market; when a user supplies, redeems or transfers iTokens, he/ she is actually interacting with the iToken contract.

## iToken List

| Chain     | Market              | iToken                |
| --------- | ------------------- | --------------------- |
| Berachain | Bullas/wgBERA       | pBULLAS-wgBERA        |
| Berachain | Steady Teddys/WBERA | psteady\_teddys-WBERA |
| Berachain | Yeetard/YEET        | iYEET-YEETARD         |

## How do iTokens earn interest?

Each isolated market has its own Supply interest rate (APY). Interest will not be directly distributed to users' accounts; instead, it will be accrued to the amount of pToken held by users.

iTokens accrues interest through their exchange rate — over time, each iToken becomes convertible into an increasing amount of its underlying token, even while the amount of iTokens in your wallet stays the same. Please note: each user has the same iToken exchange rate for the same underlying token.

For example, when a market (ex. Steady Teddys/WBERA) is launched, the iToken exchange rate (how much WBERA one psteady\_teddys-WBERA is worth) begins at 1 — and increases at a rate equal to the compounding market interest rate. For example, after one year, the exchange rate might equal to 1.01415.

## How to view my pTokens? <a href="#how-to-view-my-itokens" id="how-to-view-my-itokens"></a>

While Paddle front end only displays your supplied amount, pTokens will be visible on block explorer like Etherscan or Berascan, and you should be able to view them in the list of tokens associated with your address.

iToken balance has been integrated into multiple web3 browser wallets. You can easily check the balance on MetaMask, Coinbase Wallet and so forth.

## Can I transfer pTokens? <a href="#can-i-transfer-itokens" id="can-i-transfer-itokens"></a>

Yes but, please note that transferring pTokens means you’re transferring your balance of the underlying token inside the Paddle protocol. That is, sending an pToken to others will decrease your balance (supplied amount) , and the recipient will see his/ her balance increase.


# Risk Framework

As decentralized finance (DeFi) continues to gain momentum, operating through open and borderless protocols introduces new layers of risk—particularly in terms of security, volatility, and protocol integrity.

At Paddle, we take a comprehensive approach to risk management, implementing safeguards at both the infrastructure and protocol levels. In addition to undergoing independent smart contract audits by top firms such as PeckShield, we are developing an internal risk assessment framework to detect malicious behavior, irregular usage patterns, and vulnerabilities under extreme market conditions.

To further enhance user protection, Paddle has introduced sophisticated risk parameters across our lending pools, including isolation of asset exposure, health factor monitoring, and dynamic interest rate adjustments.

This documentation outlines the key risk factors present in the isolated-margin NFT loan market and details the strategies and mechanisms Paddle employs to mitigate them.


# Asset Risk

The composability of the DeFi ecosystem implies risks from an individual component flow into all dependent systems. Token are at the heart of Paddle's loan market as they enable operations and cash flow, and lay the foundation for assets/ liabilities structure of the whole financial system.

To mitigate systemic risk, Paddle’s Risk Management Team has developed a Token Risk Assessment Framework. This evaluates each supported token based on:

* Underlying asset quality and volatility
* Counterparty risk
* Market-level risks (e.g., liquidity, concentration, composability)

Our goal is to maintain one of the highest risk standards in DeFi, ensuring only secure and reliable assets are integrated into the protocol.


# From Risks to Risk Parameters

For each asset, it has its own market risk that profiles its price uncertainty. Even though there is no unique classification applied to DeFi and NFT, the most commonly used types of market risk are:

1. Liquidity
2. Volatility
3. Market Capitalization

## **Liquidity** <a href="#liquidity" id="liquidity"></a>

Liquidity is yoked to the market volume. It is a vital factor that incurs liquidation. The risks can be mitigated with several parameters related to liquidation.

## Volatility <a href="#volatility" id="volatility"></a>

The price change of collateral heavily driven by Volatility will influence the overall solvency of the protocol. When the collateral value falls below the amount of borrowing, additional levels of liability coverage are required. For example, **Collateral Factor** will decide at which point liquidation process will occur, and whether a liquidator can get profits from repaying the loan.

Assets with higher volatility like smaller NFT collections usually have lower Collateral Factors, driving smaller borrowers' borrow limit and buffer zone for price drop, which are prone to trigger liquidations. The counter example are the flagship collections like Steady Teddys, Bored Ape Yacht Club and other Blue-chip collections, which have the higher Collateral Factors and allow borrowers to borrow more against them.

## **Market Capitalization** <a href="#market-capitalization" id="market-capitalization"></a>

Market capitalization illustrates the size of the market. When collaterals are liquidated, market cap is a key factor to be considered as it affects liquidation parameters: the smaller the market cap, the higher the incentives.

Overall risk, or systemic risk, is the integration of liquidity, volatility and market capitalization. Overall risk is a major element to affect reserve factor.

## Overall Risk <a href="#overall-risk" id="overall-risk"></a>

The overall risk (systematic risk) derives from three primary sources of risk, i.e. Liquidity, Volatility, Market Capitalization, thereby implying key risks within the protocol, which has a direct impact on Reserve Factor.


# Risk Parameters

Each market in Paddle has specific values related to their risk, which influences the process of how they are supplied and borrowed. Risk parameters will be routinely reviewed and set up accordingly with varying market condition or DAO governance.

## Detailed Risk Parameters Analysis <a href="#detailed-risk-parameters-analysis" id="detailed-risk-parameters-analysis"></a>

The risk parameters are used to provide referral criteria for the management of currency risks in Paddle loan market. Given the volatility of digital assets, margin would be reserved amid market downturn in each borrowing case. If the value of the collateral slips under a threshold, part of it could be forced into auction to repay the debt, while the rest position would remain collateralized.

## Isolated Margin <a href="#collaterals" id="collaterals"></a>

To minimize systemic risk, Paddle uses **isolated lending pools**—each pool is tied to a specific **NFT** collection and settlement asset. This ensures that lenders are only exposed to the specific projects they choose, rather than risks across the entire platform.

Unlike protocols like Aave or Compound, where your collateral can also be borrowed by others, Paddle keeps all collateral locked and unavailable for lending. This makes the asset/liability structure much clearer, more predictable, and easier to manage—for both borrowers and lenders.

## Collateral Factor <a href="#collateral-factor" id="collateral-factor"></a>

Collateral Factor can also be understood as Loan-to-Value (LTV). It determines the upper limit of amount that can be borrowed against a collateral. A 75% collateral factor means borrowers who have 100 USD position can borrow a 75 USD worth of corresponding currency. Collateral factor will go along with the market and evolve when the whole loan market matures.

## Reserve Factor <a href="#reserve-factor" id="reserve-factor"></a>

The reserve factor is a portion of interest paid by borrowers that is retained by the protocol. It supports long-term sustainability by funding governance incentives and serving as a risk buffer for lenders.

The reserve factor is based on asset volatility—more volatile assets have higher reserve rates to better manage risk. While it doesn’t directly impact user positions like collateral factors do, it plays a key role in maintaining overall protocol health.

Reserves collected on Berachain may be used to bribe validators for BGT emissions, helping to boost liquidity and incentivize lenders in Paddle’s NFT loan markets.

## Latest Risk Parameter Setup

<table><thead><tr><th width="267.39996337890625">Market</th><th width="281.2000732421875">Collateral Factor</th><th>Reserve Factor</th></tr></thead><tbody><tr><td>Bullas/WBERA</td><td>40%</td><td>12.5%</td></tr><tr><td>Steady Teddys/WBERA</td><td>50%</td><td>12.5%</td></tr><tr><td>Yeetard/YEET</td><td>40%</td><td>12.5%</td></tr></tbody></table>


# Liquidity Risk

Paddle’s Peer-to-Pool Lending is a decentralized, isolated-margin NFT lending market that allows users to deposit NFTs as collateral and borrow capital from designated liquidity pools. Liquidity providers, in turn, earn interest on the assets they supply.

The liquidity of each market is defined by the availability of assets for core operations such as issuing loans backed by collateral and redeeming supplied funds with accrued interest. Maintaining sufficient liquidity is essential—without it, borrowing and withdrawal operations may become limited or delayed.

To assess market health, Paddle monitors the utilization ratio of each asset pool, which reflects the proportion of total supplied assets that are currently borrowed. This ratio is a critical indicator of both capital efficiency and available liquidity.

To balance these priorities, Paddle employs a dynamic interest rate model that adjusts borrowing costs based on utilization. This model incentivizes borrowing when pools are underutilized and encourages repayments or more supply when liquidity is tight—ensuring optimal capital flow and long-term sustainability.


# Utilization

Each market liquidity is characterized by its utilization rate U:

$$
U = Total Borrow/Total Supply
$$

The utilization rate indicates the proportion of total supply that is actively loaned out at any given time (t). As U approaches 100%, available liquidity decreases—potentially leading to withdrawal constraints for suppliers if all capital is locked in active loans.

> Note: In rare cases, U may exceed 100% if the platform’s internal reserves are opened for borrowing. These reserves are not counted in the Total Supply, but contribute to Total Borrowed—resulting in temporary over-utilization.

While high utilization generally leads to higher returns for liquidity providers, it also increases the risk of limited withdrawal availability. Therefore, it is critical to balance capital efficiency with liquidity safety.

To manage this, each token market is calibrated with an optimal utilization rate (Uₒₚₜᵢₘₐₗ)—commonly referred to as the "kink" in Paddle’s dynamic interest rate model. Interest rates increase more sharply beyond this kink, discouraging excessive borrowing and helping restore healthy liquidity levels.

This mechanism ensures that capital remains productive, while maintaining accessibility for suppliers and stability across markets.


# Interest Rate Model

Paddle's interest rate strategy is calibrated to manage liquidity risk and optimize utilization. The borrow interest rates come from the Utilization Rate U.

U is an indicator of the availability of capital in the pool. The interest rate model is used to manage liquidity risk through allocating user incentivizes to support liquidity:

* When capital is sufficient: low interest rates to encourage loans.
* When capital is scarce: high interest rates to encourage repayments for loans and additional supplies.

## **Normal Model** <a href="#normal-model" id="normal-model"></a>

The supplying rate's calculation depends on something called an **interest rate model** — the algorithmic model to determine a money market's demand and supply rates.

This interest rate model takes in two parameters:

* Base rate per year, the minimum borrowing rate
* Multiplier per year, the rate of increase in interest rate with respect to utilization

**Borrow Rate**

\= Base + Multiplier x Utilization Rate

**Supply Rate**

\= Borrow Rate x (1-Reserve Factor) x Utilization Rate

## Jump Rate Model <a href="#jump-rate-model" id="jump-rate-model"></a>

Liquidity risk materializes when utilization is high, its becomes more problematic as U gets closer to 100%. To tailor the model to this constraint, some markets follow what is known as the "Jump Rate model”. This model has the standard parameters:

* Base rate per year, the minimum demand rate
* Multiplier per year, the rate of increase in interest rate with respect to utilization

but it also introduces two new parameters:

* Kink, the point in the model in which the model follows the jump multiplier
* Jump Multiplier per year, the rate of increase in interest rate with respect to utilization after the "Kink"

**Borrow Rate**

\= Base + Multiplier x Min(Utilization Rate, Kink) + Jump Multiplier x Max(Utilization Rate - Kink, 0)

**Supply Rate**

\= Borrow Rate x (1-Reserve Factor) x Utilization Rate

{% hint style="info" %}
Currently all the markets are designed as Jump Rate Model.
{% endhint %}

## Latest Interest Rate Table

<table><thead><tr><th>Chain</th><th width="204.17578125">Market</th><th width="191.5999755859375">Interest Rate Model</th><th>Base</th><th>Multiplier</th><th>Kink</th><th>Jump Multiplier</th><th>Reserve Factor</th></tr></thead><tbody><tr><td>Berachain</td><td>Bullas/WBERA</td><td>Jump Rate Model</td><td>5%</td><td>25%</td><td>70%</td><td>250%</td><td>12.5%</td></tr><tr><td>Berachain</td><td>Steady Teddys/WBERA</td><td>Jump Rate Model</td><td>5%</td><td>25%</td><td>70%</td><td>250%</td><td>12.5%</td></tr><tr><td>Berachain</td><td>Yeetard/YEET</td><td>Jump Rate Model</td><td>5%</td><td>25%</td><td>70%</td><td>250%</td><td>12.5%</td></tr></tbody></table>

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


# Liquidation

For each loan market, liquidation can be triggered when Borrow Limit Used exceeds 100%.

{% hint style="info" %}
Borrow Limit Used = Outstanding Debt in USD/ Borrow Limit in USD x 100%
{% endhint %}

{% hint style="info" %}
Borrow Limit of certain market = Σ Amount of **Collateral i** x Price of **Collateral i** x Collateral Factor of **Collateral i**
{% endhint %}

At Paddle, anyone can participate in liquidations directly through the frontend to help maintain the stability and integrity of the platform.

When a borrower's position becomes undercollateralized, the liquidation process begins. Liquidators can repay a portion of the borrower’s debt and, in return, claim the borrower’s NFT collateral.

To protect users, Paddle uses a partial liquidation model. This means the process will automatically stop once the borrower's debt drops back below his Borrow Limit. This prevents the borrower from losing their entire position and gives them a chance to recover.

## Liquidation Price and Process

$$
Liquidation Price = Price Index \*0.7
$$

To seize an NFT, a liquidator pays **70% of the NFT’s current Price Index**. They can continue repaying debt and claiming NFTs until the position becomes healthy again.

Here is an example:

Let’s say **Alice** uses her NFTs to borrow from the **Steady Teddys / BERA** lending market.

### **Initial Setup:**

* Alice deposits 2 Steady Teddys as collateral:
  * Teddy #8024
  * Teddy #8795
* Price Index per Teddy: 100 WBERA
* Collateral Factor: 50%
* Total Borrow Limit:\
  → 100 (price) × 2 (NFTs) × 0.5 = 100 WBERA
* Alice borrows 90 WBERA

✅ At this point, her position is healthy.

### **Market Change:**

* The Price Index drops to 85 WBERA
* New Borrow Limit = 85 × 2 × 0.5 = 85 WBERA
* Alice’s debt remains at 90 WBERA

⚠️ Now, her debt exceeds the borrow limit, triggering liquidation.

### **Liquidation Process:**

* Bob (a liquidator) steps in to help repay Alice’s debt.
* He chooses to seize Teddy #8024
* Liquidation Price = 85 (price index) × 0.7 = 59.5 BERA

Bob pays 59.5 BERA to the protocol, receives Teddy #8024, and helps reduce Alice’s debt.

### **Updated Position:**

* Remaining Collateral: 1 Teddy (#8795)
* New Borrow Limit = 85 × 1 × 0.5 = 42.5 WBERA
* Remaining Debt = 90 – 59.5 = 30.5 WBERA

✅ Now Alice’s borrow limit (42.5 WBERA) is greater than her debt (30.5 WBERA), so liquidation ends automatically.

## **Overpayment Scenario**

If liquidation continues and only one NFT is left, a liquidator may repay more than the borrower's total debt to claim the NFT. In such cases, the excess amount is not returned but is instead allocated to the protocol reserve, supporting community incentives such as $PADD staking rewards and BGT emission bribes.


# Price Oracle

Similar to Aave and Compound, Paddle relies heavily on oracle price feeding to provide the real-time price reference for underlying assets. These prices are related to collateral value, borrowing amount, and when to trigger liquidations.

### **bitsCrunch and Chainlink's NFT Price Oracle** <a href="#more-on-chainlinks-nft-price-oracle" id="more-on-chainlinks-nft-price-oracle"></a>

Paddle has integrated both Chainlink and bitsCrunch to enhance the accuracy and security of NFT pricing within our loan markets. As a trusted provider of decentralized oracles, Chainlink has secured over $6.7 trillion in transaction value for leading DeFi protocols and plays a crucial role in bringing reliable price feeds to the NFT-Fi sector. In parallel, bitsCrunch offers a suite of AI-powered on-chain analytics that strengthen price discovery and asset validation—especially within emerging ecosystems like Berachain.

By combining the strengths of these two providers, Paddle is able to access high-quality, tamper-proof NFT price data, enabling more precise collateral calculations. This integration ensures fairer loan terms, better risk control, and stronger protection of user interests in an increasingly complex NFT lending environment.

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

**About Chainlink**

Chainlink is the industry-standard Web3 services platform that has enabled trillions of dollars in transaction volume across DeFi, insurance, gaming, NFTs, and other major industries. As the leading decentralized oracle network, Chainlink enables developers to build feature-rich Web3 applications with seamless access to real-world data and off-chain computation across any blockchain and provides global enterprises with a universal gateway to all blockchains.

**About bitCrunch**

bitsCrunch is a leading global data analytics company specialising in multi-chain insights for NFTs and digital assets. We are pioneering crypto data forensics to allow retail, institutional and venture investors to make better decisions in crypto assets.


# PADD Liquidity Incentives

## Borrowers

Borrowers on Paddle Money Market earn **$PADD rewards** for borrowing from lending pools.

Each market has a unique **“PADD Speed”**, which determines how much $PADD is distributed **per block** to borrowers in that market. This rate may vary depending on market conditions, community voting (gauge), or Paddle Governance proposals.

* **Important Notes:**
  * Not all markets receive the same $PADD allocation.
  * $PADD distribution is dynamic and may shift over time.

**Reward Formula**

For each block, a borrower’s $PADD reward is calculated as:

$$
PADD Speed × (Your Current Debt / Total Debt in Market)
$$

Check the table below for live updates on PADD distribution across all markets.

| Chain     | Market              | Monthly $PADD Distribution |
| --------- | ------------------- | -------------------------- |
| Berachain | Bullas/WBERA        | TBD                        |
| Berachain | Steady Teddys/WBERA | TBD                        |
| Berachain | Yeetard/YEET        | TBD                        |

**Note:**\
If you deposit NFTs without borrowing, you won’t earn liquidity incentives (e.g., $PADD rewards) from the lending market. However, to reward early trust and participation, Paddle will collaborate with ecosystem partners to offer additional incentives—such as airdrops—to NFT depositors, regardless of whether they borrow or not.

## Lenders

Just like borrowers, lenders on Paddle Money Market earn $PADD rewards for supplying capital to lending pools.

However, there’s one key difference: $PADD rewards are distributed based on the iToken balance you hold (iTokens represent your current total supply). If you transfer your iTokens to another wallet (not belongs to you), you will lose access to your supplied funds and stop receiving $PADD rewards (the one who has those iToken accrues $PADD rewards).

Once Paddle’s BGT emission goes live, the setup changes slightly. If you stake your iTokens on platforms like Infrared Finance or BeraHub, your $PADD rewards will be redirected to validator incentives, and you'll instead receive BGT or iBGT—ensuring your rewards still flow back to you, just in a different form.

**Reward Formula**

For each block, a lender's $PADD reward is calculated as:

$$
PADD Speed × (Your Current Supply / Total Supplyin Market)
$$

Check the table below for live updates on PADD distribution across all markets.

| Chain     | Market              | Monthly $PADD Distribution |
| --------- | ------------------- | -------------------------- |
| Berachain | Bullas/WBERA        | TBD                        |
| Berachain | Steady Teddys/WBERA | TBD                        |
| Berachain | Yeetard/YEET        | TBD                        |


# BGT Emission + Beratrax Integration (Thoon)

To deepen liquidity and attract more capital, Paddle will initiate a governance proposal to whitelist Reward Vaults (iWBERA-TEDDYS, iWBERA-BULLAS, and iYEET-YEETARD) for BGT emissions on Berachain.

Once approved, this will enable both Paddle and its capital suppliers to participate in Berachain’s PoL system—redirecting BGT emissions to incentivize lending activity and build long-term, sustainable on-chain liquidity.

To simplify the user experience, Paddle will collaborate with Infrared Finance and Beratrax, allowing users to simply supply WBERA via Beratrax. All rewards will then be auto-compounded, increasing WBERA holdings over time.

More details will be shared once the governance vote passes and the Reward Vault integration is live.

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


# User Guide


# Borrower

### **Step 1: Deposit Your Steady Teddys**

Start by depositing your Steady Teddys NFTs into the **Steady Teddys / WBERA** pool.

### **Step 2: Check Your Borrow Limit**

Your borrow limit is determined by:

* **Collateral Factor** of Steady Teddys
* **Current Price Index** (real-time floor price)

This sets the maximum amount of WBERA you can borrow from the pool.

### **Step 3: Borrow from the Pool**

You can borrow any amount up to your borrow limit.

### **Step 4: Interest Accrual**

Interest on your loan is automatically added to your total debt. The interest rate is **dynamic**, based on the utilization rate of the pool (higher usage = higher rate).

### **Step 5: Flexible Repayments & Top-Ups**

You can repay your debt or borrow more at any time, as long as your total debt stays within your borrow limit.

### **Step 6: Withdraw Collateral**

You may withdraw your Teddy NFTs at any time, provided your remaining debt is still below your borrow limit.

### **Step 7: Claim $PADD Rewards**

Once the claim function is live post-TGE, you can claim the $PADD rewards you've earned for borrowing.


# Lender

We take Steady Teddys/WBERA pool as example

### **Step 1: Deposit WBERA**

Supply WBERA to the **Steady Teddys / WBERA** pool and receive **iWBERA-TEDDYS** tokens, which represent your share in the pool.

### **Step 2: Earn Interest**

Your earnings are reflected in the **exchange rate** between iWBERA-TEDDYS and WBERA.\
The interest rate is **dynamic**, based on pool utilization—higher utilization = higher interest for lenders.

### **Step 3: Withdraw Anytime (if liquidity allows)**

You can supply more or withdraw at any time, as long as there’s enough liquidity in the pool.\
Note: If too much has been borrowed, full withdrawal might not be immediately possible.

### **Step 4: Claim $PADD Rewards**

Once the claim function is live post-TGE, you’ll be able to claim your earned **$PADD rewards** directly.


# Mechanics

This section will provide you with a comprehensive description of Paddle Battle's game mechanics.

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

Welcome to Paddle Battle! An on-chain trading game platform that allows users to wager various assets (such as ERC-20 tokens, Memecoins and soon NFTs!) to challenge others to a duel or accepting existing challenges.

Offering several exciting modes to play:

* Token Duels: Fast-Paced Betting Rounds
* Degen PvP: 1-1 Token Battles
* More in the pipeline

## **How to Start?**

1. **Connect Your Wallet** – Link your wallet and deposit the assets you want to use in battles.
2. **Deposit Your Stakes** – Any asset you deposit becomes part of your **duel balance**.

#### **Example:**

Alex deposits **100 USDT, 5 BERA, and 100 BITCOIN**. These now form his **duel balance**, allowing him to place wagers.

**Alex’s Duel Balance:**

* 100 USDT
* 5 BERA
* 100 BITCOIN

Now, he can **join existing battles** or **create duels** using any of these assets.

## Game Modes

### **1. Token Duel – Fast-Paced Betting Rounds**

A quick-fire battle mode where players bet on **predefined token matchups**.

**How It Works:**

* **Predefined Battle Pairs** – Paddle sets up default matchups (e.g., **BERA vs. SOL**) with:
  * **Stakes:** Users wager specified assets (e.g., BERA).
  * **Betting Window:** Open for **15 minutes**.
  * **Battle Duration:** Runs for **15 minutes**.
* **Wagering Phase:** Players bet any amount from their balance on either side.
* **Battle Phase:** Once the wagering phase ends, the battle begins.

**Fees & Rewards:**

* **2.5% of the wagered amount** is deducted as a **gaming fee**, which is used for:
  * **Referral Rewards (Rebates)**
  * **$PADD Stakers**

**Winning & Payouts:**

* The side with the **higher price increase** wins and shares the total prize pool **proportionally**.
* This mechanic encourages players to **strategically balance both sides**, factoring in **expected value and game psychology** to bet on the side with fewer wagers for a higher potential return.

**Continuous Play:**

* A new **Token Duel** begins shortly after each round, ensuring **non-stop action**.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfljnutrXtZV3c40L6TWKOdJVqRt6kizp4HiMTtTMUty4C9SjfDL7jm9nCguWMe14iXeb3SUgFLhlVvKGPULxEHUEvV1dIi55sBIE1_1SWPjHMaxmD8JWxF89H_O0mxjaMltGrz-iuDTjLo9lo0NtIKlM-k?key=J2oFshAeCrEEUIpUqsBoOg" alt=""><figcaption></figcaption></figure>

### 2. Degen PvP – 1-on-1 Token Performance Battles (Coming Soon)

A **strategic** battle mode where players carefully select their **own token basket** to compete in head-to-head matchups, testing their market insights and decision-making skills.

### **How It Works**

**Creating a Duel - one** player sets up a duel by:

* Placing the **stake** (e.g., 100 USDT, 5 BERA, or 100 BITCOIN).
* Setting the **challenge window** (time for others to join).
* Specifying the **start time** and **duel duration** (e.g., 1 day or 1 week).

**Accepting the Duel -** Another player (e.g., Ben) accepts the challenge by **matching the exact stake**. Once accepted, the duel begins at the scheduled time.

**Gameplay Mechanics**

* Players **do not trade real assets**—instead, they use **paper money** to simulate market bets.
* Each player selects one **token or several tokens (customized basket) they believe will outperform** based on **price increase percentage**.
* Paddle pulls **real-time data** from **Oracles and CoinGecko API** to determine results.
* Once the duel starts, **2.5% of the wagered amount** is deducted as a **gaming fee**, which is used for:
  * **Referral Rewards (Rebates)**
  * **$PADD Stakers**

**Winning & Payouts**

* The player whose chosen token basket has the **highest price increase percentage** wins.
* The winner takes the **entire prize pool**.
* The loser forfeits their stake.

**Example:**

* Alex and Ben both stake **50 USDT**.
* If Ben wins, he receives **100 USDT - gaming fee**.
* Alex loses his 50 USDT, but any additional assets in his balance remain untouched.

**Alex's Remaining Balance:**

* **50 USDT**
* **5 BERA**
* **100 BITCOIN**

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdOOwAIbO_f0vxAOqHH0YIIoQoJjJsCBVYSGzquFT7aR3Qkeq_d2-ASn6jnSKhIu-TYoK9iQaYnCnvOdraQQtGW_uLL3vWxjcRg9PrWU47EeilQnJTIQPfezkNFzFvPMgPEMXH6jBGxs1Xj4iOFFccWvpQx?key=J2oFshAeCrEEUIpUqsBoOg" alt=""><figcaption></figcaption></figure>

## How to Exit?

If a player (e.g., Alex) wants to withdraw, they can do so at any time, withdrawing any amount from their balance.&#x20;

## The Use of Deposits

To maximize capital efficiency, Paddle integrates with **Dolomite, Aave, and other lending protocols** to generate additional yield from user deposits.

* A portion of deposited funds is allocated to lending protocols and yield aggregators, generating additional returns for traders.
* The percentage of funds supplied is dynamically adjusted in real-time based on:
  * Market conditions
  * Deposit and withdrawal activity
  * Liquidity demand on Paddle


# Revenue

Paddle Battle generates revenue through **two main sources**:

* **Gaming Fees** – Collected from wagers.
* **Supply Interest** – Earned from third-party yield platforms.

However, **the majority of these revenues are redistributed** back to **traders and $PADD stakers**, ensuring an incentivized and sustainable ecosystem.

### Gaming Fee

* **2.5% of every wager** is collected as a gaming fee.
* **Revenue Distribution:**
  * **25-75%** is redistributed as **rebates** via the [**referral system**](broken://pages/Vsed1OF28nfgMKdczieu).
  * **25%** is retained as **protocol revenue**.
  * The remainder is **distributed to $PADD stakers** as rewards.

### Supply Interest&#x20;

To maximize **capital efficiency**, Paddle integrates with **Dolomite, Aave, and other lending protocols** to generate extra yield from deposits.

* **A portion of deposits is supplied to lending protocols and yield aggregators.**
* The **% of funds allocated** is dynamically adjusted based on **market conditions and deposit/withdrawal activity**.
* **Revenue Distribution:**
  * **70%** is distributed **monthly to depositors**, proportional to their balance.
  * **20%** is distributed **monthly to $PADD stakers**.
  * **10%** is retained as **protocol revenue**.


# Referral System

The Paddle Finance referral system is designed to reward users for bringing new participants to the platform through a flexible and transparent structure. By sharing invitation codes, users can earn a share of the gaming fees from their invitees, or even the invitees of their invitees.

## **How It Works**:

### **Invitation Codes:**

* Every user receives a unique invitation code to share with others.
* When someone signs up using your code, a **permanent referral relationship** is established. This relationship is valid across all chains where Paddle is deployed.
* **Self-invitations are not allowed**.

### **Earning Referral Rewards**

* You earn at least **25% of the gaming fees** generated by your invitees.

### **Additional Features**:

* **Permanent Referrals**: Once a referral relationship is established, it remains in place for all future game modes by your invitee.
* **No Exploitation**: Self-referrals and suspicious activities (e.g., creating fake accounts or trading with your own invitees) will be monitored and penalized.

### **Tiered Referral System**

Your **referral earnings scale** based on your invite count, referral trade volume, and manual review.

**Referral Levels:**

* **Level 1:** Earn **25%** of gaming fees from direct invitees.
* **Level 2:** Earn **50%** of gaming fees from direct invitees.

**Referral Titles:**

* **General** – Earn rebates only from **direct invitees** (first layer).
* **Commander** – Earn **25% of every gaming fee** within your **entire referral network**, including your invitees' invitees.

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

### **Example Calculation**

Assume the current **gaming fee = 2.5%** and a trader you invited **trades $10,000**:

* **As a Level 1 referrer:**
  * $10,000 x 2.5% x 25% = **$62.5**
* **As a Level 2 referrer:**
  * $10,000 x 2.5% x 50% = **$125**
* **As a General:**
  * If your invitee (Trader A) invites **Alice**, and Alice trades **$10,000**, you **earn nothing** from Alice.
* **As a Commander:**
  * You still earn **$62.5** from Alice’s trade, even though she wasn’t your direct invitee.

### **Claiming Referral Rewards**

* Referral earnings can be **claimed monthly** via personal dashboards.

### **Referral System for Vouchers**

* The **referral system applies to all supported settlement currencies** (e.g., **$BERA, $USDT, etc.**).
* **Vouchers do not generate referral rebates**, as they hold no monetary value.
* **Encourage your invitees to trade with real tokens** to maximize your earnings.


# PADDenomics

We established Paddle Finance to bridge the existing gap in decentralized liquidity protocols for bespoke assets. Our mission is to develop a platform that is not only decentralized but also fair, liquid, and scalable.

The PADDenomics framework provides a structured roadmap for achieving decentralization and autonomy within Paddle Finance. It includes governance mechanisms and financial incentives tailored to align the interests of all stakeholders in the Paddle ecosystem. Our strategic approach ensures that both the protocol's functionality and the PADD token enhance and secure the continuous development and operations of Paddle Finance. This cohesive vision aims to create a robust environment that promotes active participation and mutual success across our community.

## Token Metrics

The total supply of PADD is 1 billion (1,000,000,000). The token distribution breaks down as follows:

<table><thead><tr><th width="142.05078125">Allocation</th><th width="139.31640625">% of Total Supply</th><th> Details</th><th>TGE Unlock</th><th>Vesting Schedule</th></tr></thead><tbody><tr><td>Seed</td><td>7%</td><td>CID Group</td><td>0%</td><td>6 months cliff then 18 months daily vesting</td></tr><tr><td>Private</td><td>8%</td><td>Pavillion &#x26; Angels</td><td>0%</td><td>6 months cliff then 12 months daily vesting</td></tr><tr><td>KOL</td><td>6%</td><td>KOL collaborations</td><td>18%</td><td>1 month cliff then 4 months daily vesting</td></tr><tr><td>Public</td><td>2%</td><td>Eesee Launchpad</td><td>20%</td><td>1 month cliff then 4 months daily vesting</td></tr><tr><td>Team</td><td>10%</td><td>Team dev expense</td><td>0%</td><td>12 months cliff then 24 months daily vesting</td></tr><tr><td>Marketing</td><td>5%</td><td>Future co-marketing</td><td>0%</td><td>3 months cliff then 18 months daily vesting</td></tr><tr><td>Community Rewards</td><td>32%</td><td>Long-term user incentive plans.</td><td>0%</td><td>36 months daily vesting</td></tr><tr><td>Liquidity</td><td>12%</td><td>Reserved for listing and market makers.</td><td>50%</td><td>12 months daily vesting</td></tr><tr><td>Treasury</td><td>8%</td><td>Reserved for ecosystem growth</td><td>0%</td><td>24 months daily vesting</td></tr><tr><td>Advisor</td><td>3%</td><td>Value added advisors</td><td>0%</td><td>3 months cliff then 12 months daily vesting</td></tr><tr><td>Airdrop</td><td>7%</td><td>Early users</td><td>10%</td><td>3 months daily vesting</td></tr></tbody></table>

<figure><img src="/files/6Q2Nz3RS8IIWmUBkMQz8" alt=""><figcaption></figcaption></figure>


# About PADD

$PADD is integral to the Paddle DAO and serves several key functions designed to reward liquidity contributors and engage long-term supporters in the governance of Paddle Finance.&#x20;

## **Governance Participation**

PADD holders will have the right to vote on various DAO proposals and platform parameters, actively participating in the decision-making process.

## **Token Accessibility**

$PADD is not claimable yet. To align with our Token Generation Event (TGE) timeline on decentralized and centralized exchanges, all $PADD rewards earned on the Paddle platform, though visible and trackable, will be claimable at a later date. We will keep you updated through our official social media channels and appreciate your understanding and support as we strive to provide a seamless experience on Paddle.

## **Buyback & Burn**

As part of our commitment to enhancing value for our stakeholders and supporting the stability of the $PADD token, Paddle Finance will allocate **25% of our monthly revenue to buy back and burn $PADD tokens** starting within 3 months after TGE. This strategic initiative is designed to reduce the overall supply of $PADD tokens in circulation, potentially increasing their scarcity and value over time. The buyback and burn process will be conducted transparently, with details provided regularly to our community. This approach not only underscores our dedication to responsible financial management but also aligns with our long-term goals to foster a robust and sustainable ecosystem for all users of Paddle Finance.


# PADD Reward

Each $PADD reward will kick start right after TGE.

## $PADD Staking

Similar to APE staking, Paddle allows holders of $PADD tokens to actively utilize their idle tokens. By staking them in the $PADD staking pool, holders can earn additional rewards in the form of more $PADD tokens. The rewards are distributed in real time based on the Pool Rewards and Total Pool Size. There are no lock up periods, so you can add and remove $PADD to the pool at any given time.

You can get yourself familiar with the staking mechanism at <https://apestake.io/>.&#x20;

## **Seasonal Reward Distribution**

Paddle rewards users who contribute to liquidity and actively engage with the platform by distributing **$PADD tokens**. This incentivizes continuous loan offerings, maintains sufficient liquidity, and drives product usage.

**Seasonal rewards will be distributed to:**

* Users earning points through **P2P Lending** and **OTC trades**
* **Trade Battle depositors**
* **Trade Battle leaderboard winners**
* **NFT Instant Loan suppliers** who contribute to the cash-side TVL
* **NFT Instant Loan borrowers** who contribute to the NFT-side TVL

Further details will be announced before TGE.


# Fee Collection & Distribution

Paddle Finance implements a platform fee structure to generate income, with PADD stakers set to benefit significantly. In the future, 50% of the income from these platform fees will be claimable by PADD stakers and distributed proportionally.

**Current Platform Fee Structure:**

* **Margin Fee:** A fee equal to 1% of the loan and OTC deal principal (currently it is set as 0% to encourage our early adopters).
* **Lender Fee:** A fee amounting to 10% of the interest earned on a loan.
* **Liquidation Penalty:** In the event of loan liquidation, after repaying the liquidity pool, a 10% penalty fee is deducted from the remaining amount.

**Upcoming Developments:**

As we continue to enhance our platform’s functionality, we will introduce additional fee items. These enhancements are designed to support a wider range of services and deliver greater value to our users.

## **Real-Time Distribution Schedule:**

* **Calculation of Fees:** Fees eligible for distribution are calculated in real time, based on the proportion of PADD tokens each staker stakes relative to the total PADD tokens staked on the platform. This dynamic approach ensures that fee distributions are consistently fair and reflect current holdings accurately.
* **Timing of Distributions:** The calculation of fees is integrated within the smart contract system. As a result, whenever platform revenue is generated, it automatically flows into the distribution contract. PADD stakers can then claim their share directly from this contract without delay.

This structured approach ensures that the distribution of fees is transparent, timely, and equitable, fostering a mutually beneficial relationship between Paddle Finance and its community of token holders.


# Borrower

Note: The assets displayed in the screenshots are for illustrative purposes only.

## Raise a loan request

<figure><img src="/files/6EkEFzNwToJa4SQdmKSL" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/BSzR5H6ZDDE6lJfVlGwj" alt=""><figcaption><p>Borrower could put ERC-20s as collateral</p></figcaption></figure>

<figure><img src="/files/xpmawm8O0Gd4GW09oUY6" alt=""><figcaption><p>Of course borrower could combine ERC-20s and NFTs into a collateral basket</p></figcaption></figure>

<figure><img src="/files/IqE7LoP0A1TBuiLCtWF3" alt=""><figcaption><p>Borrower could select multiple IDs, and then approve in MetaMask</p></figcaption></figure>

<figure><img src="/files/VuJRF6k29dphab3hoiTq" alt=""><figcaption><p>Fill in loan parameters and then click borrow</p></figcaption></figure>

<figure><img src="/files/GiQvP05EnIDH437O3KLI" alt=""><figcaption><p>Raising a loan request only requires signature instead of transferring assets first</p></figcaption></figure>

<figure><img src="/files/9L08JsfI860gQrk3v8Ut" alt=""><figcaption><p>Once done, people will see your loan order here</p></figcaption></figure>

<figure><img src="/files/8elvnZQ0AtTYm9CSZxxi" alt=""><figcaption><p>Borrowers could also check their orders in dashboard</p></figcaption></figure>

## Repay your loan

<figure><img src="/files/z9hxKCp9S0MPvHXlgohb" alt=""><figcaption><p>Once the loan was fulfilled by a lender, loan order would be moved to "Active Loans"</p></figcaption></figure>

<figure><img src="/files/L2w7l35njqjWDuEBE2qP" alt=""><figcaption><p>Click repay and confirm in MetMask</p></figcaption></figure>

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

<figure><img src="/files/knlMQJ7Os0gwVMgDJLwB" alt=""><figcaption><p>Borrower receives their collaterals</p></figcaption></figure>


# Lender

Note: The assets displayed in the screenshots are for illustrative purposes only.

## Fulfill a loan request

<figure><img src="/files/Jr5BKNvADiEGxhtNNLQ0" alt=""><figcaption><p>Check the parameters, click Lend and confirm in MetaMask</p></figcaption></figure>

<figure><img src="/files/1dVucpZJc1p4HBNhGwLk" alt=""><figcaption><p>Lenders could check the loan status in dashboard</p></figcaption></figure>

## Loan has been repaid

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


# OTC Trade

Note: The assets displayed in the screenshots are for illustrative purposes only.

## Propose an OTC trade

Create an OTC order by selecting the asset you want to receive (top) and the asset you are offering (bottom).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdpjXhpURpLhFy6QyN9mpPWRGcDRgNBkdhCXDQiqZjAwHIRNXi6pRvP_QZGLZthejYSIa_Jrs70Tyz0KarQStReRfpChHI7Jsqz-SWzeh7durQGFr6X_5zS8gzAMyqiTaNzBgBXVA?key=xsSa9vvUxmpUap6VPK8yGOQw" alt=""><figcaption></figcaption></figure>

Select the assets you want to receive and the assets you are offering. You can include any assets in the order as long as the assets you are offering are available in your wallet.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeLAzL0Dl4RpaaIZYnGarZwxY4-EUKg2zoa8lp0eOlPp8v-FHfxFmI56fT5JbTdm-m2Cnq-5pjMwMI7Opmn5BZKV-62nKFn7mKMeVngL-7qljc1fvQMv2WVxKZ8Y7fcthQfhHUqtw?key=xsSa9vvUxmpUap6VPK8yGOQw)![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfxc6MmKqSIIMvpJKkY0g7VZeJcYE1OnEyG7kmiVWuBUenhyRmD5jtna0haQB_zk6i7WoNkFiPmZ78sa9Zd8kOv0OLLhWfDtNhx-CyH6o0Yw9kC61_INZVq3IH8_XWBHBrQ_sNBVw?key=xsSa9vvUxmpUap6VPK8yGOQw)

Set the quantity/ID for the assets you are offering and requesting. Authorize the assets you are offering, choose the trade recipient (open to all or a specific address), set the order expiration time, and then submit the order and confirm in your wallet.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfBCQdbpDIRvA0-R3tRnysrcBJ9nD0lcWClndS3mDhqAgW7UCsm_gb7QPyFa3MINnDt80_KVhsHzyumNkKaTDkSio481KuHdcGoeMZ1SYp4ywwKzuUttNjRU39-VV7MeIaySd7J?key=xsSa9vvUxmpUap6VPK8yGOQw" alt=""><figcaption></figcaption></figure>

Once your order is live on the OTC marketplace, you can share it with anyone or directly with the counterparty you’ve already agreed with.

Ensure that your assets are available in your wallet; otherwise, your counterparty will be unable to complete the trade.

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

## Cancel the order

To cancel an order, you can do so through this option.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcK__2ADvZ17_sGplM9rw_Pl-WJ9JQFgTov0OcncLLPTWhb4N0qetqP57F2oDyt_yMMV-EAv0-QIKnKznFWSyguczzODQ6cTZdxw7q4y1twulr3glvXLwUeyxtMA6KMGAGMQkTVsg?key=xsSa9vvUxmpUap6VPK8yGOQw" alt=""><figcaption></figcaption></figure>

## Take an OTC trade

Find the trade that you want to accept, authorize the assets you have been requested, initiate the transaction, and complete the trade.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe7QE4YMHjxu7pJtUQR4NdmDzgjBWOt8_9mx6nLsQLb_sWMBpHGIDpmspv7JQE6VWQhynQIhQkjsYpccslJABn8cXutcEdJ2h0aXO8nBZxNibeRQGcbU4-ZMbQva4xJqpZRhWOvkQ?key=xsSa9vvUxmpUap6VPK8yGOQw" alt=""><figcaption></figcaption></figure>

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdO9PriToR6k9AbzELywj0ErL2nKcTC55CveKtwYgL84mF3y6KVOfm7mbPIYCd6NM9trsHibc5U51_aFrOC0NmSq2uM7q4_pP3pls-PSOj0uUw5sQsWyYdhCpkY0kygqrixEvQu?key=xsSa9vvUxmpUap6VPK8yGOQw)

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc2w-lfTZgoBUk6SXN661t1MIFhCQxVok_V2zla3zCt8fDhTKCLh7F6ZIFZswhPnSnnxZGFHaX_06RSBr46lbsxLayCVldofKD_PlzkXTxrBswujiE252cPAqo9dVaRd95nI7D2Rw?key=xsSa9vvUxmpUap6VPK8yGOQw" alt=""><figcaption></figcaption></figure>

If you're unable to take the trade or notice unusually high gas fees, it likely means the assets offered by the order maker are no longer in their wallet. Avoid paying excessive gas fees to force the transaction.

## Notes

1. This is a **non-custodial** OTC marketplace, meaning the maker's assets remain in their wallet and are **not** held by our smart contract. The trade is only executed when the taker provides the requested assets and completes the transaction.
2. If the gas fee is extremely high when taking the trades, it means that the assets offered by the order maker are no longer in their wallet. Avoid paying excessive gas fees to force the transaction.


# API Guide

The Paddle API provides developers with seamless access to our comprehensive suite of features, enabling integration with Paddle Finance’s decentralized ecosystem. With the API, you can build custom solutions such as internal lending platforms and OTC markets, allowing for versatile, real-time financial operations.

**Please Note**: This documentation is currently in a closed beta and remains under active development. **USE IT AT YOUR OWN RISK.** While our API is free to access during this beta phase, we plan to transition to a subscription model in the future.

For inquiries about our **Telegram Push Notification Bot** or if you have specific business requirements, please connect with us through our **Telegram Group**: <https://t.me/paddlefi>.


# Loan Endpoints

The endpoints below allow you to interact with Loan.

## **Contract Name**

* ApproveTrade

## **Mainnet Addresses**

<table data-header-hidden><thead><tr><th width="142"></th><th></th></tr></thead><tbody><tr><td><strong>Network</strong></td><td><strong>Contract Address</strong></td></tr><tr><td>Arbitrum</td><td><code>0x4d5797F05992c9E81c64a39CEe5A8BA56df8D38e</code></td></tr><tr><td>Base</td><td><code>0x54A70516e9c0223F4a92bE3a4832a06f546e783B</code></td></tr><tr><td>Ethereum</td><td><code>0x54A70516e9c0223F4a92bE3a4832a06f546e783B</code></td></tr><tr><td>Polygon</td><td><code>0x4d5797F05992c9E81c64a39CEe5A8BA56df8D38e</code></td></tr><tr><td>Bitlayer</td><td><code>0x54A70516e9c0223F4a92bE3a4832a06f546e783B</code></td></tr><tr><td>BSC</td><td><code>0x83541A6B4A5c5512624CcbF35E9c77290f4068C0</code></td></tr><tr><td>Apechain</td><td>0x9688B0965885ca8Db34f3C7187A3D0eD4E633852</td></tr></tbody></table>

***

## **Smart Contract Interface**

### **1. Get the Nonce of the User's Order**

Fetch the nonce of the order created by the user.

* **Function**: `nonces(address maker) returns (uint256)`

#### Request Parameter

| **Parameter Name** | **Required** | **Type**  | **Description** |
| ------------------ | ------------ | --------- | --------------- |
| `maker`            | Yes          | `address` | Creator Address |

#### Response Parameter

| **Parameter Name** | **Type**  | **Description**  |
| ------------------ | --------- | ---------------- |
| `nonce`            | `uint256` | User order nonce |

***

### **2. Calculate the Hash of the Order**

Calculate the hash of an order, required when creating the order.

* **Function**: `hashOrder(Order memory order) returns (bytes32)`

#### Request Parameter

| **Parameter Name** | **Required** | **Type** | **Description** |
| ------------------ | ------------ | -------- | --------------- |
| `order`            | Yes          | `Order`  | Order details   |

#### Response Parameter

| **Parameter Name** | **Type**  | **Description** |
| ------------------ | --------- | --------------- |
| `orderHash`        | `bytes32` | User order hash |

***

### **3. Lend Funds Using the Signed Order Information**

Use the borrower's signed order to lend funds.

* **Function**: `loan(Order memory loanOrder)`

#### Request Parameter

| **Parameter Name** | **Required** | **Type** | **Description**                              |
| ------------------ | ------------ | -------- | -------------------------------------------- |
| `loanOrder`        | Yes          | `Order`  | Order information from centralized interface |

#### Order Structure

| **Parameter Name**  | **Required** | **Type**  | **Description**                               |
| ------------------- | ------------ | --------- | --------------------------------------------- |
| `maker`             | Yes          | `address` | Borrower Address                              |
| `taker`             | Yes          | `address` | Lender address (use 0 address)                |
| `asset`             | Yes          | `Asset[]` | List of collateral assets                     |
| `currency`          | Yes          | `address` | Funding token address                         |
| `price`             | Yes          | `uint256` | Loan amount                                   |
| `deadline`          | Yes          | `uint256` | Fundraising deadline                          |
| `duration`          | Yes          | `uint256` | Loan duration                                 |
| `interestPerSecond` | Yes          | `uint256` | Interest accrued per second after loan        |
| `endTime`           | Yes          | `uint256` | Redemption deadline (use 0 if not applicable) |
| `themselves`        | Yes          | `bytes`   | Signed transaction data                       |

***

### **4. Repay Principal and Interest to Redeem Asset**

Allows the borrower to repay the principal and interest to reclaim the collateral.

* **Function**: `redeem(bytes32 orderHash)`

#### Request Parameter

| **Parameter Name** | **Required** | **Type**  | **Description**             |
| ------------------ | ------------ | --------- | --------------------------- |
| `orderHash`        | Yes          | `bytes32` | Order hash (from interface) |

***

### **5. Liquidate Overdue Orders**

Allows the lender to liquidate an overdue order and claim the collateral.

* **Function**: `liquidate(bytes32 orderHash)`

#### Request Parameter

| **Parameter Name** | **Required** | **Type**  | **Description**             |
| ------------------ | ------------ | --------- | --------------------------- |
| `orderHash`        | Yes          | `bytes32` | Order hash (from interface) |

***

### **6. Cancel Order**

Allows the creator to cancel an order.

* **Function**: `cancelOrder(Order memory order)`

#### Request Parameter

| **Parameter Name** | **Required** | **Type** | **Description**                              |
| ------------------ | ------------ | -------- | -------------------------------------------- |
| `order`            | Yes          | `Order`  | Order information from centralized interface |

***

### **7. Cancel Multiple Orders**

Allows the creator to cancel multiple orders in one call.

* **Function**: `cancelMultipleOrders(Order[] memory orders)`

#### Request Parameter

| **Parameter Name** | **Required** | **Type**  | **Description**                            |
| ------------------ | ------------ | --------- | ------------------------------------------ |
| `orders`           | Yes          | `Order[]` | List of order information (from interface) |

***

### **8. Cancel All Orders**

Allows the creator to cancel all orders they have created.

* **Function**: `cancelAllOrders()`

#### Request Parameters

This function does not take any parameters.

***

### **9. Buy Assets Using Signed Order**

Allows a buyer to purchase assets using the seller's signed order.

* **Function**: `buy(Order memory sellOrder)`

#### Request Parameter

| **Parameter Name** | **Required** | **Type** | **Description**                              |
| ------------------ | ------------ | -------- | -------------------------------------------- |
| `sellOrder`        | Yes          | `Order`  | Order information from centralized interface |

***

### **10. Sell Assets Using Buyer's Signed Order**

Allows a seller to sell assets using the buyer's signed order.

* **Function**: `sell(Order memory buyOrder)`

#### Request Parameter

| **Parameter Name** | **Required** | **Type** | **Description**                              |
| ------------------ | ------------ | -------- | -------------------------------------------- |
| `buyOrder`         | Yes          | `Order`  | Order information from centralized interface |

***

### **11. Get Platform Loan Fee Rate**

Returns the platform commission ratio for loans.

* **Function**: `feeRate() returns (uint256)`

#### Response Parameter

| **Parameter Name** | **Type**  | **Description**                              |
| ------------------ | --------- | -------------------------------------------- |
| `feeRate`          | `uint256` | Platform commission ratio (divide by 10,000) |

***

### **12. Get Platform Repayment Interest Fee Rate**

Returns the platform commission rate for repayment interest.

* **Function**: `interestFeeRate() returns (uint256)`

#### Response Parameter

| **Parameter Name** | **Type**  | **Description**                              |
| ------------------ | --------- | -------------------------------------------- |
| `interestFeeRate`  | `uint256` | Interest commission ratio (divide by 10,000) |

***

### **13. Get Minimum Repayment Interest Ratio**

Returns the minimum interest rate for repayment.

* **Function**: `interestFeeRate() returns (uint256)`

#### Response Parameter

| **Parameter Name** | **Type**  | **Description**                          |
| ------------------ | --------- | ---------------------------------------- |
| `interestFeeRate`  | `uint256` | Minimum interest rate (divide by 10,000) |


# OTC Endpoints

The endpoints below allow you to interact with OTC.

## **Contract Name**

* OTCTrade

## **Mainnet Addresses**

<table data-header-hidden><thead><tr><th width="177"></th><th></th></tr></thead><tbody><tr><td><strong>Network</strong></td><td><strong>Contract Address</strong></td></tr><tr><td>Arbitrum</td><td><code>0x597e3CbEA8f34102E0fC59775Ea62EA1dD1f56f8</code></td></tr><tr><td>Base</td><td><code>0xb4F6544fF7A4a586B47F48d06C70bB2e16B5da6f</code></td></tr><tr><td>Bitlayer</td><td><code>0xECB64314e2B7d2e1F997915E1cE4Ce89f3A9e9aa</code></td></tr><tr><td>Ethereum</td><td><code>0x7D75D2A1Fd7F57f3d9b2a47fB3C8A41523d0ba15</code></td></tr><tr><td>Polygon</td><td><code>0x7D75D2A1Fd7F57f3d9b2a47fB3C8A41523d0ba15</code></td></tr><tr><td>BSC</td><td><code>0x7D75D2A1Fd7F57f3d9b2a47fB3C8A41523d0ba15</code></td></tr><tr><td>Berachain Bartio</td><td><code>0xAD387C624bf043F33c913d9403a96b857b133381</code></td></tr></tbody></table>

***

## **Smart Contract Interface**

### **1. Get the Nonce of the User's Order**

Retrieve the nonce of a user's order, required for creating an order.

* **Function**: `nonces(address maker) returns (uint256)`

#### Request Parameter

| **Parameter Name** | **Required** | **Type**  | **Description** |
| ------------------ | ------------ | --------- | --------------- |
| `maker`            | Yes          | `address` | Creator Address |

#### Response Parameter

| **Parameter Name** | **Type**  | **Description**  |
| ------------------ | --------- | ---------------- |
| `nonce`            | `uint256` | User order nonce |

***

### **2. Calculate the Hash of the Order**

Calculate the hash of an order, necessary when creating it.

* **Function**: `hashOrder(Order memory order) returns (bytes32)`

#### Request Parameter

| **Parameter Name** | **Required** | **Type** | **Description** |
| ------------------ | ------------ | -------- | --------------- |
| `order`            | Yes          | `Order`  | Created order   |

#### Response Parameter

| **Parameter Name** | **Type**  | **Description** |
| ------------------ | --------- | --------------- |
| `orderHash`        | `bytes32` | User order hash |

***

### **3. Perform Multi-for-Multi Asset Swap**

Use the signed order information to conduct a multi-asset swap.

* **Function**: `swap(Order memory order_)`

#### Request Parameter

| **Parameter Name** | **Required** | **Type**  | **Description**                              |
| ------------------ | ------------ | --------- | -------------------------------------------- |
| `order_`           | Yes          | `Order`   | Order information from centralized interface |
| `value`            | Yes          | `uint256` | Platform currency to pay as handling fee     |

#### Order Structure

| **Parameter Name** | **Required** | **Type**  | **Description**                                  |
| ------------------ | ------------ | --------- | ------------------------------------------------ |
| `maker`            | Yes          | `address` | Address of the asset's owner (order signer)      |
| `taker`            | Yes          | `address` | Address of the person specifying the transaction |
| `asset`            | Yes          | `Asset[]` | Array of swapped assets                          |
| `currency`         | Yes          | `Asset[]` | Array of assets being swapped in                 |
| `deadline`         | Yes          | `uint256` | Deadline for the order validity period           |
| `themselves`       | Yes          | `bytes`   | Signed transaction data                          |

***

#### **Asset Structure in Order**

| **Parameter Name** | **Required** | **Type**  | **Description**                  |
| ------------------ | ------------ | --------- | -------------------------------- |
| `collection`       | Yes          | `address` | Token address                    |
| `assetClass`       | Yes          | `address` | Token type (e.g., ERC20, ERC721) |
| `amountOrID`       | Yes          | `uint256` | ERC20 quantity or ERC721 ID      |

***

### **4. Cancel Order**

Allows the order creator to cancel an order.

* **Function**: `cancelOrder(Order memory order)`

#### Request Parameter

| **Parameter Name** | **Required** | **Type** | **Description**                              |
| ------------------ | ------------ | -------- | -------------------------------------------- |
| `order`            | Yes          | `Order`  | Order information from centralized interface |

***

### **5. Cancel Multiple Orders**

Allows the order creator to cancel multiple orders in one call.

* **Function**: `cancelMultipleOrders(Order[] memory orders)`

#### Request Parameter

| **Parameter Name** | **Required** | **Type**  | **Description**                                      |
| ------------------ | ------------ | --------- | ---------------------------------------------------- |
| `orders`           | Yes          | `Order[]` | List of order information from centralized interface |

***

### **6. Cancel All Orders**

Allows the creator to cancel all of their orders.

* **Function**: `cancelAllOrders()`

#### Request Parameters

This function does not take any parameters.

***

### **7. Obtain the Minimum Native Currency Fee**

Returns the minimum platform fee charged in native currency.

* **Function**: `feeMinAmount() returns (uint256)`

#### Response Parameter

| **Parameter Name** | **Type**  | **Description**                      |
| ------------------ | --------- | ------------------------------------ |
| `feeMinAmount`     | `uint256` | Minimum native currency platform fee |


# REST Endpoints

### **Overview**

#### **1. Access URL**

* **Production Environment**: [https://api.paddlefi.com](https://api.paddlefi.com/)

#### **2. Request Format**

The API supports both `GET` and `POST` methods. The only request parameter is `p`, and its format is JSON.

* Example: `https://api.paddlefi.com/api/dapp/querychainallinfo.do?p={}`

#### **3. Response Format**

* The response format is standardized as follows:

  ```json
  jsonCopy code{"code":"0","msg":"OK","info":{}}
  ```

| **Parameter Name** | **Type**      | **Description**                                       |
| ------------------ | ------------- | ----------------------------------------------------- |
| `code`             | `string`      | `0`: Successful response, Non-0: Failed response      |
| `msg`              | `string`      | Corresponding failure information for non-0 responses |
| `info`             | `json_object` | Response data (varies by endpoint)                    |

***

### **REST Endpoints**

#### **1. Create Lending/OTC Orders**

* **Endpoint**: `/api/dapp/createorder.do`

**Request Parameters**

| **Parameter Name** | **Required** | **Type**      | **Description**               |
| ------------------ | ------------ | ------------- | ----------------------------- |
| `chainname`        | Yes          | `string`      | Name of the blockchain        |
| `chainid`          | Yes          | `string`      | ID of the blockchain          |
| `useraddr`         | Yes          | `string`      | User address                  |
| `orderfrom`        | Yes          | `string`      | Source platform for the order |
| `orderinfo`        | Yes          | `json_object` | Order object details          |

**OrderInfo Structure (Loan/OTC)**

| **Parameter Name**  | **Required** | **Type**     | **Description**                                                                                    |
| ------------------- | ------------ | ------------ | -------------------------------------------------------------------------------------------------- |
| `maker`             | Yes          | `string`     | Order creator address                                                                              |
| `taker`             | Yes          | `string`     | Trader address, usually filled with `0x000...`                                                     |
| `asset`             | Yes          | `json_array` | List of asset details                                                                              |
| `currency`          | Yes          | `json_array` | List of fund details                                                                               |
| `deadline`          | Yes          | `string`     | Fundraising end time (for Loan orders)                                                             |
| `duration`          | Yes          | `string`     | Loan repayment time after fundraising is successful (in seconds)                                   |
| `interestPerSecond` | Yes          | `string`     | Interest generated per second                                                                      |
| `nonce`             | Yes          | `string`     | Nonce value obtained via contract interface `ApproveTrade.nonces(address maker)`                   |
| `endTime`           | Yes          | `string`     | Repayment deadline, usually filled with `0` and updated automatically after successful fundraising |
| `themselves`        | Yes          | `string`     | Signature (EIP712)                                                                                 |
| `orderType`         | Yes          | `string`     | Type of the order: `LOAN`/`OTC`                                                                    |

**Asset Structure Parameter Description**

<table data-header-hidden><thead><tr><th></th><th width="122"></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Parameter Name</strong></td><td><strong>Required</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td><code>collection</code></td><td>Yes</td><td><code>string</code></td><td>Token address</td></tr><tr><td><code>assetClass</code></td><td>Yes</td><td><code>string</code></td><td>Token class (e.g., <code>ERC20</code>, <code>ERC721</code>, etc.)</td></tr><tr><td><code>amountOrID</code></td><td>Yes</td><td><code>string</code></td><td>Token quantity (ERC20) or ID (ERC721)</td></tr><tr><td><code>name</code></td><td>Yes</td><td><code>string</code></td><td>Token name</td></tr><tr><td><code>symbol</code></td><td>Yes</td><td><code>string</code></td><td>Token symbol</td></tr><tr><td><code>decimal</code></td><td>Yes</td><td><code>string</code></td><td>Token precision</td></tr></tbody></table>

**Response Parameters**

<table data-header-hidden><thead><tr><th></th><th width="169"></th><th></th></tr></thead><tbody><tr><td><strong>Parameter Name</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td><code>warrants</code></td><td><code>string</code></td><td>Order ID</td></tr><tr><td><code>orderHash</code></td><td><code>string</code></td><td>Unique order hash</td></tr></tbody></table>

**Response Example**

```json
jsonCopy code{
  "code": "0",
  "msg": "OK",
  "info": {
      "orderid":"1",
      "orderhash":"0xb3e6fed053a30c96d03861a60ff4a197cf62fa8588878a567913eb14a87fb723"
  }
}
```

***

#### **2. Query Market Order List by Page**

* **Endpoint**: `/api/dapp/querymarketorder.do`

**Request Parameters**

<table data-header-hidden><thead><tr><th width="264"></th><th width="161"></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Parameter Name</strong></td><td><strong>Required</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td><code>page</code></td><td>No</td><td><code>string</code></td><td>Page number (default: 1)</td></tr><tr><td><code>count</code></td><td>No</td><td><code>string</code></td><td>Number of records per page (default: 100)</td></tr><tr><td><code>filter_ordertype</code></td><td>No</td><td><code>string</code></td><td>Filter by order type (<code>LOAN</code>, <code>OTC</code>)</td></tr><tr><td><code>filter_orderfrom</code></td><td>No</td><td><code>string</code></td><td>Filter by order source platform</td></tr><tr><td><code>filter_orderhash</code></td><td>No</td><td><code>string</code></td><td>Filter by order hash</td></tr><tr><td><code>filter_chainname</code></td><td>No</td><td><code>string</code></td><td>Filter by asset chain name (<code>Bitlayer</code>, <code>Bsquare</code>)</td></tr><tr><td><code>filter_chainid</code></td><td>No</td><td><code>string</code></td><td>Filter by chain ID</td></tr><tr><td><code>filter_assetname</code></td><td>No</td><td><code>string</code></td><td>Filter by asset name (<code>USD Coin</code>, <code>Ether</code>)</td></tr><tr><td><code>filter_currencyName</code></td><td>No</td><td><code>string</code></td><td>Filter by currency name (<code>USD Coin</code>, <code>Ether</code>)</td></tr><tr><td><code>filter_assetSymbol</code></td><td>No</td><td><code>string</code></td><td>Filter by asset symbol (<code>USDT</code>, <code>ETH</code>)</td></tr><tr><td><code>filter_currencySymbol</code></td><td>No</td><td><code>string</code></td><td>Filter by currency symbol (<code>USDT</code>, <code>BTC</code>)</td></tr><tr><td><code>filter_taker</code></td><td>No</td><td><code>string</code></td><td>Filter by order taker (can be specific address, <code>0x</code>, or empty)</td></tr><tr><td><code>filter_status</code></td><td>No</td><td><code>string</code></td><td>Filter by order status (e.g., <code>0</code>, <code>1</code>, <code>2</code>)</td></tr><tr><td><code>order_by</code></td><td>No</td><td><code>string</code></td><td>Sort by field and order type (e.g., <code>createtime,desc</code>)</td></tr></tbody></table>

**Response Parameters**

| **Parameter Name** | **Type**      | **Description**                                       |
| ------------------ | ------------- | ----------------------------------------------------- |
| `count`            | `string`      | Total number of matching orders                       |
| `datas`            | `json_array`  | List of matching orders                               |
| `f_chain_name`     | `string`      | Chain name                                            |
| `f_chain_id`       | `string`      | Chain ID                                              |
| `f_create_time`    | `string`      | Order creation time                                   |
| `f_create_user`    | `string`      | Order creator (maker) address                         |
| `f_order_hash`     | `string`      | Unique order hash                                     |
| `f_order_from`     | `string`      | Source platform of the order                          |
| `f_trade_user`     | `string`      | Taker (order trader) address                          |
| `f_status`         | `string`      | Order status                                          |
| `f_order_info`     | `json_string` | Order details (formatted as JSON)                     |
| `f_trade_info`     | `json_string` | Trade details (formatted as JSON)                     |
| `f_id`             | `string`      | Order ID                                              |
| `f_isshow`         | `string`      | Internal flag for whether to display on the front-end |
| `f_update_time`    | `string`      | Last update time                                      |
| `f_uuid`           | `string`      | Internal flag for tracking updates                    |

***

#### **3. Paginated Query of Historical Orders**

* **Endpoint**: `/api/dapp/queryhistoryorder.do`
* **Request Parameters**: Same as for querying the market order list.
* **Response Parameters**: Same as for querying the market order list.

***

#### **4. Paginated Query of Orders Created by User (Maker)**

* **Endpoint**: `/api/dapp/queryusercreateorder.do`

**Request Parameters**

| **Parameter Name** | **Required** | **Type** | **Description**                                  |
| ------------------ | ------------ | -------- | ------------------------------------------------ |
| `useraddr`         | Yes          | `string` | Address of the user whose orders will be queried |

* **Response Parameters**: Same as for querying the market order list.

***

#### **5. Paginated Query of User's Completed Orders (Taker)**

* **Endpoint**: `/api/dapp/queryusertradeorder.do`

**Request Parameters**

| **Parameter Name** | **Required** | **Type** | **Description**                                            |
| ------------------ | ------------ | -------- | ---------------------------------------------------------- |
| `useraddr`         | Yes          | `string` | Address of the user whose completed orders will be queried |

* **Response Parameters**: Same as for querying the market order list


# Tutorials

This tutorial will guide you through quickly completing the following operations:

#### **OTC Market**

1. Listing Assets for Sale
2. Buying Assets
3. Closing My Listing

#### **Loan Market**

1. Creating a Loan Order
2. Lending an Asset
3. Repaying a Loan
4. Liquidating Overdue Orders
5. Closing My Lending Order

***

This tutorial is intended for **front-end developers**, and requires a basic understanding of front-end development as well as knowledge of interacting with smart contracts.

For reference, check out the **web3.js documentation**: <https://docs.web3js.org/>

**Example Code Snippet for Connecting to a Web3 Provider:**

```javascript
javascriptCopy codeconst web3 = new Web3(Provider || new Web3.providers.HttpProvider(RPCUrl));
```


# Source

### **Supported Networkss by Paddle**

<table data-header-hidden><thead><tr><th width="193"></th><th width="159"></th><th></th></tr></thead><tbody><tr><td><strong>Network</strong></td><td><strong>Chain ID</strong></td><td><strong>RPC URL</strong></td></tr><tr><td>Ethereum</td><td>1</td><td><a href="https://eth.drpc.org">https://eth.drpc.org</a></td></tr><tr><td>Polygon</td><td>137</td><td><a href="https://polygon-rpc.com">https://polygon-rpc.com</a></td></tr><tr><td>Arbitrum</td><td>42161</td><td><a href="https://arb1.arbitrum.io/rpc">https://arb1.arbitrum.io/rpc</a></td></tr><tr><td>BSC</td><td>56</td><td><a href="https://bsc-dataseed.binance.org/">https://bsc-dataseed.binance.org</a></td></tr><tr><td>Base</td><td>8453</td><td><a href="https://mainnet.base.org">https://mainnet.base.org</a></td></tr><tr><td>Berachain Bartio</td><td>80084</td><td><a href="https://bartio.rpc.berachain.com">https://bartio.rpc.berachain.com</a></td></tr><tr><td>Bitlayer</td><td>200901</td><td><a href="https://rpc.bitlayer-rpc.com">https://rpc.bitlayer-rpc.com</a></td></tr><tr><td>Apechain</td><td>33139</td><td><a href="https://rpc.apechain.com/http">https://rpc.apechain.com/http</a></td></tr></tbody></table>

***

### **Paddle Contract Addresses**

<table data-header-hidden><thead><tr><th width="149"></th><th width="100"></th><th width="172"></th><th></th></tr></thead><tbody><tr><td><strong>Network</strong></td><td><strong>Chain ID</strong></td><td><strong>Contract Name</strong></td><td><strong>Contract Address</strong></td></tr><tr><td>Ethereum</td><td>1</td><td>ApproveTrade</td><td><code>0x54A70516e9c0223F4a92bE3a4832a06f546e783B</code></td></tr><tr><td>Polygon</td><td>137</td><td>ApproveTrade</td><td><code>0x4d5797F05992c9E81c64a39CEe5A8BA56df8D38e</code></td></tr><tr><td>Arbitrum</td><td>42161</td><td>ApproveTrade</td><td><code>0x4d5797F05992c9E81c64a39CEe5A8BA56df8D38e</code></td></tr><tr><td>BSC</td><td>56</td><td>ApproveTrade</td><td><code>0x83541A6B4A5c5512624CcbF35E9c77290f4068C0</code></td></tr><tr><td>Base</td><td>8453</td><td>ApproveTrade</td><td><code>0x54A70516e9c0223F4a92bE3a4832a06f546e783B</code></td></tr><tr><td>Berachain Bartio</td><td>80084</td><td>ApproveTrade</td><td><code>0x4d5797F05992c9E81c64a39CEe5A8BA56df8D38e</code></td></tr><tr><td>Bitlayer</td><td>200901</td><td>ApproveTrade</td><td><code>0x54A70516e9c0223F4a92bE3a4832a06f546e783B</code></td></tr><tr><td>Apechain</td><td>33139</td><td>ApproveTrade</td><td><code>0x9688B0965885ca8Db34f3C7187A3D0eD4E633852</code></td></tr><tr><td>Ethereum</td><td>1</td><td>OTCTrade</td><td><code>0x7D75D2A1Fd7F57f3d9b2a47fB3C8A41523d0ba15</code></td></tr><tr><td>Polygon</td><td>137</td><td>OTCTrade</td><td><code>0x7D75D2A1Fd7F57f3d9b2a47fB3C8A41523d0ba15</code></td></tr><tr><td>Arbitrum</td><td>42161</td><td>OTCTrade</td><td><code>0x597e3CbEA8f34102E0fC59775Ea62EA1dD1f56f8</code></td></tr><tr><td>BSC</td><td>56</td><td>OTCTrade</td><td><code>0x7D75D2A1Fd7F57f3d9b2a47fB3C8A41523d0ba15</code></td></tr><tr><td>Base</td><td>8453</td><td>OTCTrade</td><td><code>0xb4F6544fF7A4a586B47F48d06C70bB2e16B5da6f</code></td></tr><tr><td>Berachain Bartio</td><td>80084</td><td>OTCTrade</td><td><code>0xAD387C624bf043F33c913d9403a96b857b133381</code></td></tr><tr><td>Bitlayer</td><td>200901</td><td>OTCTrade</td><td><code>0xECB64314e2B7d2e1F997915E1cE4Ce89f3A9e9aa</code></td></tr></tbody></table>

***

### **Paddle Whitelisted Tokens**

Paddle supports loans and OTC trading for any asset.

Whitelisted tokens are officially certified assets that can be filtered and sorted in the Paddle DApp frontend.


# Parameter Explanation

The following parameters play an essential role throughout the entire business process. It is necessary to provide a detailed explanation of them.

After creating an order, each record in the **Loan/OTC market** contains the `f_order_info` field, which holds the information from when the order was created.

#### **Operations (Not Limited To)**:

* Creating/makring an OTC Listing
* Cancelling an OTC Listing
* Taking an OTC Listing
* Creating a Loan Listing
* Cancelling a Loan Listing
* Lending Assets

***

#### **Key Parameters**

**Maker**

* The creator of the listing.

**Taker**

* The designated buyer or lender.
* If the order is open to everyone, use the empty address (`0x0000000000000000000000000000000000000000`).
* To specify a buyer or lender, provide their correct address.

**Assets**

* The assets being sold or pledged (only supports **ERC20**/**ERC721**).
* The seller/pledger must grant permission for the assets before listing.
* If the asset is ERC20, convert its precision using `toWei(amount, "decimal")`.

| **Field**    | **Description**                                                                                            |
| ------------ | ---------------------------------------------------------------------------------------------------------- |
| `collection` | Contract address of the asset.                                                                             |
| `assetClass` | Type of contract:                                                                                          |
|              | `0x0000000000000000000000000000000000000020` // Represents ERC20                                           |
|              | `0x0000000000000000000000000000000000000721` // Represents ERC721                                          |
| `amountOrID` | Differentiates ERC20/721. ERC20 assets are the quantity after `toWei`, while ERC721 assets are the NFT ID. |
| `name`       | Asset name.                                                                                                |
| `symbol`     | Asset symbol.                                                                                              |
| `decimal`    | Asset precision.                                                                                           |

**Note**: The asset type only supports **ERC20** and **ERC721**. Each ERC721 asset ID occupies one sequence. See examples below.

***

**Currency**

* The assets being purchased or borrowed (only supports **Native**/**ERC20**).
* The buyer/borrower must grant permission for the `currency` asset before proceeding.
* Convert precision using `toWei(amount, "decimal")`.

| **Field**    | **Description**                                                                 |
| ------------ | ------------------------------------------------------------------------------- |
| `collection` | Contract address of the asset.                                                  |
|              | For network native tokens: `0x0000000000000000000000000000000000000001`.        |
| `assetClass` | Type of contract:                                                               |
|              | `0x0000000000000000000000000000000000000000` // Represents network native token |
|              | `0x0000000000000000000000000000000000000020` // Represents ERC20                |
| `amountOrID` | Quantity after `toWei`.                                                         |
| `name`       | Asset name.                                                                     |
| `symbol`     | Asset symbol.                                                                   |
| `decimal`    | Asset precision.                                                                |

**Currency Example**:

```javascript
javascriptCopy codeconst currency = [
    {
        collection: "0x0000000000000000000000000000000000000001",
        assetClass: "0x0000000000000000000000000000000000000000",
        amountOrID: toWei(1, 18),
        name: "MATIC",
        symbol: "MATIC",
        decimal: 18
    }
];
```

***

**Deadline**

* The fundraising end time (in seconds).
* **Example**:

  ```javascript
  javascriptCopy code1 day = parseInt(Date.now() / 1000) + 86400;
  1 week = parseInt(Date.now() / 1000) + 86400 * 7;
  ```

***

**Duration**

* The loan duration after successful fundraising (in seconds).
* **Example**:

  ```javascript
  javascriptCopy code1 day = 86400;
  1 week = 7 * 86400;
  ```

***

**Interest Per Second**

* The interest generated per second (calculated based on the APR input by the user).
* When displaying on the UI, convert `interestPerSecond` back into APR for user clarity.

***

**Nonce**

* The nonce must be queried from the contract.
* When no interaction has occurred with the contract, the nonce will always be `0`. (Do not assume that a nonce of zero means you can skip this step).


# Loan - Create order

The following code example is provided to help you understand the business process. For commercial use, you must handle parameter validation and exception handling on your own.

This example is tested on the **Polygon-Amoy** chain. Information used in the example can be retrieved from the **Source** directory. All ERC20 assets in the example have been pre-approved (authorized) to the contract `amoy_contract_approveTrade`. For any amounts involved, precision should be converted using `toWei(amount, "decimal")`.

* **Loan/OTC Collateral - Assets Token (Assets)**: Only supports **ERC20** and **ERC721**, network native tokens are not supported.
* **Loan/OTC Payment Token (Currency)**: Only supports **ERC20** and network native tokens, **ERC721** is not supported.

***

#### **Code Example**

```javascript
javascriptCopy code// Import web3js library
import Web3 from 'web3';
import ApproveTradeABI from '../abi/ApproveTrade.json';

// This example is tested on the Polygon-Amoy chain
const amoy_chainId = 80002;
const amoy_chainName = "AMOY";
const amoy_chainRpcUrl = "https://polygon-amoy.infura.io/v3/4ba314367838400fb88f2a1d0e14d42d";
const amoy_contract_approveTrade = "0xF1831ebb3f92A8607E644A1E54Fde4b09F6FE5dE";
const amoy_account = "0xA3932E6Dbf96983Ffdf43974c0BF7edE9fed76DF";

// Initialize web3 instance
// WalletProvider or HttpProvider
const web3 = new Web3("** Wallet **"); // window.ethereum
const Contract = new web3.eth.Contract(ApproveTradeABI, amoy_contract_approveTrade);

// 1. Listing parameters
const maker = "0xA3932E6Dbf96983Ffdf43974c0BF7edE9fed76DF";
const taker = "0x0000000000000000000000000000000000000000"; // Open to all buyers/lenders
const assets = [
  {collection:"0x9A3fad316eB9cC7db65aB6f89672796574CD1B76", assetClass:"0x0000000000000000000000000000000000000721", amountOrID:"28308257", name: "Bored Ape Yacht Club", symbol:"BAYC", decimal: 0},
  {collection:"0x9A3fad316eB9cC7db65aB6f89672796574CD1B76", assetClass:"0x0000000000000000000000000000000000000721", amountOrID:"28308487", name: "Bored Ape Yacht Club", symbol:"BAYC", decimal: 0}, 
  {collection:"0x98700d8fF27Af5F16FdA3bE3bD30aa4585234DCa", assetClass:"0x0000000000000000000000000000000000000020", amountOrID: toWei(1,9), name: "WBTC", symbol:"Wrapped BTC", decimal: 9},
  {collection:"0xc94BC02ecFf5f14b73fe1A3137bb587f5Fa62F5d", assetClass:"0x0000000000000000000000000000000000000020", amountOrID: toWei(1,6), name: "USDT", symbol:"Tether USD", decimal: 6}
];
const currency = [
  {collection:"0x0000000000000000000000000000000000000001", assetClass:"0x0000000000000000000000000000000000000000", amountOrID: toWei(1,18), name: "MATIC", symbol:"MATIC", decimal: 18}
];
const deadline = "1728955149"; // End of fundraising time (in seconds)
const duration = "1036800"; // Loan duration (in seconds)
const interestPerSecond = toWei(toWei(0.00034880771182141044,18),18); // Interest per second

// 2. Retrieve nonces from contract
const nonce = await Contract.methods.nonces(amoy_account).call();

// 3. Sign the order parameters
// Note: Hardware wallet signatures may differ from web wallet signatures, handle accordingly
const signParams = {
  "types": {
    "EIP712Domain": [
      { "name": "name", "type": "string" },
      { "name": "version", "type": "string" },
      { "name": "chainId", "type": "uint256" },
      { "name": "verifyingContract", "type": "address" }
    ],
    "Asset": [
      { "name": "collection", "type": "address" },
      { "name": "assetClass", "type": "address" },
      { "name": "amountOrID", "type": "uint256" }
    ],
    "Order": [
      { "name": "maker", "type": "address" },
      { "name": "taker", "type": "address" },
      { "name": "asset", "type": "Asset[]" },
      { "name": "currency", "type": "address" },
      { "name": "price", "type": "uint256" },
      { "name": "deadline", "type": "uint256" },
      { "name": "duration", "type": "uint256" },
      { "name": "interestPerSecond", "type": "uint256" },
      { "name": "nonce", "type": "uint256" }
    ]
  },
  "domain": {
    "name": "ApproveTrade",
    "version": "1",
    "chainId": amoy_chainId,
    "verifyingContract": amoy_contract_approveTrade
  },
  "primaryType": "Order",
  "message": {
    maker: maker,
    taker: taker,
    asset: assets,
    currency: currency[0].collection,
    price: currency[0].amountOrID,
    deadline: deadline,
    duration: duration,
    interestPerSecond: interestPerSecond,
    nonce: nonce
  }
};
const signResult = await window.ethereum.send('eth_signTypedData_v4',[amoy_account, signParams]);
const sigStr = signResult.result;

// 4. Create a new order
const orderParams = {
  chainname: amoy_chainName,
  chainid: amoy_chainId,
  useraddr: amoy_account,
  orderinfo: {
    maker: maker,
    taker: taker,
    asset: assets,
    currency: currency,
    deadline: deadline,
    duration: duration,
    interestPerSecond: interestPerSecond,
    nonce: nonce,
    startTime: parseInt(Date.now() / 1000),
    endTime: "0",
    sig: sigStr,
    ordertype: "LOAN"
  }
};
const formData = new URLSearchParams();
formData.append("p", JSON.stringify(orderParams));

fetch("https://test-api.paddlefi.com/api/dapp/createorder.do", {
  method: 'POST',
  headers: {
    "content-type": "application/x-www-form-urlencoded"
  },
  body: formData.toString()
}).then(res => res.json())
  .then(datas => {
    console.log(datas);
  }).catch(err => {
    console.log('Error', err);
  });
```

#### **Key Notes**:

1. **Nonce**: Nonce must be retrieved from the contract using `Contract.methods.nonces(account).call()`. Do not skip this step, even if the nonce is `0`.
2. **Signature**: Be cautious with hardware wallets, as they may require special handling for signatures.
3. **Assets**: Only **ERC20** and **ERC721** assets are supported as collateral items.
4. **Currency**: Only **ERC20** tokens and network native tokens are supported as the currency for borrowing.

This example can be used as a starting point for creating loan orders on the **Polygon-Amoy** chain. Be sure to customize it according to your project's requirements.


# Loan - Cancel Order

The following code example is provided to help you understand the business process. For commercial use, you must handle parameter validation and exception handling on your own.

This example is tested on the **Polygon-Amoy** chain. Information used in the example can be retrieved from the **Source** directory. All ERC20 assets in the example have been pre-approved (authorized) to the contract `amoy_contract_approveTrade`. For any amounts involved, precision should be converted using `toWei(amount, "decimal")`.

***

#### **Code Example**

```javascript
javascriptCopy code// Import web3js library
import Web3 from 'web3';
import ApproveTradeABI from '../abi/ApproveTrade.json';

// This example is tested on the Polygon-Amoy chain
const amoy_chainId = 80002;
const amoy_chainName = "AMOY";
const amoy_chainRpcUrl = "https://polygon-amoy.infura.io/v3/4ba314367838400fb88f2a1d0e14d42d";
const amoy_contract_approveTrade = "0xF1831ebb3f92A8607E644A1E54Fde4b09F6FE5dE";
const amoy_account = "0xA3932E6Dbf96983Ffdf43974c0BF7edE9fed76DF";

// Initialize web3 instance
// WalletProvider or HttpProvider
const web3 = new Web3("** Wallet **"); // window.ethereum
const Contract = new web3.eth.Contract(ApproveTradeABI, amoy_contract_approveTrade);

// 1. Example parameters for loan cancellation
// These parameters come from the market listing API, and are identical to those submitted during order creation.

const maker = "0xA3932E6Dbf96983Ffdf43974c0BF7edE9fed76DF";
const taker = "0x0000000000000000000000000000000000000000"; // Open to all buyers/lenders
const assets = [
    {collection:"0x9A3fad316eB9cC7db65aB6f89672796574CD1B76", assetClass:"0x0000000000000000000000000000000000000721", amountOrID:"28308257", name: "Bored Ape Yacht Club", symbol:"BAYC", decimal: 0},
    {collection:"0x9A3fad316eB9cC7db65aB6f89672796574CD1B76", assetClass:"0x0000000000000000000000000000000000000721", amountOrID:"28308487", name: "Bored Ape Yacht Club", symbol:"BAYC", decimal: 0}, 
    {collection:"0x98700d8fF27Af5F16FdA3bE3bD30aa4585234DCa", assetClass:"0x0000000000000000000000000000000000000020", amountOrID: toWei(1,9), name: "WBTC", symbol:"Wrapped BTC", decimal: 9},
    {collection:"0xc94BC02ecFf5f14b73fe1A3137bb587f5Fa62F5d", assetClass:"0x0000000000000000000000000000000000000020", amountOrID: toWei(1,6), name: "USDT", symbol:"Tether USD", decimal: 6}
];
const currency = [
    {collection:"0x0000000000000000000000000000000000000001", assetClass:"0x0000000000000000000000000000000000000000", amountOrID: toWei(1,18), name: "MATIC", symbol:"MATIC", decimal: 18}
];
const deadline = "1728955149"; // End of fundraising time (in seconds)
const duration = "1036800"; // Loan duration (in seconds)
const interestPerSecond = "3488077118214104000000000000"; // Interest per second
const endTime = "0"; // No end time specified for cancellation
const sig = "0x65ca1ca8dc706025eb125e40e059e1b768abf909956698237d3ed9eafb276ec03ddb9ef68364652c362f245fce464a286a0fc692470d09de741404621236a4db1b"; // Signature from order creation

// 2. Initiate the cancel order operation
const handleCancel = Contract.methods.cancelOrder([
    maker,
    taker,
    assets.map(item => { return [item.collection, item.assetClass, item.amountOrID] }),
    currency[0].collection,
    currency[0].amountOrID,
    deadline,
    duration,
    interestPerSecond,
    endTime,
    sig
]).send({
    from: amoy_account
});

handleCancel.then(receipt => {
    console.log(receipt);
}).catch(error => {
    console.log(error);
});
```

#### **Key Notes**:

1. **Order Parameters**: The order parameters for canceling the loan are the same as those used during the initial order creation. They can be retrieved from the market listing API.
2. **Nonce**: Ensure that the nonce is retrieved correctly if needed, as it's not required in this specific cancellation.
3. **ERC20/721 Assets**: The assets being canceled must be correctly structured, including precision conversion using `toWei(amount, "decimal")`.

This example provides a clear starting point for implementing loan order cancellations on the **Polygon-Amoy** chain. Make sure to adjust the parameters as needed for your specific use case.


# Loan - Lend

The following code example is provided to help you understand the business process. For commercial use, you must handle parameter validation and exception handling on your own.

This example is tested on the **Polygon-Amoy** chain. Information used in the example can be retrieved from the **Source** directory. All assets have been pre-approved (authorized) to the contract `amoy_contract_approveTrade`. Any amounts involved need to be converted using `toWei(amount, "decimal")` for proper precision.

***

#### **Code Example**

```javascript
javascriptCopy code// Import web3js library
import Web3 from 'web3';
import ApproveTradeABI from '../abi/ApproveTrade.json';

// This example is tested on the Polygon-Amoy chain
const amoy_chainId = 80002;
const amoy_chainName = "AMOY";
const amoy_chainRpcUrl = "https://polygon-amoy.infura.io/v3/4ba314367838400fb88f2a1d0e14d42d";
const amoy_contract_approveTrade = "0xF1831ebb3f92A8607E644A1E54Fde4b09F6FE5dE";
const amoy_account = "0xA3932E6Dbf96983Ffdf43974c0BF7edE9fed76DF";

// Initialize web3 instance
// WalletProvider or HttpProvider
const web3 = new Web3("** Wallet **"); // window.ethereum
const Contract = new web3.eth.Contract(ApproveTradeABI, amoy_contract_approveTrade);

// 1. Loan Example Parameters
// Parameters are retrieved from the market creator's history API, located in the `f_order_info` field. No additional processing is required for these fields.

const maker = "0xA3932E6Dbf96983Ffdf43974c0BF7edE9fed76DF";
const taker = "0x0000000000000000000000000000000000000000"; // Open to all lenders

// Assets (collateral from the borrower)
const assets = [
    {collection: "0x9A3fad316eB9cC7db65aB6f89672796574CD1B76", assetClass: "0x0000000000000000000000000000000000000721", amountOrID: "28308257", name: "Bored Ape Yacht Club", symbol: "BAYC", decimal: 0},
    {collection: "0x9A3fad316eB9cC7db65aB6f89672796574CD1B76", assetClass: "0x0000000000000000000000000000000000000721", amountOrID: "28308487", name: "Bored Ape Yacht Club", symbol: "BAYC", decimal: 0},
    {collection: "0x98700d8fF27Af5F16FdA3bE3bD30aa4585234DCa", assetClass: "0x0000000000000000000000000000000000000020", amountOrID: "100000000", name: "WBTC", symbol: "Wrapped BTC", decimal: 9},
    {collection: "0xc94BC02ecFf5f14b73fe1A3137bb587f5Fa62F5d", assetClass: "0x0000000000000000000000000000000000000020", amountOrID: "100000", name: "USDT", symbol: "Tether USD", decimal: 6}
];

// Currency (lending asset provided by the lender)
const currency = [
    {collection: "0x0000000000000000000000000000000000000001", assetClass: "0x0000000000000000000000000000000000000000", amountOrID: "100000000000000000", name: "MATIC", symbol: "MATIC", decimal: 18}
];

const deadline = "1728955149"; // End of fundraising time (in seconds)
const duration = "1036800"; // Loan duration (in seconds)
const interestPerSecond = "3488077118214104000000000000"; // Interest per second
const endTime = "0"; // No end time specified
const sig = "0x65ca1ca8dc706025eb125e40e059e1b768abf909956698237d3ed9eafb276ec03ddb9ef68364652c362f245fce464a286a0fc692470d09de741404621236a4db1b"; // Signature from order creation

// 2. Loan Operation
// The `assets` are collateralized by the borrower, and the `currency` is the asset being lent by the lender.
// Ensure the lender has sufficient wallet and approval balances for the currency asset.

const handleLoan = Contract.methods.loan([
    maker,
    taker,
    assets.map(item => { return [item.collection, item.assetClass, item.amountOrID]; }),
    currency[0].collection,
    currency[0].amountOrID,
    deadline,
    duration,
    interestPerSecond,
    endTime,
    sig
]).send({
    from: amoy_account,
    value: currency[0].amountOrID // Note: if the lending asset is the network native token
});

handleLoan.then(receipt => {
    console.log(receipt);
}).catch(error => {
    console.log(error);
});
```

#### **Key Notes**:

1. **Collateral Assets**: The `assets` array contains the borrower's collateralized assets, which could be **ERC20** or **ERC721** tokens.
2. **Lending Assets**: The `currency` array holds the lending asset provided by the lender. Ensure that the lender has pre-approved the contract for the specified amount.
3. **Precision**: If using **ERC20** assets, precision is important, and values should be converted using `toWei(amount, "decimal")` where applicable.
4. **Lending with Network Native Tokens**: When lending native-native coins (like MATIC), ensure to set the `value` in the `.send()` method to the corresponding `amountOrID`.

This example provides the basic structure for a lending operation in the **Polygon-Amoy** chain. Be sure to adjust parameters and logic based on your specific needs.


# Loan - Repayment

The following code example is provided to help you understand the business process. For commercial use, you must handle parameter validation and exception handling on your own.

This example is tested on the **Polygon-Amoy** chain. Information used in the example can be retrieved from the **Source** directory.

***

#### **Code Example**

```javascript
javascriptCopy code// Import web3js library
import Web3 from 'web3';
import ApproveTradeABI from '../abi/ApproveTrade.json';

// This example is tested on the Polygon-Amoy chain
const amoy_chainId = 80002;
const amoy_chainName = "AMOY";
const amoy_chainRpcUrl = "https://polygon-amoy.infura.io/v3/4ba314367838400fb88f2a1d0e14d42d";
const amoy_contract_ApproveTrade = "0xF1831ebb3f92A8607E644A1E54Fde4b09F6FE5dE";
const amoy_account = "0xA3932E6Dbf96983Ffdf43974c0BF7edE9fed76DF";

// Initialize web3 instance
// WalletProvider or HttpProvider
const web3 = new Web3("** Wallet **"); // window.ethereum
const Contract = new web3.eth.Contract(ApproveTradeABI, amoy_contract_ApproveTrade);

// 1. Repayment Example Parameters
// Parameters come from the creator's history API.
//  -- `orderHash` can be found in the `f_order_hash` field.
//  -- `redeemAmount` is located in `f_order_info/currency[0]/amountOrID` and includes interest.
// Ensure that the payment token (ERC20) has been approved and that the wallet and approval balance are sufficient.
// If the repayment token is the network native token, you must send it as part of the transaction.

const orderHash = "0x5973f68a96d2b67e9fb647b3f9c916c95ad308dd18cc06a7e70b27c3abcb70aa";
const redeemAmount = "1000000000"; // Amount including interest

// 2. Initiate Repayment Operation
const handleRedeem = Contract.methods.redeem([
    orderHash
]).send({
    from: amoy_account,
    value: redeemAmount // Note: if the repayment asset is a network native token
});

handleRedeem.then(receipt => {
    console.log(receipt);
}).catch(error => {
    console.log(error);
});
```

#### **Key Notes**:

1. **Order Hash**: The `orderHash` must be retrieved from the creator's history API and is found in the `f_order_hash` field.
2. **Redeem Amount**: The redeem amount, including interest, is found in the `f_order_info/currency[0]/amountOrID`. Make sure the amount includes any applicable interest.
3. **Payment Token**: If the repayment token is an ERC20 token, ensure that it has been approved for use with the contract and that there is a sufficient balance. If the repayment token is the network native token (e.g., MATIC), send it directly as part of the transaction using the `value` field in `.send()`.

This code demonstrates how to initiate a repayment transaction on the **Polygon-Amoy** chain. Adjust the parameters as needed based on your specific requirements.

4o


# Loan - Liquidate

#### **Loan - Liquidate**

The following code example is provided to help you understand the business process. For commercial use, you must handle parameter validation and exception handling on your own.

This example is tested on the **Polygon-Amoy** chain. Information used in the example can be retrieved from the **Source** directory.

***

#### **Code Example**

```javascript
javascriptCopy code// Import web3js library
import Web3 from 'web3';
import ApproveTradeABI from '../abi/ApproveTrade.json';

// This example is tested on the Polygon-Amoy chain
const amoy_chainId = 80002;
const amoy_chainName = "AMOY";
const amoy_chainRpcUrl = "https://polygon-amoy.infura.io/v3/4ba314367838400fb88f2a1d0e14d42d";
const amoy_contract_ApproveTrade = "0xF1831ebb3f92A8607E644A1E54Fde4b09F6FE5dE";
const amoy_account = "0xA3932E6Dbf96983Ffdf43974c0BF7edE9fed76DF";

// Initialize web3 instance
// WalletProvider or HttpProvider
const web3 = new Web3("** Wallet **"); // window.ethereum
const Contract = new web3.eth.Contract(ApproveTradeABI, amoy_contract_ApproveTrade);

// 1. Liquidation Parameters
// Parameters are retrieved from the creator's history API.
//  -- `orderHash` can be found in the `f_order_hash` field.

const orderHash = "0x5973f68a96d2b67e9fb647b3f9c916c95ad308dd18cc06a7e70b27c3abcb70aa";

// 2. Initiate Liquidation Operation
const handleLiquidate = Contract.methods.liquidate([
    orderHash
]).send({
    from: amoy_account,
});

handleLiquidate.then(receipt => {
    console.log(receipt);
}).catch(error => {
    console.log(error);
});
```

#### **Key Notes**:

1. **Order Hash**: The `orderHash` must be retrieved from the creator's history API and is found in the `f_order_hash` field.
2. **Liquidation Process**: This operation triggers the liquidation of an overdue loan, allowing the lender to seize the collateral. No special handling is required for asset types or balances.

This example demonstrates how to initiate a loan liquidation on the **Polygon-Amoy** chain. Be sure to adjust the parameters as needed for your specific use case.


# OTC - Create OTC Order

The following code example is provided to help you understand the business process. For commercial use, you must handle parameter validation and exception handling on your own.

This example is tested on the **Polygon-Amoy** chain. Information used in the example can be retrieved from the **Source** directory. All assets involved have been pre-approved (authorized) to the contract `amoy_contract_OTCTrade`. Any amounts involved must be converted using `toWei(amount, "decimal")` for proper precision.

* **Offering Assets (OUT)**: Supports **ERC20**, **ERC721** (network native tokens are not supported).
* **Requiring Assets (GET)**: Supports **ERC20**, **ERC721**, and **network native tokens**.

***

#### **Code Example**

```javascript
javascriptCopy code// Import web3js library
import Web3 from 'web3';
import OTCTradeABI from '../abi/OTCTrade.json';

// This example is tested on the Polygon-Amoy chain
const amoy_chainId = 80002;
const amoy_chainName = "AMOY";
const amoy_chainRpcUrl = "https://polygon-amoy.infura.io/v3/4ba314367838400fb88f2a1d0e14d42d";
const amoy_contract_OTCTrade = "0x0C4A4390A1ae1186644a0F0354c49880595aD328";
const amoy_account = "0xA3932E6Dbf96983Ffdf43974c0BF7edE9fed76DF";

// Initialize web3 instance
// WalletProvider or HttpProvider
const web3 = new Web3("** Wallet **"); // window.ethereum
const Contract = new web3.eth.Contract(OTCTradeABI, amoy_contract_OTCTrade);

// 1. Order Parameters (Refer to the parameter explanation in the directory)
// Assets are only **ERC20** and **ERC721**. Ensure that all tokens are approved for the `amoy_contract_OTCTrade` contract. Check for sufficient balances and approvals. **ERC20** tokens must be converted to the correct precision using `toWei(amount, "decimal")`.

const maker = "0xA3932E6Dbf96983Ffdf43974c0BF7edE9fed76DF";
const taker = "0x0000000000000000000000000000000000000000"; // Open to all buyers

const asset = [
    {collection: "0x9A3fad316eB9cC7db65aB6f89672796574CD1B76", assetClass: "0x0000000000000000000000000000000000000721", amountOrID: "28308257", name: "Bored Ape Yacht Club", symbol: "BAYC", decimal: 0},
    {collection: "0x9A3fad316eB9cC7db65aB6f89672796574CD1B76", assetClass: "0x0000000000000000000000000000000000000721", amountOrID: "28308487", name: "Bored Ape Yacht Club", symbol: "BAYC", decimal: 0},
    {collection: "0x98700d8fF27Af5F16FdA3bE3bD30aa4585234DCa", assetClass: "0x0000000000000000000000000000000000000020", amountOrID: toWei(1, 9), name: "WBTC", symbol: "Wrapped BTC", decimal: 9},
    {collection: "0xc94BC02ecFf5f14b73fe1A3137bb587f5Fa62F5d", assetClass: "0x0000000000000000000000000000000000000020", amountOrID: toWei(1, 6), name: "USDT", symbol: "Tether USD", decimal: 6}
];

const currency = [
    {collection: "0x0000000000000000000000000000000000000001", assetClass: "0x0000000000000000000000000000000000000000", amountOrID: toWei(1, 18), name: "MATIC", symbol: "MATIC", decimal: 18}
];

const deadline = "1728955149"; // End of transaction validity (in seconds)

// 2. Retrieve the nonces from the contract
const nonce = await Contract.methods.nonces(amoy_account).call();

// 3. Sign the order information
// Note: Hardware wallet signatures may differ from web wallet signatures. Handle accordingly.
const signParams = {
    types: {
        EIP712Domain: [
            {name: 'name', type: 'string'},
            {name: 'version', type: 'string'},
            {name: 'chainId', type: 'uint256'},
            {name: 'verifyingContract', type: 'address'}
        ],
        Asset: [
            {name: "collection", type: "address"},
            {name: "assetClass", type: "address"},
            {name: "amountOrID", type: "uint256"}
        ],
        Order: [
            {name: 'maker', type: 'address'},
            {name: 'taker', type: 'address'},
            {name: 'asset', type: 'Asset[]'},
            {name: 'currency', type: 'Asset[]'},
            {name: 'deadline', type: 'uint256'},
            {name: 'nonce', type: 'uint256'}
        ]
    },
    domain: {
        name: "OTCTrade",
        version: "1",
        chainId: amoy_chainId,
        verifyingContract: amoy_contract_OTCTrade
    },
    primaryType: "Order",
    message: {
        maker: maker,
        taker: taker,
        asset: asset,
        currency: currency,
        deadline: deadline,
        nonce: nonce
    }
};

const signResult = await window.ethereum.send('eth_signTypedData_v4', [amoy_account, signParams]);
const sigStr = signResult.result;

// 4. Create an order
const orderParams = {
    chainname: amoy_chainName,
    chainid: amoy_chainId,
    useraddr: amoy_account,
    orderinfo: {
        maker: maker,
        taker: taker,
        asset: asset,
        currency: currency,
        deadline: deadline,
        nonce: nonce,
        sig: sigStr,
        startTime: parseInt(Date.now() / 1000),
        endTime: "0",
        ordertype: "SWAP"
    }
};

const formData = new URLSearchParams();
formData.append("p", JSON.stringify(orderParams));

fetch("https://test-api.paddlefi.com/api/dapp/createorder.do", {
    method: 'POST',
    headers: {
        "content-type": "application/x-www-form-urlencoded"
    },
    body: formData.toString()
}).then(res => res.json())
    .then(datas => {
        console.log(datas);
    }).catch(err => {
        console.log('Error', err);
    });
```

#### **Key Notes**:

1. **Assets**: Ensure the assets being sold are **ERC20** or **ERC721** and are approved for the `amoy_contract_OTCTrade` contract. Verify that all balances and approvals are sufficient. **ERC20** assets must be converted using `toWei(amount, "decimal")`.
2. **Currency**: The currency being required supports **ERC20**, **ERC721**, and network-native tokens. Ensure the correct conversion is applied for **ERC20** tokens.
3. **Signature**: Use the correct signature method based on the wallet (hardware vs. web wallet).
4. **Order Creation**: The order is created by submitting the signed data to the API endpoint, including information such as the asset, currency, and deadline.

This example demonstrates how to create an OTC order on the **Polygon-Amoy** chain. Adjust the parameters as needed for your specific requirements.


# OTC - Cancel Order

The following code example is provided to help you understand the business process. For commercial use, you must handle parameter validation and exception handling on your own.

This example is tested on the **Polygon-Amoy** chain. Information used in the example can be retrieved from the **Source** directory. Any amounts involved must be converted using `toWei(amount, "decimal")` for proper precision.

***

#### **Code Example**

```javascript
javascriptCopy code// Import web3js library
import Web3 from 'web3';
import OTCTradeABI from '../abi/OTCTrade.json';

// This example is tested on the Polygon-Amoy chain
const amoy_chainId = 80002;
const amoy_chainName = "AMOY";
const amoy_chainRpcUrl = "https://polygon-amoy.infura.io/v3/4ba314367838400fb88f2a1d0e14d42d";
const amoy_contract_OTCTrade = "0x0C4A4390A1ae1186644a0F0354c49880595aD328";
const amoy_account = "0xA3932E6Dbf96983Ffdf43974c0BF7edE9fed76DF";

// Initialize web3 instance
// WalletProvider or HttpProvider
const web3 = new Web3("** Wallet **"); // window.ethereum
const Contract = new web3.eth.Contract(OTCTradeABI, amoy_contract_OTCTrade);

// 1. Cancel Order Parameters
// Parameters are retrieved from the creator's history API, located in the `f_order_info` field.

const maker = "0xA3932E6Dbf96983Ffdf43974c0BF7edE9fed76DF";
const taker = "0x0000000000000000000000000000000000000000"; // Open to all buyers

const assets = [
    {collection: "0x9A3fad316eB9cC7db65aB6f89672796574CD1B76", assetClass: "0x0000000000000000000000000000000000000721", amountOrID: "28308257", name: "Bored Ape Yacht Club", symbol: "BAYC", decimal: 0},
    {collection: "0x9A3fad316eB9cC7db65aB6f89672796574CD1B76", assetClass: "0x0000000000000000000000000000000000000721", amountOrID: "28308487", name: "Bored Ape Yacht Club", symbol: "BAYC", decimal: 0},
    {collection: "0x98700d8fF27Af5F16FdA3bE3bD30aa4585234DCa", assetClass: "0x0000000000000000000000000000000000000020", amountOrID: "100000000", name: "WBTC", symbol: "Wrapped BTC", decimal: 9},
    {collection: "0xc94BC02ecFf5f14b73fe1A3137bb587f5Fa62F5d", assetClass: "0x0000000000000000000000000000000000000020", amountOrID: "100000", name: "USDT", symbol: "Tether USD", decimal: 6}
];

const currency = [
    {collection: "0x0000000000000000000000000000000000000001", assetClass: "0x0000000000000000000000000000000000000000", amountOrID: "100000000000000000", name: "MATIC", symbol: "MATIC", decimal: 18}
];

const deadline = "1728955149"; // End of transaction validity (in seconds)
const sig = "0x65ca1ca8dc706025eb125e40e059e1b768abf909956698237d3ed9eafb276ec03ddb9ef68364652c362f245fce464a286a0fc692470d09de741404621236a4db1b"; // Signature from order creation

// 2. Initiate Cancel Order Operation
const handleCancel = Contract.methods.cancelOrder([
    maker,
    taker,
    assets.map(item => { return [item.collection, item.assetClass, item.amountOrID]; }),
    currency.map(item => { return [item.collection, item.assetClass, item.amountOrID]; }),
    deadline,
    sig
]).send({
    from: amoy_account
});

handleCancel.then(receipt => {
    console.log(receipt);
}).catch(error => {
    console.log(error);
});
```

#### **Key Notes**:

1. **Order Parameters**: The parameters for canceling the OTC order are retrieved from the creator's history API and are identical to those used when the order was created.
2. **Signature**: The signature `sig` was generated when the order was created and must be reused for cancellation.
3. **Assets and Currency**: Ensure that all asset and currency details match the original order to avoid issues with the cancellation.

This example demonstrates how to cancel an OTC order on the **Polygon-Amoy** chain. Adjust the parameters as needed based on your specific requirements.


# OTC - Take Order

The following code example is provided to help you understand the business process. For commercial use, you must handle parameter validation and exception handling on your own.

This example is tested on the **Polygon-Amoy** chain. Information used in the example can be retrieved from the **Source** directory. Any amounts involved must be converted using `toWei(amount, "decimal")` for proper precision.

***

#### **Code Example**

```javascript
javascriptCopy code// Import web3js library
import Web3 from 'web3';
import OTCTradeABI from '../abi/OTCTrade.json';

// This example is tested on the Polygon-Amoy chain
const amoy_chainId = 80002;
const amoy_chainName = "AMOY";
const amoy_chainRpcUrl = "https://polygon-amoy.infura.io/v3/4ba314367838400fb88f2a1d0e14d42d";
const amoy_contract_OTCTrade = "0x0C4A4390A1ae1186644a0F0354c49880595aD328";
const amoy_account = "0xA3932E6Dbf96983Ffdf43974c0BF7edE9fed76DF";

// Initialize web3 instance
// WalletProvider or HttpProvider
const web3 = new Web3("** Wallet **"); // window.ethereum
const Contract = new web3.eth.Contract(OTCTradeABI, amoy_contract_OTCTrade);

// 1. Buy Order Parameters
// These parameters are retrieved from the creator's history API in the `f_order_info` field.

const maker = "0xA3932E6Dbf96983Ffdf43974c0BF7edE9fed76DF";
const taker = "0x0000000000000000000000000000000000000000"; // Open to all buyers

const asset = [
    {collection: "0x9A3fad316eB9cC7db65aB6f89672796574CD1B76", assetClass: "0x0000000000000000000000000000000000000721", amountOrID: "28308257", name: "Bored Ape Yacht Club", symbol: "BAYC", decimal: 0},
    {collection: "0x9A3fad316eB9cC7db65aB6f89672796574CD1B76", assetClass: "0x0000000000000000000000000000000000000721", amountOrID: "28308487", name: "Bored Ape Yacht Club", symbol: "BAYC", decimal: 0},
    {collection: "0x98700d8fF27Af5F16FdA3bE3bD30aa4585234DCa", assetClass: "0x0000000000000000000000000000000000000020", amountOrID: "100000000", name: "WBTC", symbol: "Wrapped BTC", decimal: 9},
    {collection: "0xc94BC02ecFf5f14b73fe1A3137bb587f5Fa62F5d", assetClass: "0x0000000000000000000000000000000000000020", amountOrID: "100000", name: "USDT", symbol: "Tether USD", decimal: 6}
];

const currency = [
    {collection: "0x0000000000000000000000000000000000000001", assetClass: "0x0000000000000000000000000000000000000000", amountOrID: "100000000000000000", name: "MATIC", symbol: "MATIC", decimal: 18}
];

const deadline = "1728955149"; // End of transaction validity (in seconds)
const sig = "0x65ca1ca8dc706025eb125e40e059e1b768abf909956698237d3ed9eafb276ec03ddb9ef68364652c362f245fce464a286a0fc692470d09de741404621236a4db1b"; // Signature from order creation

// 2. Purchase Operation
// During the transaction, the platform service fee must be paid. You can query the fee via the API.
// The `asset` array represents the assets being acquired, while the `currency` array represents the assets being paid.
// Ensure sufficient wallet balance and approvals for the currency assets.

const handleBuy = Contract.methods.swap([
    maker,
    taker,
    asset.map(item => { return [item.collection, item.assetClass, item.amountOrID]; }),
    currency.map(item => { return [item.collection, item.assetClass, item.amountOrID]; }),
    deadline,
    sig
]).send({
    from: amoy_account,
    value: "platform service fee" + "network native token included the required assets" // Note: Include platform service fee and the network native token amount being paid
});

handleBuy.then(receipt => {
    console.log(receipt);
}).catch(error => {
    console.log(error);
});
```

#### **Key Notes**:

1. **Order Parameters**: These parameters (e.g., `maker`, `asset`, `currency`) are retrieved from the creator's order details, typically from the history API. No extra processing is needed for the data.
2. **Platform Service Fee**: The platform service fee must be paid during the transaction. The fee amount can be queried from the platform's fee API.
3. **Assets and Currency**: Ensure sufficient balances and approvals for the assets and currency involved. For **ERC20** tokens, ensure that the precision is properly converted using `toWei(amount, "decimal")`.
4. **Network Native Token Payment**: If the payment involves the network native token (e.g., MATIC), it should be included in the `value` field along with the service fee.

This example demonstrates how to buy an OTC order on the **Polygon-Amoy** chain. Adjust the parameters as needed for your specific use case.


# NFT ETF

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

**Paddle NFT ETF** brings ETF-style liquidity to NFTs. It’s built for **traders, creators, investors, and borrowers** who want more ways to launch, hold, and trade NFTs.

While ETF changes how people participate in capital market, NFT ETF on Apechain will have the same impact: new ways of launch, new ways of holding, new ways of trading.


# Understanding NFT ETF

In today’s NFT market, selling quickly often means taking a big loss. Liquidity is limited, and most platforms like Blur or OpenSea primarily serve large traders, leaving the broader market underserved. Paddle NFT ETF solves this by introducing **P-Tokens:** ERC-20 tokens backed 1:1 by NFTs stored in ETF vault. This lets NFTs move like fungible tokens in DeFi, enabling instant trading, lending, borrowing, and yield generation. The P-Token mechanism also adds a safeguard that protects NFTs in extreme situations, allowing them to circulate securely across NFT and DeFi markets.

With this design, NFT ETF creates a true secondary market where NFTs gain the same financial utility as mainstream tokens. Unlike traditional ETFs, where holdings are disclosed only during periodic audits, every asset in Paddle NFT ETF is verifiable on-chain in real time: the moment an NFT enters the vault, the corresponding P-Tokens begin circulating.


# Key Vehicle

P-Token is the backbone of NFT ETF seeks to address the issue of liquidity and functionality. It represents NFT collections in an ERC-20 token format, enabling their use in DeFi applications and trading platforms. Each NFT collection has its corresponding P-Token, which can be obtained through trading on DEX, minting via selling NFTs, or borrowing from Paddle ETF protocol. The use of P-Token provides greater liquidity and functionality to NFT collections, allowing them to be used in a broader range of use cases. As such, P-Token serves as the foundation for NFT ETF, facilitating greater adoption and use of NFTs in the broader financial ecosystem. The formula for understanding P-Token is as follows:

{% hint style="info" %}
Any GEEZ = 1,000 PNutz (project defined)\
Any BAYC = 1,000 PXXX\
Any MAYC = 1,000 PYYY

.....
{% endhint %}

#### How to Get P-Tokens

1. **Swap** your NFT for its corresponding P-Token at a 1:1000 ratio using the Swap Function.
2. **Borrow** short-term P-Tokens directly from the protocol using the Loan Function.
3. **Buy** P-Tokens on DEXs like Camelot, or through future DEX/CEX integrations.

#### How to Use or Spend P-Tokens

1. **Acquire NFT in ETF Vault** by swapping P-Tokens back into the corresponding NFT at a 1:1000 ratio (plus fees) using the Swap Function.
2. **Repay loans** to reclaim your original NFTs via the Loan Function.
3. **Trade** P-Tokens for APE, USDT, or other tokens on DEXs like Camelot, or through future DEX/CEX integrations.
4. **Use** them like any other token or memecoin. The difference is that every P-Token is backed by a real NFT, with no cap on potential value.


# Swap Function

Make NFT trade interchangeably in ERC-20 format

The **ETF Swap Function** lets users instantly exchange NFTs and P-Tokens at a fixed ratio of **1 NFT = 1,000 P-Tokens**, enabling seamless and efficient buying or selling. For example, swapping *N* NFTs will give you *N × 1,000* P-Tokens (e.g., swapping 3 BAYCs = 3,000 P-BAYC).

This ETF-owned liquidity ensures ample depth in the market, allowing users to quickly gain P-Token exposure, optimize their NFT portfolios, and maximize potential returns.

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

## Swapping NFTs for P-Tokens

1. Go to the **Swap** page and choose a supported NFT collection (e.g., Bored Ape Yacht Club).
2. Select the NFTs you want to swap for P-Tokens.
3. Receive *N × 1,000* P-Tokens for your NFTs (e.g., 2 BAYCs = 2,000 P-BAYC).
4. The P-Tokens will appear in your wallet, and the NFTs will be deposited into the collection’s ETF vault (e.g., BAYC vault).

## Swapping P-Tokens for NFTs <a href="#how-to-swap-p-tokens-for-nfts" id="how-to-swap-p-tokens-for-nfts"></a>

1. Go to the **Swap** page and choose a supported NFT collection (e.g., BAYC).
2. If NFTs are available in the vault, choose one of two options:
   1. **Random Swap:** Receive a random NFT from the vault (service fee: *X%*). Example: 1,000 P-BAYC + *Y* P-BAYC.
   2. **Specific Swap:** Select a specific NFT from the vault (service fee: *Y%*). Example: 1,000 P-BAYC + *Y* P-BAYC.
3. The NFT will be sent directly to your wallet after the swap.

{% hint style="info" %}
**Note:** Service fees are set by the collection owner and may differ between collections.
{% endhint %}


# Loan Function

The **Swap Function** lets you instantly buy and sell NFTs, but it doesn’t guarantee you can buy back the exact same one as someone else may acquire it from the vault. For users who want **P-Token exposure without giving up their original NFT**, Paddle ETF offers the **Loan Function**.

By pledging your NFT as collateral, you can borrow its corresponding P-Tokens with **nearly 100% LTV**. Your NFT is locked in our **audited smart contract** and will be returned to you once you repay the loan in full. This allows you to unlock liquidity and participate in DeFi, while still retaining ownership of your NFT.

The Loan Function uses an **isolated margin structure**, meaning each NFT loan is a separate order with its own interest rate and duration. For example, borrowing against 10 NFTs will require 10 individual loan orders.

## How to Borrow P-Tokens with NFTs

1. Go to the **Loan** page and select the NFT you want to borrow against (only supported collections will be displayed). Example: choose one of your Bored Ape Yacht Club NFTs.
2. Select your desired loan duration, e.g., 30 days.
3. An annual margin rate (**X%**) is applied, and interest for the selected term is deducted upfront from the principal (1,000 P-Tokens per NFT).
   1. Example: For 30 days, you receive: `1,000 × (1 - X% × 30/365)` P-BAYC in your wallet.
4. Your NFT will be locked in the ETF protocol during the loan period.
5. To redeem your NFT after **N** days, repay:
   1. `1,000 × (1 - X% × 30/365)` (principal received)
   2. `+ 1,000 × (X% × N/365)` (remaining interest)
6. Once repaid, your original NFT is sent back to your wallet.

{% hint style="info" %}
**Note:** Interest rates may vary between collections depending on demand.
{% endhint %}

## Benefit of Borrowing with NFTs via Paddle NFT ETF <a href="#is-there-any-benefit-to-borrow-out-p-tokens-with-nfts" id="is-there-any-benefit-to-borrow-out-p-tokens-with-nfts"></a>

### **Maximized Capital Efficiency (100% LTV)**

Loans are issued at nearly 100% LTV in P-Tokens, which can be instantly swapped for APE via DEX. For example, if your GEEZ NFT has a 1,000 APE floor price, you could borrow \~950 APE worth of P-Tokens against it, unlocking maximum liquidity without selling.

### 0 risk of mid-term liquidation <a href="#id-0-risk-of-mid-term-liquidation" id="id-0-risk-of-mid-term-liquidation"></a>

With the ETF Loan Function, there’s no risk of liquidation due to market volatility during the loan period. As long as you repay the agreed P-Token amount before the loan expires, your NFT is guaranteed to be returned. Unlike traditional NFT lending platforms, where borrowers are exposed to both token (ETH/APE) and NFT price swings, Paddle NFT ETF limits your exposure to the P-Token value only, making risk management far simpler.

## Liquidation

In traditional NFT lending, borrowers face the risk of liquidation if NFT prices drop during the loan term. The **ETF Loan Function** is designed to remove this risk. When you borrow P-Tokens against your NFT, you cannot be liquidated mid-loan due to market fluctuations.

As long as you repay the agreed P-Token amount before the loan expires, your NFT will be returned to you. If the repayment deadline is missed, the pledged NFT will be made available through the **Swap Function**, allowing anyone holding the corresponding P-Tokens to acquire it.

This liquidation model ensures **no bad debt** in the ecosystem: the P-Token mechanism absorbs the risk. Additionally, NFTs are never dumped directly onto public marketplaces, preventing unnecessary floor price damage.

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


# Geez ETF


