# Overview

Shield is building a suite of decentralized option protocols in order to popularize option, this sophisticated financial instrument, and to encompass a broader variety of Web3 assets and holders in a user-friendly manner.&#x20;

## Join Us

Twitter: <https://twitter.com/shield_dao>

Telegram: <https://t.me/shield_dao>&#x20;

Discord: [https://discord.gg/NAbGTHYgMg](https://discord.com/invite/YJ9MHs6YdJ)


# Basics

Shield’s Perpetual Option is a new financial tool that offers long-term, on-chain options without the hassle, risk, or cost of rolling positions. It is the perfect trading solution for all market conditions.

### Key Features

**Zero Slippage**: Shield uses an oracle for price feeds, which minimizes price discrepancies and reduces the opportunity for arbitrage traders, leading to lower impermanent loss.

**No Liquidation Risk**: Each private pool has its own wallet, allowing the risk of each pool to be calculated and hedged accordingly. Private pools take on most of the counter-party risk, leaving limited risk for the public pool.

**High Leverage**: The P2DP model allows both public and private pools to provide liquidity for trades, with private pools offering 5x leverage and public pools offering 2.5x leverage, improving capital efficiency and trade depth.

**Limited Downside, Unlimited Upside**: The maximum trading loss is the daily funding fee, while profits are calculated as (No. Of Contracts\*Price Change) - Funding Fee. Funding fees are known at the start of positions, and profits are unlimited depending on market conditions.

### Core Innovations

**On-chain Perpetual Options Pricing**: Using stochastic processes, volatility, and partial differential equations, Shield calculates the exact solution for perpetual option funding fees and implements it on-chain with a linear computation approximation that has a 5% error rate after extensive data back-testing.

**Peer to Dual Pools**: P2DP eliminates LP counterparty risk by introducing private pools for professional market makers and public pools for regular users, ensuring on-chain liquidity and minimal risk for regular users.

**Third-party Liquidator and Brokerage Systems**: Shield uses non-cooperative game theory to design a third-party liquidator system and a brokerage system with a buy-back and burn mechanism, leading to a perfect decentralized network.

**On-chain Random Matching Engine**: Shield introduces the first on-chain random order-taking algorithm, where orders are assigned to private pools using hash of the block, block time, and private pool length, ensuring availability and fairness.


# Mechanism

Shield is building a secure, stable, and open decentralized derivatives trading protocol based on a fully non-cooperative game network. Shield's decentralized network has five types of participants.&#x20;

![](https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2FXMdpUp0a54E99VcQ410B%2Fphoto_2022-05-31_13-49-36.jpg?alt=media\&token=be62882d-4de0-41ef-a448-28b9c701cc10)

**Brokers**

With the "Broker Campaign" [commission system](broken://pages/gV9dtagXxYVHoIveU9iv), brokers bring a steady stream of traders to the Shield network through education and referrals.

**Traders**

Shield users pay funding fees for their trading needs.

**Private Pool**

Sellers of Shield protocol, who provide liquidity to the protocol's private pool through their professional market-making capabilities and earn an order taking liquidity bonus (SLD) and trader funding fees.&#x20;

**Public Pool**

The reserve liquidity pool is used when the entire private pool has insufficient liquidity, or the LP order margin is inadequate. Everyone can provide liquidity and earn LP rewards (SLD) through liquidity mining

**Liquidator**

Trigger liquidation contracts when there is an insufficient balance in the funding fee account or liquidity margin, to receive 150% of the gas expense as arbitrage rewards&#x20;

Each role has a clear interest incentive and sufficient competition mechanism. Each person acts in their interest to facilitate the network needs, hence achieving the optimal *network-wide Nash equilibrium* to maintain the security and stability of the network.<br>


# Guides

### How to trade Shield Perpetual Options?

**STEP 1: Connect your wallet and switch to right chains**

1.1 Click CONNECT WALLET

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2FszJnWUSmpSwmO1bUBv83%2FUntitled.png?alt=media&amp;token=5a9e2fa2-1de7-4410-9df3-f985e9d5a209" alt=""><figcaption></figcaption></figure>

1.2 Choose the wallet, click CONNECT

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2FA5XFA7U0mN5hjklSuODs%2FUntitled%201.png?alt=media&amp;token=4568be60-d920-4b65-afe9-355390b886d3" alt=""><figcaption></figcaption></figure>

**STEP 2: Choosing the desired trading pair, including the index and the token used for funding fee**

2.1 On the left is the currently selected trading pair: BTC (index) / POT (funding fee)

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2FPr0AGr911iAhZf4ovpZU%2FUntitled%202.png?alt=media&amp;token=968f81c7-1a03-4e57-98a9-77f1a9b9416b" alt=""><figcaption></figcaption></figure>

2.2 You can customize your trading pair by clicking SELECT MARKET

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2FlQc3lX22FXtPSqEGHFHt%2FUntitled%203.png?alt=media&amp;token=7c9188e0-6961-4e9e-baeb-a7cf32f7e883" alt=""><figcaption></figcaption></figure>

2.3 Select the index (BTC & ETH) at the top, and select the desired token used for funding fee below

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2FoyCbXVzBQ1qyEJxYb7Tg%2FUntitled%204.png?alt=media&amp;token=51d656dd-b9c0-4210-989c-9f568e9cbf2f" alt=""><figcaption></figcaption></figure>

**STEP 3: Top up tokens to pay the funding fee for the selected trading pair**

3.1 Click DEPOSIT

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2FmbswjYIXBoY78nYfM1YV%2FUntitled%205.png?alt=media&amp;token=9454d619-b734-4f23-9e1f-7c06551aff72" alt=""><figcaption></figcaption></figure>

3.2 Enter an amount of token you want to top up, click APPROVE, click NEXT in Metamask, and click APPROVE in Metamask

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2Flc6uW3iJUJd7O7lnYd21%2FUntitled%206.png?alt=media&amp;token=31165ed3-1728-4250-93d6-969d1a2eb23c" alt=""><figcaption></figcaption></figure>

3.3 Once approved, click DEPOSIT, and click CONFIRM in Metamask. The fund will be successfully added to the Available Balance after the transaction completed

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2Fxoqm7LMLyXIPqq4ROSI0%2FUntitled%207.png?alt=media&amp;token=d9e03767-ccb7-4647-9915-534db7b7c842" alt=""><figcaption></figcaption></figure>

**Step 4: Star trading with different order type (LONG & SHORT) and positions of different size**

4.1 Specify the type of order, LONG or SHORT

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2F9WXBd375xMMACYVOyeNO%2FUntitled%208.png?alt=media&amp;token=c355a1b2-f14a-43d6-b65f-a839e9c2a9d9" alt=""><figcaption></figcaption></figure>

4.2 Enter the amount of BTC/ETH you want to hold as your position (1 means 1 BTC/ETH, depending on the current trading pair)

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2FOyaRRWTeCf1DRK7XcDXE%2FUntitled%209.png?alt=media&amp;token=f6dfc6b6-b7dd-44ab-bb04-e89b346fe6a2" alt=""><figcaption></figcaption></figure>

4.3 Review the trading fee and funding fee you have to pay for this order. Trading fee is the one time cost while funding fee needs to be paid daily (every 24 hour) to maintain the position

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2Fc4knEi7ridi9vp9hIDS5%2FUntitled%2010.png?alt=media&amp;token=27b5ef45-cb14-461c-b1aa-05298c45e967" alt=""><figcaption></figcaption></figure>

4.4 Open the funding fee calculator to get more comprehensive information about the funding fee required for holding positions. The calculator shows the funding fee required for the position (10 BTC in the demo) in every phase (1 phase = 24 hours). Once you failed to pay the funding fee, your position will be liquidated

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2FjMMc5GXwlv1A2Rbip8JG%2FUntitled%2011.png?alt=media&amp;token=04d131fb-9d8f-484c-b037-82bed9482282" alt=""><figcaption></figcaption></figure>

4.5 You can enter the phase you want to hold the position and calculate the total funding fee required

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2FPa36G164BmUNhD43Ir53%2FUntitled%2012.png?alt=media&amp;token=0f549304-a5a9-49bc-bf13-e2626d3b951e" alt=""><figcaption></figcaption></figure>

4.6 After reviewing your order, click OPEN, make the final check, click CONFIRM, and click CONFIRM in Metamask

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2F96B1wYzs6xt3WiZjBCqw%2FUntitled%2013.png?alt=media&amp;token=61f4235e-91df-48ba-a068-4319b82c3218" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2Farbeqf8uprpsKVLDyDEm%2FUntitled%2014.png?alt=media&amp;token=47743669-6c16-4905-9567-6e52156fe438" alt=""><figcaption></figcaption></figure>

**STEP 5: Check the funding fee required for your position, and your current available balance. Make sure your available balance is higher than maintenance margin to prevent your position from being liquidated**

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2FcnYnMVJslhwPGol07Dep%2FUntitled%2015.png?alt=media&amp;token=ff96dffa-e54e-440c-bb11-d1ca98499295" alt=""><figcaption></figcaption></figure>

**STEP 6: Review, track and close your positions in Orders**

6.1 You can get information from various perspective for your positions

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2FFSNS1PqyZYx21zLn48Tt%2FUntitled%2016.png?alt=media&amp;token=0e243134-f338-4707-a8ad-3a94eabfa3a5" alt=""><figcaption></figcaption></figure>

6.2 You can also close your position by click CLOSE, review the order, and click CLOSE POSITION

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2FTGLR3Zzw5sKwzb8hpqmN%2FUntitled%2017.png?alt=media&amp;token=bf5a9866-3ad5-4080-b077-720d75504f59" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4207105469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkVrWGu1mzw8472NSjgWC%2Fuploads%2FeaexiK8PzlYwePhzBVB9%2FUntitled%2018.png?alt=media&amp;token=02fa887f-e5b0-4a3b-8dd4-59df418d0053" alt=""><figcaption></figcaption></figure>


# FAQs

{% content-ref url="/pages/0yl5StKuU3gMHwYQkepq" %}
[About Shield](/getting-started/general/about-shield)
{% endcontent-ref %}

{% content-ref url="/pages/YMdeD5Q8NgFKgs0XuDLU" %}
[About Pools](/getting-started/general/about-pools)
{% endcontent-ref %}

{% content-ref url="/pages/bxxZ96nSuMY2v1fJGJ8c" %}
[About Trading](/getting-started/general/about-trading)
{% endcontent-ref %}

{% content-ref url="/pages/C90KYF3w8mI19d2WNAId" %}
[Broken mention](broken://pages/C90KYF3w8mI19d2WNAId)
{% endcontent-ref %}


# About Shield

### **What is Shield?**&#x20;

Shield is the crypto-native solution to on-chain derivatives. Shield is building a secure, stable, and open decentralized derivatives trading protocol.

### **What price feeds does Shield integrate?**

Shield integrates Chainlink, Uniswap, and Sushiswap as price feeds. The opening price is the index price. Contracts are directly interacted with dual-liquidity pools, thus replacing the complex on-chain matching calculation.


# About Trading

### What is Funding Fee?

Funding fee is the cost borne by the users to keep positions open for the funding interval. The fee will be prepaid for opening a position, and accumulated through funding intervals. Please refer to the [Pricing Method](https://docsend.com/view/7k98hrtjtscc5w7j) for additional details.&#x20;

### **What is Trading Fee?**

Trading fees are applied to open a new position. Currently, the fee is fixed at 0.1% of the notional value of the contract.

### What is Liquidation and the Maintenance Margin?

When you open a trade, you'll be paying ongoing funding fees in order to maintain the open position. As your funding balance decreases, near to the point where your position may be open for one more period - it's important to remember the locked Maintenance Margin (MM) which is included in your Funding Balance.

A user can be liquidated based on the following formula: Funding Balance = Available Balance + Maintenance Margin. Liquidation occurs when Available Balance < Funding Fee. The MM is sent over to the Insurance Fund and your position is closed.

In order to avoid forced liquidation, you will need to keep in mind that the MM is included in your funding balance. When your balance minus the MM is less than your funding fee, your position will be liquidated.


# About Pools

### What is the Public Liquidity Pool?

The Public Liquidity pool, or LP1, is the senior tranche of liquidity, to be used only in case sufficient funds aren’t available in the Private Liquidity pool (LP2). The Public Liquidity pool ( LP1), carries significantly less counterparty risks compared to LP2.

### What is the Privat**e Liquidity Pool?**

The Private Liquidity pool, or LP2, is designed for professional traders with higher risk appetite, preferably with the ability to properly hedge their positions. Users are rewarded directly with SLD tokens, in contrast to LP1, and can be swapped for stable coins available in the fee pool (see Swap\&Burn) at the holder’s discretion.

### **What are reTokens?**

reTokens are the LP tokens that you receive for providing liquidity to Shield’s Decentralized Perpetual Options Contracts in the Public Liquidity pool (LP1). This will be automatically created using smart contracts, and denote your contribution of stable coins to the public pool. You can choose to swap your reTokens for SLD on a pro-rata basis.

### How to be a liquidator?&#x20;

Shield will open the liquidation API, anyone can become a liquidator. In order to trigger the liquidation conditions, the liquidator competes to initiate on-chain liquidation transactions, the liquidation contract for on-chain verification, confirmed to meet the liquidation conditions, then complete the liquidation to lastly be issued a liquidation reward. The clearing reward is 150% of the system Gas fee equivalent to the stable coin when the clearing transaction is packaged.

### **How does the private pool work?**

Shield pioneered the first on-chain random order taking algorithm. Newly opened orders are randomly generated by two random factors: the hash of the block and the block time, and the remainder is taken using the current private pool length, i.e., the order is assigned to the corresponding private pool first. If the private pool is critical or the available balance is insufficient, it is polled sequentially until an available private pool is encountered.

### **How does private pool shift the liquidity?**

When one of the private pools of LP2 experiences a shortfall in the total balance to pay out the trader's position profit, the position will automatically be liquidated by a third-party liquidator. However, the liquidation of a single position blowout does not simultaneously trigger the liquidation of the trader's position but instead; executes the closing of the position to the public pool. If an over loss occurs during the unwinding, the loss of the penetrated position is first compensated by the available balance of the Private Pool. Then the risk reserve compensates for any shortfall in the available balance. Subsequently, the liquidity of the Public Pool is judged, sufficient; and if so, the margin, compensation, and position fees of the liquidation order are transferred to the public pool together to form a new liquidity lock. If no over loss occurs at the time of liquidation, only the margin and holding fees of the position orders are closed out. When the liquidity in the public pool is also insufficient to catch the liquidated position order value, the order will execute with an agreed closeout.

### **How does Private Pool adjust order taking?**

For the Private Pool market makers to effectively manage their market-making capital risk, Shield provides the function to change the order status on-chain.

For example, if the private pool market maker has insufficient funds to replenish the private pool balance, and the funds already taken cannot be unlocked from the positioned smart contract, continuous passive order taking will increase the market-making risk significantly. Therefore, Shield provides the ability to change the status of orders taken on-chain. It is enabled by default and can be modified by initiating on-chain signature transactions.

### **How does Private Pool add margin?**

The margin rate for private pool order-taking is 20% (including 2% maintenance margin) and will force liquidate when the margin falls below the trader's profit. Therefore, to ensure that the order doesn't liquidate, the Private Pool market-maker can add margin to the order at any time. Margin can only be drawn from the available balance of the Private Pool. This allows for flexible control of market-making positions and effectively reduces market-making risk.

Shield will open the liquidation API, anyone can become a liquidator. In order to trigger the liquidation conditions, the liquidator competes to initiate on-chain liquidation transactions, the liquidation contract for on-chain verification, confirmed to meet the liquidation conditions, then complete the liquidation to lastly be issued a liquidation reward. The clearing reward is 150% of the system Gas fee equivalent to the stable coin when the clearing transaction is packaged.


# Trading API References

## Getting Super Powers

Becoming a super hero is a fairly straight forward process:

```
$ give me super-powers
```

{% hint style="info" %}
&#x20;Super-powers are granted randomly so please submit an issue if you're not happy with yours.
{% endhint %}

Once you're strong enough, save the world:

{% code title="hello.sh" %}

```bash
# Ain't no code for that yet, sorry
echo 'You got to trust me on this, I saved the world'
```

{% endcode %}


# Overview

This document describes detailed trading interfaces on Shield Protocol v1, including interface definitions, listed parameters, return values and call samples on different programming languages and environments.&#x20;

Before you begin, you need to have a basic understanding on blockchain-related programming concepts. For example, basic concepts on Ethereum and smart contract, Solidity programming language, development environment (Remix, truffle, etc.)

**TBD: Introduce Shield Protocol V1 briefly & Market Maker's role & How could Market Makers utilize this document.**


# Smart Contracts Overview

## BSC Mainnet

| Contract Name      | Contract Description | Contract Address | ABI References     |
| ------------------ | -------------------- | ---------------- | ------------------ |
| SLDDAIContract.sol | Trading Contract     |                  | SLDDAI.abi         |
| PrivateDAIPool.sol | Private DAI Pool     |                  | PrivateDAIPool.abi |
| PublicDAIPool.sol  | Public DAI Pool      |                  | PublicDAIPool.abi  |

## BSC Testnet

| Contract Name      | Contract Description | Contract Address                           | ABI References     |
| ------------------ | -------------------- | ------------------------------------------ | ------------------ |
| SLDDAIContract.sol | Trading Contract     | 0x7125E80fF9c5ae3073bf30769d0963B6d0B57515 | SLDDAI.abi         |
| PrivateDAIPool.sol | Private DAI Pool     | 0xaDea523A790b34CF6D0989a803262b2A38FD7cdA | PrivateDAIPool.abi |
| PublicDAIPool.sol  | Public DAI Pool      | 0xb3F55De3a56F15d6C94cF74753F52e447519E563 | PublicDAIPool.abi  |

##


# Interfaces


# 1. Deposit Funds

## Description

Make a deposit to an account. Regardless of the taker or the maker, the DAI needs to be deposited prior to making an order.

**TBD: Narratives**

## User Interface

![Deposit to an account](broken://files/-MetWmmMjOqGef_WfSDA)

![Deposit Panel](broken://files/-MetWyDSsh_2gT_qxIxX)

## Function Description

|                 Item                |                                             Description                                             |
| :---------------------------------: | :-------------------------------------------------------------------------------------------------: |
|         **Contract Address**        |                   Trading contract (referenced by Smart Contract Overview section)                  |
|          **Contract Name**          |                                          SLDDAIContract.sol                                         |
|             **Function**            |                                   function deposit(uint256 amount)                                  |
|        **Function Selector**        |                                              0xb6b55f25                                             |
|         **Invocation Type**         |                                         Ethereum Transaction                                        |
|        **Passing Parameters**       |                      Amount of DAIs deposited; actual number multiplied by 1E18                     |
|           **Return Value**          |                                                 None                                                |
|          **Event Emitted**          |       event DDSDeposit(address indexed sender, address indexed toAddr, uint256 motageAmount);       |
|         **Event Signature**         |                  0x8741a00229f2b8b24379b60f7a4ba3a3f3d92f328280c47a38cd03504ac72c42                 |
| **Transaction Sample(BSC testnet)** | <https://testnet.bscscan.com/tx/0xae1851d19feadb5d8f4ac8dfc24f746c1d851e06bb2a80c23685162b2784a39b> |

## ABI Description

```
[{
	"inputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "deposit",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}]
```

## Examples

### Calling Examples

{% tabs %}
{% tab title="JavaScript" %}

```javascript
var Web3 = require('web3');
const BigNumber = require('bignumber.js');

// BSC Mainnet: https://bsc-dataseed.binance.org
// BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545
const  web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545");

// Need trading contract address
const CONTRACT_ADDRESS = "";
const ABI = [{
	"inputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "deposit",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}];

// Deposit 1 DAI.
const DEPOSIT_AMOUNT = 1e18;

var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);

contract.methods.deposit(new BigNumber(DEPOSIT_AMOUNT).toString()).send({
    from: "CALLER_ADDRESS",
}, function(error, result){
    if(!error) {
      console.log('Response:', result);
    } else {
      console.log(error);
    }
});
```

{% endtab %}

{% tab title="Python" %}

```
# This example is written by using Web3.py
# More details on Web3.py could be found here - https://web3py.readthedocs.io/


```

{% endtab %}
{% endtabs %}

### HTTP Request Example

## Send a Deposit Transaction

<mark style="color:green;">`POST`</mark> `(BSC Mainnet) https://bsc-dataseed.binance.org/`

Make a deposit transaction to Shield Protocol V1 on BSC network.\
More details on how to send a transaction via BSC RPC could be found here, <https://ethereum.org/en/developers/docs/apis/json-rpc/#eth\\_sendrawtransaction>

#### Request Body

| Name    | Type   | Description                                           |
| ------- | ------ | ----------------------------------------------------- |
| jsonrpc | string | "2.0"                                                 |
| method  | string | "eth\_sendRawTransaction"                             |
| params  | array  | the signed transaction data coerced into string array |
| id      | number | request sequence id, you could use timestamp as id    |

{% tabs %}
{% tab title="200 Success response." %}

```
{
  "id":64,
  "jsonrpc": "2.0",
  "result": "0x146695866343024d1ad9854a72904d16abec8b1597e098619d2addbd44b14e4c"
}
```

{% endtab %}
{% endtabs %}


# 2. Withdraw Funds

## Description

Make a withdrawal from an account.

**TBD: Narratives**

## User Interface

![Withdraw Panel](broken://files/-MeuHVLAjmW9OLVesyQS)

## Function Description

|                 Item                |                                                  Description                                                 |
| :---------------------------------: | :----------------------------------------------------------------------------------------------------------: |
|         **Contract Address**        |                       Trading contract (referenced by Smart Contract Overview section)                       |
|          **Contract Name**          |                                              SLDDAIContract.sol                                              |
|             **Function**            |                                       function withdraw(uint256 amount)                                      |
|        **Function Selector**        |                                                  0x2e1a7d4d                                                  |
|         **Invocation Type**         |                                             Ethereum Transaction                                             |
|        **Passing Parameters**       |                          Amount of DAIs withdrawn; actual number multiplied by 1E18                          |
|           **Return Value**          |                                                     None                                                     |
|          **Event Emitted**          |           event DDSWithdraw(address indexed sender, address indexed toAddr, uint256 motageAmount);           |
|         **Event Signature**         |                      0x9319767067544c146c859088bc69f38236cad434eb28957e8574a56d4173f89f                      |
| **Transaction Sample(BSC testnet)** | <https://testnet.bscscan.com/tx/0xb7d745f1d696281444530c798a408ad52cf221c6993bb16997f3b7f465e7c2d5#eventlog> |

## ABI Description

```
[{
	"inputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "withdraw",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}]
```

## Examples

### Calling Examples

{% tabs %}
{% tab title="JavaScript" %}

```javascript
// This example is written by using Web3.js
// More details on Web3.js could be found here - https://web3js.readthedocs.io/

var Web3 = require('web3');
const BigNumber = require('bignumber.js');

// BSC Mainnet: https://bsc-dataseed.binance.org
// BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545
const  web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545");

// Need trading contract address
const CONTRACT_ADDRESS = "";
const ABI = [{
	"inputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "withdraw",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}];

// Withdraw 1 DAI.
const DEPOSIT_AMOUNT = 1e18;

var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);

contract.methods.withdraw(new BigNumber(DEPOSIT_AMOUNT).toString()).send({
    from: "CALLER_ADDRESS",
}, function(error, result){
    if(!error) {
      console.log('Response:', result);
    } else {
      console.log(error);
    }
});
```

{% endtab %}

{% tab title="Python" %}

```
# This example is written by using Web3.py
# More details on Web3.py could be found here - https://web3py.readthedocs.io/


```

{% endtab %}
{% endtabs %}

### HTTP Request Example

## Send a Withdrawal Transaction

<mark style="color:green;">`POST`</mark> `(BSC Mainnet) https://bsc-dataseed.binance.org/`

\
Make a withdraw transaction to Shield Protocol V1 BSC network.\
More details on how to send a transaction via BSC RPC could be found here, <https://ethereum.org/en/developers/docs/apis/json-rpc/#eth\\_sendrawtransaction><br>

#### Request Body

| Name    | Type   | Description                                           |
| ------- | ------ | ----------------------------------------------------- |
| jsonrpc | string | "2.0"                                                 |
| method  | string | "eth\_sendRawTransaction"                             |
| params  | array  | the signed transaction data coerced into string array |
| id      | number | request sequence id, you could use timestamp as id    |

{% tabs %}
{% tab title="200 " %}

```
{
  "id":64,
  "jsonrpc": "2.0",
  "result": "0xb7d745f1d696281444530c798a408ad52cf221c6993bb16997f3b7f465e7c2d5"
}
```

{% endtab %}
{% endtabs %}


# 3. Check Funds

## Description

Check detailed funds information of an account, including total amount and available amount of  deposited funds.

**TBD: Narratives**

## User Interface

![Funds Stats Panel](broken://files/-Mew-rwZJfKHR8W9roQB)

## Function Description

|          Item          |                              Description                              |
| :--------------------: | :-------------------------------------------------------------------: |
|  **Contract Address**  |    Trading contract (referenced by Smart Contract Overview section)   |
|    **Contract Name**   |                           SLDDAIContract.sol                          |
|      **Constant**      |           mapping(address=>AccountInfo) public userAccount;           |
|       **Struct**       | struct AccountInfo{ uint256 depositAmount; uint256 availableAmount; } |
|  **Function Selector** |                               0xea5eda32                              |
|   **Invocation Type**  |                             Ethereum Call                             |
| **Passing Parameters** |                              User address                             |
|    **Return Value**    |     The amount of deposited funds; The available amount of funds.     |

## ABI Description

```
[{
	"inputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"name": "userAccount",
	"outputs": [{
		"internalType": "uint256",
		"name": "depositAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "availableAmount",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}]
```

## Examples

### Calling Examples

{% tabs %}
{% tab title="JavaScript" %}

```javascript
// This example is written by using Web3.js
// More details on Web3.js could be found here - https://web3js.readthedocs.io/

var Web3 = require('web3');
const BigNumber = require('bignumber.js');

// BSC Mainnet: https://bsc-dataseed.binance.org
// BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545
const  web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545");

const CONTRACT_ADDRESS = "Replace with trading contract address";
const ABI = [{
	"inputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"name": "userAccount",
	"outputs": [{
		"internalType": "uint256",
		"name": "depositAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "availableAmount",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}];

var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);

contract.methods.userAccount("Replace with User Address").call({
}, function(error, result){
    if(!error) {
      console.log('Response:', result);
    } else {
      console.log(error);
    }
});
```

{% endtab %}

{% tab title="Python" %}

```
# This example is written by using Web3.py
# More details on Web3.py could be found here - https://web3py.readthedocs.io/


```

{% endtab %}
{% endtabs %}

### HTTP Request Example

## Send a Withdrawal Transaction

<mark style="color:green;">`POST`</mark> `(BSC Mainnet) https://bsc-dataseed.binance.org/`

\
Make a contract call to get deposited funds details of Shield Protocol V1.\
More details on how to make a contract call request via BSC RPC could be found here, <https://ethereum.org/en/developers/docs/apis/json-rpc/#eth\\_sendrawtransaction><br>

#### Request Body

| Name    | Type   | Description                                                          |
| ------- | ------ | -------------------------------------------------------------------- |
| jsonrpc | string | "2.0"                                                                |
| method  | string | "eth\_call"                                                          |
| params  | array  | the signed transaction data coerced into string array, for instance, |
| id      | number | request sequence id, you could use timestamp as id                   |

{% tabs %}
{% tab title="200 The result responded could be decoded into two uint256 numbers which represents the total amount and the available amount of deposited funds." %}

```
{
    "jsonrpc": "2.0",
    "id": 1234,
    "result": "0x00000000000000000000000000000000000000000000006c6b935b8bbd40000000000000000000000000000000000000000000000000006c6b935b8bbd400000"
}
```

{% endtab %}
{% endtabs %}

**Request Body Example:**

```
{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0x0000000000000000000000000000000000000000",
            "to": "0x32c10ce5f9f47ab82141d73a136823d3e20408e0",
            "data": "0xea5eda32000000000000000000000000834c673130c085057531f227dcbd375d803d9a98"
        },
        "latest"
    ],
    "id": 1234
}
```

**CURL Example:**

```bash
curl --location --request POST 'https://data-seed-prebsc-1-s1.binance.org:8545' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0x0000000000000000000000000000000000000000",
            "to": "0x32c10ce5f9f47ab82141d73a136823d3e20408e0",
            "data": "0xea5eda32000000000000000000000000834c673130c085057531f227dcbd375d803d9a98"
        },
        "latest"
    ],
    "id": 1234
}'
```


# 4. Deposit DAI into Public Pool

## Description

Deposit DAI to public liquidity pool. Once you deposit your DAIs from your funds, you will receive reDAIs.

**TBD: Narratives**

## User Interface

![Public Pool Panel](broken://files/-MewbhnIREJIRUXnvIhC)

![Confirm Deposit](broken://files/-MewcROJ_LvenqdRu-JQ)

## Function Description

|                 Item                |                                                                                               Description                                                                                              |
| :---------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|         **Contract Address**        |                                                                  Public pool contract (referenced by Smart Contract Overview section)                                                                  |
|          **Contract Name**          |                                                                                            SLDDAIPools1.sol                                                                                            |
|             **Function**            |                                                                                  function provide(uint256 mintAmount)                                                                                  |
|        **Function Selector**        |                                                                                               0x2e2ebe06                                                                                               |
|         **Invocation Type**         |                                                                                          Ethereum Transaction                                                                                          |
|        **Passing Parameters**       |                                                                       Amount of DAIs to deposit; actual number multiplied by 1E18                                                                      |
|           **Return Value**          |                                                                                                  None                                                                                                  |
|          **Event Emitted**          |                                                              event Provide(address indexed account, uint256 amount, uint256 writeAmount);                                                              |
|         **Event Signature**         |                                                                   0x4089141ea5e4c16575f5ebf65f1786497ea07c175846fc7745ef8d8986a4ff65                                                                   |
| **Transaction Sample(BSC testnet)** | [https://testnet.bscscan.com/tx/0xae1851d19feadb5d8f4ac8dfc24f746c1d851e06bb2a80c23685162b2784a39b](https://testnet.bscscan.com/tx/0x6714846dfc5bb35c9f9116fc2366b5a9a45dcaad986aeb26f251b9226c128a77) |

## ABI Description

```
{
	"inputs": [{
		"internalType": "uint256",
		"name": "mintAmount",
		"type": "uint256"
	}],
	"name": "provide",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}
```

## Examples

### Calling Examples

{% tabs %}
{% tab title="JavaScript" %}

```javascript
var Web3 = require('web3');
const BigNumber = require('bignumber.js');

// BSC Mainnet: https://bsc-dataseed.binance.org
// BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545
const  web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545");

const CONTRACT_ADDRESS = "Replace with Public Pool Contract Address";
const ABI = [{
	"inputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "deposit",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}];

// Deposit 1 DAI to public pool.
const DEPOSIT_AMOUNT = 1e18;

var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);

contract.methods.provide(new BigNumber(DEPOSIT_AMOUNT).toString()).send({
    from: "CALLER_ADDRESS",
}, function(error, result){
    if(!error) {
      console.log('Response:', result);
    } else {
      console.log(error);
    }
});
```

{% endtab %}

{% tab title="Python" %}

```
# This example is written by using Web3.py
# More details on Web3.py could be found here - https://web3py.readthedocs.io/


```

{% endtab %}
{% endtabs %}

### HTTP Request Example

## Send a Deposit Transaction

<mark style="color:green;">`POST`</mark> `(BSC Mainnet) https://bsc-dataseed.binance.org/`

Make a deposit transaction to Shield Protocol V1 on BSC network.\
More details on how to send a transaction via BSC RPC could be found here, <https://ethereum.org/en/developers/docs/apis/json-rpc/#eth\\_sendrawtransaction>

#### Request Body

| Name    | Type   | Description                                           |
| ------- | ------ | ----------------------------------------------------- |
| jsonrpc | string | "2.0"                                                 |
| method  | string | "eth\_sendRawTransaction"                             |
| params  | array  | the signed transaction data coerced into string array |
| id      | number | request sequence id, you could use timestamp as id    |

{% tabs %}
{% tab title="200 Success response." %}

```
{
  "id":64,
  "jsonrpc": "2.0",
  "result": "0x146695866343024d1ad9854a72904d16abec8b1597e098619d2addbd44b14e4c"
}
```

{% endtab %}
{% endtabs %}


# 5. Withdraw DAI from Public Pool

## Description

Withdraw DAIs from public liquidity pool. Once you retrieve your DAIs from the public pool, your reDAIs will be switched to DAIs.

**TBD: Narratives**

**TBD: Lock/Unlock Period Explanation**

## User Interface

![Withdrawal Panel](broken://files/-Mf6tR2CELoXrCoUP8dA)

## Function Description

|                 Item                |                                             Description                                             |
| :---------------------------------: | :-------------------------------------------------------------------------------------------------: |
|         **Contract Address**        |                 Public pool contract (referenced by Smart Contract Overview section)                |
|          **Contract Name**          |                                           SLDDAIPools1.sol                                          |
|             **Function**            |                               function withdraw(uint256 reTokenAmount)                              |
|        **Function Selector**        |                                              0x3c264195                                             |
|         **Invocation Type**         |                                         Ethereum Transaction                                        |
|        **Passing Parameters**       |            Amount of DAIs to withdraw from public pool; actual number multiplied by 1E18            |
|           **Return Value**          |                                                 None                                                |
|          **Event Emitted**          |                       event Withdraw(address indexed account, uint256 amount);                      |
|         **Event Signature**         |                  0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364                 |
| **Transaction Sample(BSC testnet)** | <https://testnet.bscscan.com/tx/0x32b4fc3be4d017b0f3025a2228201324559219f71c91518beea7943da9f967ed> |

## ABI Description

```
{
	"inputs": [{
		"internalType": "uint256",
		"name": "reTokenAmount",
		"type": "uint256"
	}],
	"name": "withdraw",
	"outputs": [{
		"internalType": "uint256",
		"name": "reAmount",
		"type": "uint256"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}
```

## Examples

### Calling Examples

{% tabs %}
{% tab title="JavaScript" %}

```javascript
var Web3 = require('web3');
const BigNumber = require('bignumber.js');

// BSC Mainnet: https://bsc-dataseed.binance.org
// BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545
const  web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545");

const CONTRACT_ADDRESS = "Replace with Public Pool Contract Address";
const ABI = [{
	"inputs": [{
		"internalType": "uint256",
		"name": "reTokenAmount",
		"type": "uint256"
	}],
	"name": "withdraw",
	"outputs": [{
		"internalType": "uint256",
		"name": "reAmount",
		"type": "uint256"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}];

// Withdraw Deposit 1 DAI to public pool.
const DEPOSIT_AMOUNT = 1e18;

var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);

contract.methods.withdrawvide(new BigNumber(DEPOSIT_AMOUNT).toString()).send({
    from: "CALLER_ADDRESS",
}, function(error, result){
    if(!error) {
      console.log('Response:', result);
    } else {
      console.log(error);
    }
});
```

{% endtab %}

{% tab title="Python" %}

```
# This example is written by using Web3.py
# More details on Web3.py could be found here - https://web3py.readthedocs.io/


```

{% endtab %}
{% endtabs %}

### HTTP Request Example

## Send a Deposit Transaction

<mark style="color:green;">`POST`</mark> `(BSC Mainnet) https://bsc-dataseed.binance.org/`

Make a deposit transaction to Shield Protocol V1 on BSC network.\
More details on how to send a transaction via BSC RPC could be found here, <https://ethereum.org/en/developers/docs/apis/json-rpc/#eth\\_sendrawtransaction>

#### Request Body

| Name    | Type   | Description                                           |
| ------- | ------ | ----------------------------------------------------- |
| jsonrpc | string | "2.0"                                                 |
| method  | string | "eth\_sendRawTransaction"                             |
| params  | array  | the signed transaction data coerced into string array |
| id      | number | request sequence id, you could use timestamp as id    |

{% tabs %}
{% tab title="200 Success response." %}

```
{
  "id":64,
  "jsonrpc": "2.0",
  "result": "0x146695866343024d1ad9854a72904d16abec8b1597e098619d2addbd44b14e4c"
}
```

{% endtab %}
{% endtabs %}


# 6. Check Funds on Public Pool

## Description

Check detailed information on fund deposited in public liquidity pool.

**TBD: Narratives**

## User Interface

![Liquidity Info Panel](broken://files/-Mf6yF2XZhoCX7eiET1F)

## Function Description

|          Item          |                                           Description                                           |
| :--------------------: | :---------------------------------------------------------------------------------------------: |
|  **Contract Address**  |               Public pool contract (referenced by Smart Contract Overview section)              |
|    **Contract Name**   |                                         SLDDAIPools1.sol                                        |
|      **Function**      | function getLPAmountInfo() public view returns(uint256 deposit,uint256 availabe,uint256 locked) |
|  **Function Selector** |                                            0x53ac2d24                                           |
|   **Invocation Type**  |                                          Ethereum Call                                          |
| **Passing Parameters** |                                               None                                              |
|    **Return Value**    |                     Total deposited amount; available amount; locked amount                     |

## ABI Description

```
{
	"inputs": [],
	"name": "getLPAmountInfo",
	"outputs": [{
		"internalType": "uint256",
		"name": "deposit",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "availabe",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "locked",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}
```

## Examples

### Calling Examples

{% tabs %}
{% tab title="JavaScript" %}

```javascript
// This example is written by using Web3.js
// More details on Web3.js could be found here - https://web3js.readthedocs.io/

var Web3 = require('web3');
const BigNumber = require('bignumber.js');

// BSC Mainnet: https://bsc-dataseed.binance.org
// BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545
const  web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545");

const CONTRACT_ADDRESS = "Replace with public pool contract address";
const ABI = [{
	"inputs": [],
	"name": "getLPAmountInfo",
	"outputs": [{
		"internalType": "uint256",
		"name": "deposit",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "availabe",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "locked",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}];

var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);

contract.methods.getLPAmountInfo().call({
}, function(error, result){
    if(!error) {
      console.log('Response:', result);
    } else {
      console.log(error);
    }
});
```

{% endtab %}

{% tab title="Python" %}

```
# This example is written by using Web3.py
# More details on Web3.py could be found here - https://web3py.readthedocs.io/


```

{% endtab %}
{% endtabs %}

### HTTP Request Example

## Send a call request to get public pool info

<mark style="color:green;">`POST`</mark> `(BSC Mainnet) https://bsc-dataseed.binance.org/`

\
Make a contract call to get deposited funds details of Shield Protocol V1.\
More details on how to make a contract call request via BSC RPC could be found here, <https://ethereum.org/en/developers/docs/apis/json-rpc/#eth\\_sendrawtransaction><br>

#### Request Body

| Name    | Type   | Description                                                          |
| ------- | ------ | -------------------------------------------------------------------- |
| jsonrpc | string | "2.0"                                                                |
| method  | string | "eth\_call"                                                          |
| params  | array  | the signed transaction data coerced into string array, for instance, |
| id      | number | request sequence id, you could use timestamp as id                   |

{% tabs %}
{% tab title="200 The result responded could be decoded into two uint256 numbers which represents the total amount and the available amount of deposited funds." %}

```
{
    "jsonrpc": "2.0",
    "id": 1234,
    "result": "0x0000000000000000000000000000000000000000000dc85f59edd89161ce451a0000000000000000000000000000000000000000000ab0e0c62a28d4f38d151a00000000000000000000000000000000000000000003177e93c3afbc6e413000"
}
```

{% endtab %}
{% endtabs %}

**Request Body Example:**

```
{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0x0000000000000000000000000000000000000000",
            "to": "0x67360e519b0d7f4f4f257e22253cac1cd5c8ef12",
            "data": "0x53ac2d24"
        },
        "latest"
    ],
    "id": 1234
}
```

**CURL Example:**

```bash
curl --location --request POST 'https://data-seed-prebsc-1-s1.binance.org:8545' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0x0000000000000000000000000000000000000000",
            "to": "0x67360e519b0d7f4f4f257e22253cac1cd5c8ef12",
            "data": "0x53ac2d24"
        },
        "latest"
    ],
    "id": 1234
}'
```


# 7. Deposit DAI to Private Pool

## Description

Deposit DAI to private liquidity pool.

**TBD: Narratives & Differences between public pool and private pool**

## User Interface

![Private Pool Panel](broken://files/-Mf71eDhY8YTaIQgHfOV)

![Confirm Deposit](broken://files/-Mf71qth5LJYyxM4jDCE)

## Function Description

|                 Item                |                                                                                                   Description                                                                                                   |
| :---------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|         **Contract Address**        |                                                                      Private pool contract (referenced by Smart Contract Overview section)                                                                      |
|          **Contract Name**          |                                                                                                 SLDDAIPools2.sol                                                                                                |
|             **Function**            |                                                                                       function provide(uint256 mintAmount)                                                                                      |
|        **Function Selector**        |                                                                                                    0x2e2ebe06                                                                                                   |
|         **Invocation Type**         |                                                                                               Ethereum Transaction                                                                                              |
|        **Passing Parameters**       |                                                                           Amount of DAIs to deposit; actual number multiplied by 1E18                                                                           |
|           **Return Value**          |                                                                                                       None                                                                                                      |
|          **Event Emitted**          |                                                                            event ProvideLP2(address indexed account, uint256 amount);                                                                           |
|         **Event Signature**         |                                                                        0x26a27ab2f158d9fe04dea4c221634a0d50bdbb2a9fcdcc1960567eefa9c2ed0a                                                                       |
| **Transaction Sample(BSC testnet)** | [https://testnet.bscscan.com/tx/0xae1851d19feadb5d8f4ac8dfc24f746c1d851e06bb2a80c23685162b2784a39b](https://testnet.bscscan.com/tx/0x2f408eeae0afc37e6abe7edf4746d453568a7c3c8a382925c18ff818caaca9ff#eventlog) |

## ABI Description

```
{
	"inputs": [{
		"internalType": "uint256",
		"name": "mintAmount",
		"type": "uint256"
	}],
	"name": "provide",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}
```

## Examples

### Calling Examples

{% tabs %}
{% tab title="JavaScript" %}

```javascript
var Web3 = require('web3');
const BigNumber = require('bignumber.js');

// BSC Mainnet: https://bsc-dataseed.binance.org
// BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545
const  web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545");

const CONTRACT_ADDRESS = "Replace with Private Pool Contract Address";
const ABI = [{
	"inputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "deposit",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}];

// Deposit 10 DAI to private pool.
const DEPOSIT_AMOUNT = 10e18;

var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);

contract.methods.provide(new BigNumber(DEPOSIT_AMOUNT).toString()).send({
    from: "CALLER_ADDRESS",
}, function(error, result){
    if(!error) {
      console.log('Response:', result);
    } else {
      console.log(error);
    }
});
```

{% endtab %}

{% tab title="Python" %}

```
# This example is written by using Web3.py
# More details on Web3.py could be found here - https://web3py.readthedocs.io/


```

{% endtab %}
{% endtabs %}

### HTTP Request Example

## Send a Deposit Transaction

<mark style="color:green;">`POST`</mark> `(BSC Mainnet) https://bsc-dataseed.binance.org/`

Make a deposit transaction to Shield Protocol V1 on BSC network.\
More details on how to send a transaction via BSC RPC could be found here, <https://ethereum.org/en/developers/docs/apis/json-rpc/#eth\\_sendrawtransaction>

#### Request Body

| Name    | Type   | Description                                           |
| ------- | ------ | ----------------------------------------------------- |
| jsonrpc | string | "2.0"                                                 |
| method  | string | "eth\_sendRawTransaction"                             |
| params  | array  | the signed transaction data coerced into string array |
| id      | number | request sequence id, you could use timestamp as id    |

{% tabs %}
{% tab title="200 Success response." %}

```
{
  "id":64,
  "jsonrpc": "2.0",
  "result": "0x146695866343024d1ad9854a72904d16abec8b1597e098619d2addbd44b14e4c"
}
```

{% endtab %}
{% endtabs %}


# 8. Withdraw DAI from Private Pool

## Description

Withdraw DAI from private liquidity pool.

**TBD: Narratives & Rules of withdrawal**

## User Interface

![Withdraw Panel](broken://files/-Mf73KC957kWpfE7JsOH)

![Confirm withdraw](broken://files/-Mf73_YL6t1f-q5pjMhX)

## Function Description

|                 Item                |                                                                                                   Description                                                                                                   |
| :---------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|         **Contract Address**        |                                                                      Private pool contract (referenced by Smart Contract Overview section)                                                                      |
|          **Contract Name**          |                                                                                                 SLDDAIPools2.sol                                                                                                |
|             **Function**            |                                                                                        function withdraw(uint256 amount)                                                                                        |
|        **Function Selector**        |                                                                                                    0x2e1a7d4d                                                                                                   |
|         **Invocation Type**         |                                                                                               Ethereum Transaction                                                                                              |
|        **Passing Parameters**       |                                                                           Amount of DAIs to withdraw; actual number multiplied by 1E18                                                                          |
|           **Return Value**          |                                                                                                       None                                                                                                      |
|          **Event Emitted**          |                                                                             event Withdraw(address indexed account, uint256 amount);                                                                            |
|         **Event Signature**         |                                                                        0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364                                                                       |
| **Transaction Sample(BSC testnet)** | [https://testnet.bscscan.com/tx/0xae1851d19feadb5d8f4ac8dfc24f746c1d851e06bb2a80c23685162b2784a39b](https://testnet.bscscan.com/tx/0x2f408eeae0afc37e6abe7edf4746d453568a7c3c8a382925c18ff818caaca9ff#eventlog) |

## ABI Description

```
{
	"inputs": [{
		"internalType": "uint256",
		"name": "mintAmount",
		"type": "uint256"
	}],
	"name": "provide",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}
```

## Examples

### Calling Examples

{% tabs %}
{% tab title="JavaScript" %}

```javascript
var Web3 = require('web3');
const BigNumber = require('bignumber.js');

// BSC Mainnet: https://bsc-dataseed.binance.org
// BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545
const  web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545");

const CONTRACT_ADDRESS = "Replace with Private Pool Contract Address";
const ABI = [{
	"inputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "deposit",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}];

// Deposit 10 DAI to private pool.
const DEPOSIT_AMOUNT = 10e18;

var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);

contract.methods.provide(new BigNumber(DEPOSIT_AMOUNT).toString()).send({
    from: "CALLER_ADDRESS",
}, function(error, result){
    if(!error) {
      console.log('Response:', result);
    } else {
      console.log(error);
    }
});
```

{% endtab %}

{% tab title="Python" %}

```
# This example is written by using Web3.py
# More details on Web3.py could be found here - https://web3py.readthedocs.io/


```

{% endtab %}
{% endtabs %}

### HTTP Request Example

## Send a Deposit Transaction

<mark style="color:green;">`POST`</mark> `(BSC Mainnet) https://bsc-dataseed.binance.org/`

Make a deposit transaction to Shield Protocol V1 on BSC network.\
More details on how to send a transaction via BSC RPC could be found here, <https://ethereum.org/en/developers/docs/apis/json-rpc/#eth\\_sendrawtransaction>

#### Request Body

| Name    | Type   | Description                                           |
| ------- | ------ | ----------------------------------------------------- |
| jsonrpc | string | "2.0"                                                 |
| method  | string | "eth\_sendRawTransaction"                             |
| params  | array  | the signed transaction data coerced into string array |
| id      | number | request sequence id, you could use timestamp as id    |

{% tabs %}
{% tab title="200 Success response." %}

```
{
  "id":64,
  "jsonrpc": "2.0",
  "result": "0x146695866343024d1ad9854a72904d16abec8b1597e098619d2addbd44b14e4c"
}
```

{% endtab %}
{% endtabs %}


# 9. Check Funds on Private Pool

## Description

Check detailed information on funds deposited in private public liquidity pool.

**TBD: Narratives**

## User Interface

![Liquidity Info Panel](broken://files/-Mf6yF2XZhoCX7eiET1F)

## Function Description

|          Item          |                                           Description                                           |
| :--------------------: | :---------------------------------------------------------------------------------------------: |
|  **Contract Address**  |              Private pool contract (referenced by Smart Contract Overview section)              |
|    **Contract Name**   |                                         SLDDAIPools2.sol                                        |
|      **Function**      | function getLPAmountInfo() public view returns(uint256 deposit,uint256 availabe,uint256 locked) |
|  **Function Selector** |                                            0x53ac2d24                                           |
|   **Invocation Type**  |                                          Ethereum Call                                          |
| **Passing Parameters** |                                               None                                              |
|    **Return Value**    |                     Total deposited amount; available amount; locked amount                     |

## ABI Description

```
{
	"inputs": [],
	"name": "getLPAmountInfo",
	"outputs": [{
		"internalType": "uint256",
		"name": "deposit",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "availabe",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "locked",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}
```

## Examples

### Calling Examples

{% tabs %}
{% tab title="JavaScript" %}

```javascript
// This example is written by using Web3.js
// More details on Web3.js could be found here - https://web3js.readthedocs.io/

var Web3 = require('web3');
const BigNumber = require('bignumber.js');

// BSC Mainnet: https://bsc-dataseed.binance.org
// BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545
const  web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545");

const CONTRACT_ADDRESS = "Replace with private pool contract address";
const ABI = [{
	"inputs": [],
	"name": "getLPAmountInfo",
	"outputs": [{
		"internalType": "uint256",
		"name": "deposit",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "availabe",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "locked",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}];

var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);

contract.methods.getLPAmountInfo().call({
}, function(error, result){
    if(!error) {
      console.log('Response:', result);
    } else {
      console.log(error);
    }
});
```

{% endtab %}

{% tab title="Python" %}

```
# This example is written by using Web3.py
# More details on Web3.py could be found here - https://web3py.readthedocs.io/


```

{% endtab %}
{% endtabs %}

### HTTP Request Example

## Send a call request to get private pool info

<mark style="color:green;">`POST`</mark> `(BSC Mainnet) https://bsc-dataseed.binance.org/`

\
Make a contract call to get deposited funds details in private pool of Shield Protocol V1.\
More details on how to make a contract call request via BSC RPC could be found here, <https://ethereum.org/en/developers/docs/apis/json-rpc/#eth\\_sendrawtransaction><br>

#### Request Body

| Name    | Type   | Description                                                          |
| ------- | ------ | -------------------------------------------------------------------- |
| jsonrpc | string | "2.0"                                                                |
| method  | string | "eth\_call"                                                          |
| params  | array  | the signed transaction data coerced into string array, for instance, |
| id      | number | request sequence id, you could use timestamp as id                   |

{% tabs %}
{% tab title="200 The result responded could be decoded into two uint256 numbers which represents the total amount and the available amount of deposited funds." %}

```
{
    "jsonrpc": "2.0",
    "id": 1234,
    "result": "0x00000000000000000000000000000000000000000042276639528ca5195640e500000000000000000000000000000000000000000040f62cc1eeed6f34b8e3e500000000000000000000000000000000000000000001313977639f35e49d5d00"
}
```

{% endtab %}
{% endtabs %}

**Request Body Example:**

```
{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0x0000000000000000000000000000000000000000",
            "to": "0x60e2be64528dbe4e5892254d3dad83809a3f6f3a",
            "data": "0x53ac2d24"
        },
        "latest"
    ],
    "id": 1234
}
```

**CURL Example:**

```bash
curl --location --request POST 'https://data-seed-prebsc-1-s1.binance.org:8545' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0x0000000000000000000000000000000000000000",
            "to": "0x60e2be64528dbe4e5892254d3dad83809a3f6f3a",
            "data": "0x53ac2d24"
        },
        "latest"
    ],
    "id": 1234
}'
```


# 10. Check Details on a Certain Order

## Description

Check detailed information on fund deposited in private public liquidity pool.

**TBD: Narratives**

## Function Description

|          Item          |                                                                                                                                                                                                                                                                                                                                                                         Description                                                                                                                                                                                                                                                                                                                                                                         |
| :--------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|  **Contract Address**  |                                                                                                                                                                                                                                                                                                                                               Trading contract (referenced by Smart Contract Overview section)                                                                                                                                                                                                                                                                                                                                              |
|    **Contract Name**   |                                                                                                                                                                                                                                                                                                                                                                      SLDDAIContract.sol                                                                                                                                                                                                                                                                                                                                                                     |
|      **Function**      |                                                                                                                                                                                                                     function getOrderInfo(uint256 orderID) external view returns ( string memory exType, address holder, uint256 number, uint256 exFee, uint256 lockFee, uint256 newLockFee, uint256 openPrice, uint256 marginAmount, uint256 marginFee, uint256 startTime, uint256 closePrice, ContractType contractType, State state )                                                                                                                                                                                                                    |
|  **Function Selector** |                                                                                                                                                                                                                                                                                                                                                                          0xd311636b                                                                                                                                                                                                                                                                                                                                                                         |
|   **Invocation Type**  |                                                                                                                                                                                                                                                                                                                                                                        Ethereum Call                                                                                                                                                                                                                                                                                                                                                                        |
| **Passing Parameters** |                                                                                                                                                                                                                                                                                                                                                                             None                                                                                                                                                                                                                                                                                                                                                                            |
|    **Return Value**    | <p><strong>exType</strong>: transaction pair,</p><p><strong>holder</strong>: address of open position,</p><p><strong>number</strong>: number of open positions,</p><p><strong>exFee</strong>: opening fee,</p><p><strong>lockFee</strong>: accumulated position fee,</p><p><strong>newLockFee</strong>: expected position fee for the next cycle,</p><p><strong>openPrice</strong>: opening price,</p><p><strong>marginAmount</strong>: margin,</p><p><strong>marginFee</strong>: bursting fee,</p><p><strong>startTime</strong>: time to open position,</p><p><strong>closePrice</strong>: price to close position,</p><p><strong>contractType</strong>: up or down direction, call up - put down,</p><p><strong>state</strong>: status 1 open 2 close</p> |

## ABI Description

```
[{
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "getOrderInfo",
	"outputs": [{
		"internalType": "string",
		"name": "exType",
		"type": "string"
	}, {
		"internalType": "address",
		"name": "holder",
		"type": "address"
	}, {
		"internalType": "uint256",
		"name": "number",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "exFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "lockFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "newLockFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "openPrice",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "startTime",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "closePrice",
		"type": "uint256"
	}, {
		"internalType": "enum IDDSCommon.ContractType",
		"name": "contractType",
		"type": "uint8"
	}, {
		"internalType": "enum IDDSContract.State",
		"name": "state",
		"type": "uint8"
	}],
	"stateMutability": "view",
	"type": "function"
}]
```

## Examples

### Calling Examples

{% tabs %}
{% tab title="JavaScript" %}

```javascript
// This example is written by using Web3.js
// More details on Web3.js could be found here - https://web3js.readthedocs.io/

var Web3 = require('web3');
const BigNumber = require('bignumber.js');

// BSC Mainnet: https://bsc-dataseed.binance.org
// BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545
const  web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545");

const CONTRACT_ADDRESS = "Replace with trading contract address";
const ABI = [{
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "getOrderInfo",
	"outputs": [{
		"internalType": "string",
		"name": "exType",
		"type": "string"
	}, {
		"internalType": "address",
		"name": "holder",
		"type": "address"
	}, {
		"internalType": "uint256",
		"name": "number",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "exFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "lockFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "newLockFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "openPrice",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "startTime",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "closePrice",
		"type": "uint256"
	}, {
		"internalType": "enum IDDSCommon.ContractType",
		"name": "contractType",
		"type": "uint8"
	}, {
		"internalType": "enum IDDSContract.State",
		"name": "state",
		"type": "uint8"
	}],
	"stateMutability": "view",
	"type": "function"
}];

var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);

contract.methods.getLPAmountInfo().call({
}, function(error, result){
    if(!error) {
      console.log('Response:', result);
    } else {
      console.log(error);
    }
});
```

{% endtab %}

{% tab title="Python" %}

```
# This example is written by using Web3.py
# More details on Web3.py could be found here - https://web3py.readthedocs.io/


```

{% endtab %}
{% endtabs %}

### HTTP Request Example

## Send a call request to get private pool info

<mark style="color:green;">`POST`</mark> `(BSC Mainnet) https://bsc-dataseed.binance.org/`

\
Make a contract call to get deposited funds details in private pool of Shield Protocol V1.\
More details on how to make a contract call request via BSC RPC could be found here, <https://ethereum.org/en/developers/docs/apis/json-rpc/#eth\\_sendrawtransaction><br>

#### Request Body

| Name    | Type   | Description                                                          |
| ------- | ------ | -------------------------------------------------------------------- |
| jsonrpc | string | "2.0"                                                                |
| method  | string | "eth\_call"                                                          |
| params  | array  | the signed transaction data coerced into string array, for instance, |
| id      | number | request sequence id, you could use timestamp as id                   |

{% tabs %}
{% tab title="200 The result responded could be decoded into two uint256 numbers which represents the total amount and the available amount of deposited funds." %}

```
{
    "jsonrpc": "2.0",
    "id": 1234,
    "result": "0x00000000000000000000000000000000000000000000000000000000000001a000000000000000000000000080e6baed0bafadd4e1153e580d4d1102305986e7000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000045e76ce7317e600000000000000000000000000000000000000000000000000d20fcd1b4707bc8000000000000000000000000000000000000000000000000001b5339e668fac300000000000000000000000000000000000000000000006aaa408c45e5753c00000000000000000000000000000000000000000000000000fbce7db7de8433000000000000000000000000000000000000000000000000000674e2672d1715000000000000000000000000000000000000000000000000000000000060d4885b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000064554484441490000000000000000000000000000000000000000000000000000"
}
```

{% endtab %}
{% endtabs %}

**Request Body Example:**

```
{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0x0000000000000000000000000000000000000000",
            "to": "0x32c10ce5f9f47ab82141d73a136823d3e20408e0",
            "data": "0xd311636b0000000000000000000000000000000000000000000000000000000000000000"
        },
        "latest"
    ],
    "id": 1234
}
```

**CURL Example:**

```bash
curl --location --request POST 'https://data-seed-prebsc-1-s1.binance.org:8545' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0x0000000000000000000000000000000000000000",
            "to": "0x32c10ce5f9f47ab82141d73a136823d3e20408e0",
            "data": "0xd311636b0000000000000000000000000000000000000000000000000000000000000000"
        },
        "latest"
    ],
    "id": 1234
}'
```


# 11. Get Funding Fee Rate of an Option Transaction

## Description

Get funding fee rate of an option transaction .

**TBD: Narratives**

## Function Description

|          Item          |                                               Description                                              |
| :--------------------: | :----------------------------------------------------------------------------------------------------: |
|  **Contract Address**  |                Underlying asset contract (referenced by Smart Contract Overview section)               |
|    **Contract Name**   |                                           UnderlyingAsset.sol                                          |
|      **Function**      | function getFundingFeeRate(ContractType \_contractType) public view returns (uint256 \_fundingFeeRate) |
|  **Function Selector** |                                               0xc138aa5f                                               |
|   **Invocation Type**  |                                              Ethereum Call                                             |
| **Passing Parameters** |                                             1: CALL, 2: PUT                                            |
|    **Return Value**    |                                   Funding fee rate(multiplied by 1E8)                                  |

## ABI Description

```
{
  "inputs": [
    {
      "internalType": "enum ISLDCommon.ContractType",
      "name": "_contractType",
      "type": "uint8"
    }
  ],
  "name": "getFundingFeeRate",
  "outputs": [
    {
      "internalType": "uint256",
      "name": "_fundingFeeRate",
      "type": "uint256"
    }
  ],
  "stateMutability": "view",
  "type": "function"
}
```

## Examples

### Calling Examples

{% tabs %}
{% tab title="JavaScript" %}

```javascript
// This example is written by using Web3.js
// More details on Web3.js could be found here - https://web3js.readthedocs.io/

var Web3 = require('web3');
const BigNumber = require('bignumber.js');

// BSC Mainnet: https://bsc-dataseed.binance.org
// BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545
const  web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545");

const CONTRACT_ADDRESS = "Replace with underlying assets contract address";
const ABI = [{
  "inputs": [
    {
      "internalType": "enum ISLDCommon.ContractType",
      "name": "_contractType",
      "type": "uint8"
    }
  ],
  "name": "getFundingFeeRate",
  "outputs": [
    {
      "internalType": "uint256",
      "name": "_fundingFeeRate",
      "type": "uint256"
    }
  ],
  "stateMutability": "view",
  "type": "function"
}];

var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);

// CALL
contract.methods.getFundingFeeRate(1).call({
}, function(error, result){
    if(!error) {
      console.log('Response:', result);
    } else {
      console.log(error);
    }
});

// PUT
contract.methods.getFundingFeeRate(2).call({
}, function(error, result){
    if(!error) {
      console.log('Response:', result);
    } else {
      console.log(error);
    }
});
```

{% endtab %}

{% tab title="Python" %}

```
# This example is written by using Web3.py
# More details on Web3.py could be found here - https://web3py.readthedocs.io/


```

{% endtab %}
{% endtabs %}

### HTTP Request Example

## Send a call request to get private pool info

<mark style="color:green;">`POST`</mark> `(BSC Mainnet) https://bsc-dataseed.binance.org/`

\
Make a contract call to get deposited funds details in private pool of Shield Protocol V1.\
More details on how to make a contract call request via BSC RPC could be found here, <https://ethereum.org/en/developers/docs/apis/json-rpc/#eth\\_sendrawtransaction><br>

#### Request Body

| Name    | Type   | Description                                                          |
| ------- | ------ | -------------------------------------------------------------------- |
| jsonrpc | string | "2.0"                                                                |
| method  | string | "eth\_call"                                                          |
| params  | array  | the signed transaction data coerced into string array, for instance, |
| id      | number | request sequence id, you could use timestamp as id                   |

{% tabs %}
{% tab title="200 The result responded could be decoded into two uint256 numbers which represents the total amount and the available amount of deposited funds." %}

```
{
    "jsonrpc": "2.0",
    "id": 1234,
    "result": "0x00000000000000000000000000000000000000000042276639528ca5195640e500000000000000000000000000000000000000000040f62cc1eeed6f34b8e3e500000000000000000000000000000000000000000001313977639f35e49d5d00"
}
```

{% endtab %}
{% endtabs %}

**Request Body Example:**

```
// CALL
{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0x0000000000000000000000000000000000000000",
            "to": "0x60e2be64528dbe4e5892254d3dad83809a3f6f3a",
            "data": "0xc138aa5f0000000000000000000000000000000000000000000000000000000000000001"
        },
        "latest"
    ],
    "id": 1234
}

// PUT
{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0x0000000000000000000000000000000000000000",
            "to": "0x60e2be64528dbe4e5892254d3dad83809a3f6f3a",
            "data": "0xc138aa5f0000000000000000000000000000000000000000000000000000000000000002"
        },
        "latest"
    ],
    "id": 1234
}
```

**CURL Example:**

```bash
# CALL
curl --location --request POST 'https://data-seed-prebsc-1-s1.binance.org:8545' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0x0000000000000000000000000000000000000000",
            "to": "0x60e2be64528dbe4e5892254d3dad83809a3f6f3a",
            "data": "0xc138aa5f0000000000000000000000000000000000000000000000000000000000000001"
        },
        "latest"
    ],
    "id": 1234
}'

# PUT
curl --location --request POST 'https://data-seed-prebsc-1-s1.binance.org:8545' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0x0000000000000000000000000000000000000000",
            "to": "0x60e2be64528dbe4e5892254d3dad83809a3f6f3a",
            "data": "0xc138aa5f0000000000000000000000000000000000000000000000000000000000000002"
        },
        "latest"
    ],
    "id": 1234
}'
```


# "How-To" Instructions


# How to monitor opening and closing orders?

## Description

By scanning all the blocks, we can get the logs of each transaction, parse the topics, and determine the corresponding contract address, find the corresponding transaction parameters, and then perform the next data processing operation according to the business requirements.

## Events Emitted in Transactions

### Deposit Funds

|      **Title**      |                                         Content                                         |
| :-----------------: | :-------------------------------------------------------------------------------------: |
|  **Event Emitted**  | event DDSDeposit(address indexed sender, address indexed toAddr, uint256 motageAmount); |
| **Event Signature** |            0x8741a00229f2b8b24379b60f7a4ba3a3f3d92f328280c47a38cd03504ac72c42           |

### Withdraw Funds

|      **Title**      |                                          Content                                         |
| :-----------------: | :--------------------------------------------------------------------------------------: |
|  **Event Emitted**  | event DDSWithdraw(address indexed sender, address indexed toAddr, uint256 motageAmount); |
| **Event Signature** |            0x9319767067544c146c859088bc69f38236cad434eb28957e8574a56d4173f89f            |

### Deposit DAI into Public Pool

|      **Title**      |                                    Content                                   |
| :-----------------: | :--------------------------------------------------------------------------: |
|  **Event Emitted**  | event Provide(address indexed account, uint256 amount, uint256 writeAmount); |
| **Event Signature** |      0x4089141ea5e4c16575f5ebf65f1786497ea07c175846fc7745ef8d8986a4ff65      |

### Deposit DAI into Private Pool

|      **Title**      |                               Content                              |
| :-----------------: | :----------------------------------------------------------------: |
|  **Event Emitted**  |     event ProvideLP2(address indexed account, uint256 amount);     |
| **Event Signature** | 0x26a27ab2f158d9fe04dea4c221634a0d50bdbb2a9fcdcc1960567eefa9c2ed0a |

### Withdraw DAI from Public/Private Pool

|      **Title**      |                               Content                              |
| :-----------------: | :----------------------------------------------------------------: |
|  **Event Emitted**  |      event Withdraw(address indexed account, uint256 amount);      |
| **Event Signature** | 0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364 |


# Addendum


# Full ABI on Shield Protocol V1

## ABI of Trading Contract

```
[{
	"inputs": [{
		"internalType": "address",
		"name": "_pubPool",
		"type": "address"
	}, {
		"internalType": "address",
		"name": "_priPool",
		"type": "address"
	}],
	"stateMutability": "nonpayable",
	"type": "constructor"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "uint256",
		"name": "orderId",
		"type": "uint256"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "currentPrice",
		"type": "uint256"
	}],
	"name": "DDSCloseContract",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "sender",
		"type": "address"
	}, {
		"indexed": true,
		"internalType": "address",
		"name": "toAddr",
		"type": "address"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "motageAmount",
		"type": "uint256"
	}],
	"name": "DDSDeposit",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "currentPrice",
		"type": "uint256"
	}],
	"name": "DDSMigrationContract",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "uint256",
		"name": "orderId",
		"type": "uint256"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "currentPrice",
		"type": "uint256"
	}],
	"name": "DDSOpenContract",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "currentPrice",
		"type": "uint256"
	}],
	"name": "DDSRiskHandler",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "sender",
		"type": "address"
	}, {
		"indexed": true,
		"internalType": "address",
		"name": "toAddr",
		"type": "address"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "motageAmount",
		"type": "uint256"
	}],
	"name": "DDSWithdraw",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "previousOwner",
		"type": "address"
	}, {
		"indexed": true,
		"internalType": "address",
		"name": "newOwner",
		"type": "address"
	}],
	"name": "OwnershipTransferred",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "addr",
		"type": "address"
	}],
	"name": "SetFormular",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "addr",
		"type": "address"
	}],
	"name": "SetrepayFudAddr",
	"type": "event"
}, {
	"inputs": [],
	"name": "DDSBrokerAddr",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "DDSLiquidorAddr",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "currentPrice",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "intervalDay",
		"type": "uint256"
	}],
	"name": "addFeesForUser",
	"outputs": [{
		"internalType": "bool",
		"name": "succ",
		"type": "bool"
	}, {
		"internalType": "uint256",
		"name": "newHoldFee",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "startTime",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "endTime",
		"type": "uint256"
	}],
	"name": "calculatIntervalDay",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "pure",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "openTime",
		"type": "uint256"
	}],
	"name": "calculatPeriods",
	"outputs": [{
		"internalType": "uint256",
		"name": "periods",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "checkOrder",
	"outputs": [{
		"internalType": "uint256",
		"name": "lpFlag",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "checkOrderIsAtRisk",
	"outputs": [{
		"internalType": "bool",
		"name": "",
		"type": "bool"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "closecontract",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "string",
		"name": "exchangeType",
		"type": "string"
	}, {
		"internalType": "uint256",
		"name": "number",
		"type": "uint256"
	}, {
		"internalType": "enum IDDSCommon.ContractType",
		"name": "contractType",
		"type": "uint8"
	}, {
		"internalType": "address",
		"name": "inviter",
		"type": "address"
	}, {
		"internalType": "uint256",
		"name": "slideDownPrice",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "slideUpPrice",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "deadline",
		"type": "uint256"
	}],
	"name": "creatContract",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "deposit",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "exchgFeeRate",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "string",
		"name": "exchangeType",
		"type": "string"
	}, {
		"internalType": "uint256",
		"name": "number",
		"type": "uint256"
	}, {
		"internalType": "enum IDDSCommon.ContractType",
		"name": "contractType",
		"type": "uint8"
	}],
	"name": "fees",
	"outputs": [{
		"internalType": "uint256",
		"name": "total",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "exchgFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "openFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "liquidorFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "currentPrice",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "formular",
	"outputs": [{
		"internalType": "contract Formular",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "getBalanceByAddr",
	"outputs": [{
		"internalType": "uint256",
		"name": "balance",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "getCloseHoldFee",
	"outputs": [{
		"internalType": "uint256",
		"name": "holdFee",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "string",
		"name": "exchangeType",
		"type": "string"
	}],
	"name": "getCurrPriceByEx",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "getCurrentBlockTime",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "currentPrice",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "intervalDay",
		"type": "uint256"
	}],
	"name": "getHoldFeeByOrderID",
	"outputs": [{
		"internalType": "uint256",
		"name": "holdFee",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "getLastMigrationTime",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "currentPrice",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "poolType",
		"type": "uint256"
	}],
	"name": "getLockedAmount",
	"outputs": [{
		"internalType": "uint256",
		"name": "marginFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "forceFee",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "getLpMarginAmount",
	"outputs": [{
		"internalType": "uint256",
		"name": "marginAmount",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "getLpMarginAmountAndMarginFee",
	"outputs": [{
		"internalType": "uint256",
		"name": "marginAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginFee",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "string",
		"name": "exchangeEx",
		"type": "string"
	}, {
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}, {
		"internalType": "enum IDDSCommon.ContractType",
		"name": "contractType",
		"type": "uint8"
	}],
	"name": "getMaxOpenAmount",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "string",
		"name": "exchangeType",
		"type": "string"
	}, {
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "openPrice",
		"type": "uint256"
	}, {
		"internalType": "enum IDDSCommon.ContractType",
		"name": "contractType",
		"type": "uint8"
	}],
	"name": "getOpenPositionFee",
	"outputs": [{
		"internalType": "uint256",
		"name": "fee",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "getOrderInfo",
	"outputs": [{
		"internalType": "string",
		"name": "exType",
		"type": "string"
	}, {
		"internalType": "address",
		"name": "holder",
		"type": "address"
	}, {
		"internalType": "uint256",
		"name": "number",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "exFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "lockFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "newLockFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "openPrice",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "startTime",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "closePrice",
		"type": "uint256"
	}, {
		"internalType": "enum IDDSCommon.ContractType",
		"name": "contractType",
		"type": "uint8"
	}, {
		"internalType": "enum IDDSContract.State",
		"name": "state",
		"type": "uint8"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "getOrdersLen",
	"outputs": [{
		"internalType": "uint256",
		"name": "ordersLen",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "getPriceByBTCDAI",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "getPriceByETHDAI",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "getThirdPriceAndFlag",
	"outputs": [{
		"internalType": "bool",
		"name": "",
		"type": "bool"
	}, {
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "liquidorFeeRate",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256[]",
		"name": "orderIDs",
		"type": "uint256[]"
	}],
	"name": "migrationContract",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "migrationHour",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"name": "migrationInfo",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"name": "orders",
	"outputs": [{
		"internalType": "address payable",
		"name": "holder",
		"type": "address"
	}, {
		"internalType": "enum IDDSCommon.ContractType",
		"name": "contractType",
		"type": "uint8"
	}, {
		"internalType": "enum IDDSContract.State",
		"name": "state",
		"type": "uint8"
	}, {
		"internalType": "string",
		"name": "exchangeType",
		"type": "string"
	}, {
		"internalType": "uint256",
		"name": "number",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "exFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "liquidorFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "lockFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "newLockFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "openPrice",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "startTime",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "closePrice",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "owner",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "currentPrice",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "payProfit",
	"outputs": [{
		"internalType": "uint256",
		"name": "profit",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "privPool",
	"outputs": [{
		"internalType": "contract IPrivatePool",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "pubPool",
	"outputs": [{
		"internalType": "contract IPublicPool",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "renounceOwnership",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "repayFudAddr",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256[]",
		"name": "orderIDs",
		"type": "uint256[]"
	}],
	"name": "riskControl",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "riskFundAddr",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_DDSLiquidorAddr",
		"type": "address"
	}],
	"name": "setDDSLiquidorAddr",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_DDSBrokerAddr",
		"type": "address"
	}],
	"name": "setDDSbrokerAddr",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint8",
		"name": "exchageType",
		"type": "uint8"
	}, {
		"internalType": "address",
		"name": "addr",
		"type": "address"
	}],
	"name": "setExchageAddress",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "_exchgFeeRate",
		"type": "uint256"
	}],
	"name": "setExchageFeeRate",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "contract Formular",
		"name": "_formular",
		"type": "address"
	}],
	"name": "setFormular",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "_liquidorFeeRate",
		"type": "uint256"
	}],
	"name": "setLiquidorFeeRate",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "_migrationHour",
		"type": "uint256"
	}],
	"name": "setMigrationHour",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_tokenAddr",
		"type": "address"
	}],
	"name": "setPoolTokenAddr",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "bool",
		"name": "_priceThirdFlag",
		"type": "bool"
	}, {
		"internalType": "uint256",
		"name": "_thirdProxyPrice",
		"type": "uint256"
	}],
	"name": "setPriceThirdProxy",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_priPool",
		"type": "address"
	}],
	"name": "setPrivatePool",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_pubPool",
		"type": "address"
	}],
	"name": "setPublicPool",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_repayFudAddr",
		"type": "address"
	}],
	"name": "setRepayFudAddr",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_riskFundAddr",
		"type": "address"
	}],
	"name": "setRiskFundAddr",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "tokenAddr",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "newOwner",
		"type": "address"
	}],
	"name": "transferOwnership",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "unlocked",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"name": "userAccount",
	"outputs": [{
		"internalType": "uint256",
		"name": "depositAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "availableAmount",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "withdraw",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}]
```

## ABI of Public Pool Contract

```
[{
	"inputs": [],
	"stateMutability": "nonpayable",
	"type": "constructor"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "owner",
		"type": "address"
	}, {
		"indexed": true,
		"internalType": "address",
		"name": "spender",
		"type": "address"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "value",
		"type": "uint256"
	}],
	"name": "Approval",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "previousOwner",
		"type": "address"
	}, {
		"indexed": true,
		"internalType": "address",
		"name": "newOwner",
		"type": "address"
	}],
	"name": "OwnershipTransferred",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "account",
		"type": "address"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "writeAmount",
		"type": "uint256"
	}],
	"name": "Provide",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "account",
		"type": "address"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "ProvideLP2",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "from",
		"type": "address"
	}, {
		"indexed": true,
		"internalType": "address",
		"name": "to",
		"type": "address"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "value",
		"type": "uint256"
	}],
	"name": "Transfer",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "account",
		"type": "address"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "Withdraw",
	"type": "event"
}, {
	"inputs": [],
	"name": "DDSRewardsAddr",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"name": "addressExist",
	"outputs": [{
		"internalType": "bool",
		"name": "",
		"type": "bool"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"name": "addressIndex",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "owner",
		"type": "address"
	}, {
		"internalType": "address",
		"name": "spender",
		"type": "address"
	}],
	"name": "allowance",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "spender",
		"type": "address"
	}, {
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "approve",
	"outputs": [{
		"internalType": "bool",
		"name": "",
		"type": "bool"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "account",
		"type": "address"
	}],
	"name": "balanceOf",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "id",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "profit",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "holdFee",
		"type": "uint256"
	}],
	"name": "close",
	"outputs": [{
		"internalType": "uint256",
		"name": "userProfit",
		"type": "uint256"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "decimals",
	"outputs": [{
		"internalType": "uint8",
		"name": "",
		"type": "uint8"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "spender",
		"type": "address"
	}, {
		"internalType": "uint256",
		"name": "subtractedValue",
		"type": "uint256"
	}],
	"name": "decreaseAllowance",
	"outputs": [{
		"internalType": "bool",
		"name": "",
		"type": "bool"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "formular",
	"outputs": [{
		"internalType": "contract Formular",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "geMarginAmount",
	"outputs": [{
		"internalType": "uint256",
		"name": "marginAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginFee",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "getLPAmountInfo",
	"outputs": [{
		"internalType": "uint256",
		"name": "deposit",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "availabe",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "locked",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "currentPrice",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "poolType",
		"type": "uint256"
	}],
	"name": "getLockedAmount",
	"outputs": [{
		"internalType": "uint256",
		"name": "marginFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "forceFee",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "getMatchID",
	"outputs": [{
		"internalType": "uint256",
		"name": "lpID",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "mintAmount",
		"type": "uint256"
	}],
	"name": "getMintReDaiAmount",
	"outputs": [{
		"internalType": "uint256",
		"name": "mintOtoken",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "tokenAmount",
		"type": "uint256"
	}],
	"name": "getReTokenAmountByToken",
	"outputs": [{
		"internalType": "uint256",
		"name": "retokenAmount",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "getRiskFundAmount",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "reTokenAmount",
		"type": "uint256"
	}],
	"name": "getTokenAmountByreToken",
	"outputs": [{
		"internalType": "uint256",
		"name": "tokenAmount",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "getTotalSupply",
	"outputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "addr",
		"type": "address"
	}],
	"name": "getUserReToeknInfo",
	"outputs": [{
		"internalType": "uint256",
		"name": "selfReToken",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "total",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "getlockedLiquidityLen",
	"outputs": [{
		"internalType": "uint256",
		"name": "lpLen",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "spender",
		"type": "address"
	}, {
		"internalType": "uint256",
		"name": "addedValue",
		"type": "uint256"
	}],
	"name": "increaseAllowance",
	"outputs": [{
		"internalType": "bool",
		"name": "",
		"type": "bool"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "string",
		"name": "a",
		"type": "string"
	}, {
		"internalType": "string",
		"name": "b",
		"type": "string"
	}],
	"name": "isEqual",
	"outputs": [{
		"internalType": "bool",
		"name": "",
		"type": "bool"
	}],
	"stateMutability": "pure",
	"type": "function"
}, {
	"inputs": [],
	"name": "keeper",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"name": "lastProvideTm",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "id",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginFee",
		"type": "uint256"
	}],
	"name": "lock",
	"outputs": [{
		"internalType": "bool",
		"name": "",
		"type": "bool"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"name": "lockedLiquidity",
	"outputs": [{
		"internalType": "uint256",
		"name": "takerId",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginFee",
		"type": "uint256"
	}, {
		"internalType": "address",
		"name": "makerAddr",
		"type": "address"
	}, {
		"internalType": "bool",
		"name": "locked",
		"type": "bool"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "lockupPeriod",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "lp2Keeper",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"name": "lpAccount",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"name": "matchIds",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "profit",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "moveProfit",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "number",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "movePrice",
		"type": "uint256"
	}],
	"name": "moveLp1Fund",
	"outputs": [{
		"internalType": "bool",
		"name": "",
		"type": "bool"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "name",
	"outputs": [{
		"internalType": "string",
		"name": "",
		"type": "string"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "owner",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "plAmountInfo",
	"outputs": [{
		"internalType": "uint256",
		"name": "plDepositTotal",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "pl1lockedAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "pl1AvailAmount",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "mintAmount",
		"type": "uint256"
	}],
	"name": "provide",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "renounceOwnership",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "id",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "profit",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "holdFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "currPrice",
		"type": "uint256"
	}],
	"name": "riskClose",
	"outputs": [{
		"internalType": "bool",
		"name": "flag",
		"type": "bool"
	}, {
		"internalType": "uint256",
		"name": "userProfit",
		"type": "uint256"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "riskFundAddr",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_DDSRewardsAddr",
		"type": "address"
	}],
	"name": "setDDSRewardsAddr",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "contract Formular",
		"name": "_formular",
		"type": "address"
	}],
	"name": "setFormular",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_keeperAddr",
		"type": "address"
	}],
	"name": "setKeeper",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_lp2KeeperAddr",
		"type": "address"
	}],
	"name": "setLP2Keeper",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "period",
		"type": "uint256"
	}],
	"name": "setLockupPeriod",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_tokenAddr",
		"type": "address"
	}],
	"name": "setPoolTokenAddr",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_riskFundAddr",
		"type": "address"
	}],
	"name": "setRiskFundAddr",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "symbol",
	"outputs": [{
		"internalType": "string",
		"name": "",
		"type": "string"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "tokenAddress",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "totalBalance",
	"outputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "totalSupply",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "recipient",
		"type": "address"
	}, {
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "transfer",
	"outputs": [{
		"internalType": "bool",
		"name": "",
		"type": "bool"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "sender",
		"type": "address"
	}, {
		"internalType": "address",
		"name": "recipient",
		"type": "address"
	}, {
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "transferFrom",
	"outputs": [{
		"internalType": "bool",
		"name": "",
		"type": "bool"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "newOwner",
		"type": "address"
	}],
	"name": "transferOwnership",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "reTokenAmount",
		"type": "uint256"
	}],
	"name": "withdraw",
	"outputs": [{
		"internalType": "uint256",
		"name": "reAmount",
		"type": "uint256"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}]
```

## ABI of Private Pool Contract

```
[{
	"inputs": [{
		"internalType": "contract PublicDAIPool",
		"name": "_lp1",
		"type": "address"
	}],
	"stateMutability": "nonpayable",
	"type": "constructor"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "previousOwner",
		"type": "address"
	}, {
		"indexed": true,
		"internalType": "address",
		"name": "newOwner",
		"type": "address"
	}],
	"name": "OwnershipTransferred",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "account",
		"type": "address"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "writeAmount",
		"type": "uint256"
	}],
	"name": "Provide",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "account",
		"type": "address"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "ProvideLP2",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"internalType": "address",
		"name": "account",
		"type": "address"
	}, {
		"indexed": false,
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "Withdraw",
	"type": "event"
}, {
	"inputs": [],
	"name": "DDSRewardsAddr",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "accIndex",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "addMarginAmount",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"name": "addressExist",
	"outputs": [{
		"internalType": "bool",
		"name": "",
		"type": "bool"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "id",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "profit",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "holdFee",
		"type": "uint256"
	}],
	"name": "close",
	"outputs": [{
		"internalType": "uint256",
		"name": "userProfit",
		"type": "uint256"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "geMarginAmount",
	"outputs": [{
		"internalType": "uint256",
		"name": "marginAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginFee",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "getLPAmountInfo",
	"outputs": [{
		"internalType": "uint256",
		"name": "deposit",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "availabe",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "locked",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "getLPLocked",
	"outputs": [{
		"internalType": "uint256",
		"name": "locked",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}],
	"name": "getMatchID",
	"outputs": [{
		"internalType": "uint256",
		"name": "lpID",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "getMatchLp2Object",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "getRiskFundAmount",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "getlockedLiquidityLen",
	"outputs": [{
		"internalType": "uint256",
		"name": "lpLen",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "keeper",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"name": "lastProvideTm",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "id",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "exchgFee",
		"type": "uint256"
	}],
	"name": "lock",
	"outputs": [{
		"internalType": "bool",
		"name": "",
		"type": "bool"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"name": "lockedLiquidity",
	"outputs": [{
		"internalType": "uint256",
		"name": "takerId",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "marginFee",
		"type": "uint256"
	}, {
		"internalType": "address",
		"name": "makerAddr",
		"type": "address"
	}, {
		"internalType": "bool",
		"name": "locked",
		"type": "bool"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "lockupPeriod",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "lp1",
	"outputs": [{
		"internalType": "contract PublicDAIPool",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"name": "lpAccount",
	"outputs": [{
		"internalType": "address payable",
		"name": "holder",
		"type": "address"
	}, {
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "availableAmount",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "lockedAmount",
		"type": "uint256"
	}, {
		"internalType": "bool",
		"name": "isRejectOrder",
		"type": "bool"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"name": "lpAddrs",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"name": "matchIds",
	"outputs": [{
		"internalType": "uint256",
		"name": "",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "owner",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "mintAmount",
		"type": "uint256"
	}],
	"name": "provide",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "renounceOwnership",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "orderID",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "number",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "holdFee",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "profit",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "currPrice",
		"type": "uint256"
	}],
	"name": "riskClose",
	"outputs": [{
		"internalType": "bool",
		"name": "flag",
		"type": "bool"
	}, {
		"internalType": "uint256",
		"name": "userProfit",
		"type": "uint256"
	}],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "riskFundAddr",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_DDSRewardsAddr",
		"type": "address"
	}],
	"name": "setDDSRewardsAddr",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "bool",
		"name": "flag",
		"type": "bool"
	}],
	"name": "setIsRejectOrder",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_keeperAddr",
		"type": "address"
	}],
	"name": "setKeeper",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "period",
		"type": "uint256"
	}],
	"name": "setLockupPeriod",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_tokenAddr",
		"type": "address"
	}],
	"name": "setPoolTokenAddr",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "contract PublicDAIPool",
		"name": "_lp1",
		"type": "address"
	}],
	"name": "setPublicPoolAddr",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "_riskFundAddr",
		"type": "address"
	}],
	"name": "setRiskFundAddr",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [],
	"name": "tokenAddress",
	"outputs": [{
		"internalType": "address",
		"name": "",
		"type": "address"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [],
	"name": "totalBalance",
	"outputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "address",
		"name": "newOwner",
		"type": "address"
	}],
	"name": "transferOwnership",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"inputs": [{
		"internalType": "uint256",
		"name": "amount",
		"type": "uint256"
	}],
	"name": "withdraw",
	"outputs": [],
	"stateMutability": "nonpayable",
	"type": "function"
}]
```


# References

* RPC References on Ethereum/BSC Network: <https://ethereum.org/en/developers/docs/apis/json-rpc>
* Solidity Documentation: <https://docs.soliditylang.org/>
* Truffle Documentation: <https://www.trufflesuite.com/docs>


# Audits

Shield's Perpetual Options contracts and Shield Vault contracts have been audited. Despite the security efforts, Shield advises users to be cautious and not risk assets they are unwilling to lose.

**Perpetual Options**

[*SlowMist*](https://github.com/slowmist/Knowledge-Base/blob/master/open-report/Smart%20Contract%20Security%20Audit%20Report%20-%20Shield.pdf)

[*PeckShield*](https://github.com/peckshield/publications/blob/master/audit_reports/PeckShield-Audit-Report-Shield-v1.0.1.pdf)

**Shield Vault**

[*Certik*](https://www.certik.com/projects/shield-protocol)

[*Secure3\_SSVault*](https://github.com/Secure3Audit/Shield_SSVault_Audit_Contest/blob/main/audit_report/Secure3_Shield_SSVault_security_audit_report.pdf)

[*Secure3\_MVault*](https://github.com/Secure3Audit/Shield_MVault_Audit_Contest/tree/main/audit_report)


# Privacy Policy

Effective From August 1, 2021

**Why Do You Collect My Information?**&#x20;

We collect your Personal Information to provide, maintain, and improve our Services. To be more specific, we primarily use your Personal Information to:

Communicate with you about our products, services, technical updates, and any information that you request through the Services or that we think you might be interested; Track and analyze activities, usage, trends, numbers, and market insights related to our Services; Detect, prevent, and address security or technical issues; Prevent illegal activities and protect the rights and property of ZeroEx and the users; and Facilitate our work with vendors, agents, consultants, and other service providers.&#x20;

**What Information Do You Collect and How Is It Collected?**&#x20;

**Information You Choose to Share:** We collect information you directly share with us. When you fill out a survey, request support, use any interactive features of the Services, or communicate with us in other ways, you choose to provide the information to us.

**IP Address and Device Information:** When you use our Services, we collect log information including your IP address, browser type, time of visit, pages viewed, and any other log information typically shared through interacting with websites. We also obtain information about the device you use to access our Services, including operating system, model of the computer or mobile device, mobile network, and any other information about your device.

**Information Collected by Cookies:** Cookies are small data files stored on your computer’s hard drive by websites that you visit. Our Site is using Cookies, which help us understand trends and quality of visits. We use information collected by Cookies to enhance effectiveness of our Services and improve your experience.

**Email Communication:** If you subscribe to our newsletter with your email address, we may from time to time communicate news, updates, promotional information, marketing materials and other information related to ZeroEx, and the Services. If you want to opt out of receiving such emails from us, you can opt out by clicking “unsubscribe” in any of the emails we sent you.

We may also collect and store information that you share with us through email, including inquiries, requests, feedback, and any other information you choose to provide.

**Social Media:** We are using plugins from social networks such as GitHub, Twitter, Discord, Facebook, Reddit, Medium, YouTube on the Site. When you click on a plugin, the associated social network may collect your data, including the data of your visits on the Site, in accordance with their respective privacy policies. We are not responsible for data collected by these social networks. Please check with these social networks on their privacy policies.

Information Collected From Other Sources: We may receive information from other sources, including third party service providers. This helps us evaluate and improve our Services.

**How My Information Is Shared?**&#x20;

We may share your Personal Information with third parties including vendors, marketing agencies, consultants, agents, or other service providers if such sharing is necessary to facilitate our work with the third parties;

We may also share your Personal Information as we reasonably believe is necessary to 1) comply with any applicable law, regulation, or valid directive from law enforcement or a court; 2) detect, prevent or address any security or technical issues; 3) enforce this Privacy Policy, or Terms of Service; 4) protect rights, property or safety of Shield Protocol or others;

We have the right to share your Personal Information between and among Shield (current and future) parents, subsidiaries, or any other affiliates. You acknowledge that in cases where we may choose to sell or transfer our business assets, your Personal Information may be transferred or acquired by a third party, and that any acquirer of our assets may continue to use your Personal Information as provided in this Privacy Policy.

**Is My Information Secure With You?**&#x20;

We are making reasonable efforts to protect your Personal Information. While we are continuously improving our security measures, we cannot guarantee the security of your Personal Information. You should be aware that unauthorized entry or use, technical system failures, and other factors, may jeopardize your Personal Information.

**How Long Do You Keep My Information?**&#x20;

We store your Personal Information only for the period necessary for the purpose(s) for which we originally collect the information, or as required by applicable laws.

**How Do You Update the Privacy Policy?**&#x20;

We may amend this Privacy Policy at any time by posting the amended version on the Services including the date of the amendment. If we make changes, we will notify you by posting an announcement on the Services or sending you an email. Your use of the Services after any changes to the Privacy Policy constitutes your consent to the changes and you are bound by the amended Privacy Policy.

**What If My Information Is Transferred To Foreign Countries?**&#x20;

We process and store your information in Singapore However, we and our service providers may transfer your Personal Information to, or store it in, foreign countries. We will make efforts to ensure that we comply with local legal requirements and that your information receives adequate protection in foreign jurisdictions.

**Contact us**&#x20;

Should you have any questions, concerns, suggestions, please contact us at **<hello@shieldex.io>**


# Terms of Use

Effective From August 1, 2021

In these Shield Terms of Use (“Terms”), “Shield”, "we" and "us" refer to Shield and we own and operate the website <https://shieldex.io/> ("the Site") which acts as a front-end to the decentralized Shield Protocol. These Terms apply to you (“You”) as a user of the Site and Shield front-end, including all the products, services, tools and information made available on the Site.

Please read these Terms carefully before using the Site. These Terms apply to any person accessing the Site and by using the Site you agree to be bound by them. If you don’t want to be bound by them, you should not access the Site. By using the Site in any capacity, you agree that you have read and understood these Terms.

Please read these Terms carefully to ensure that you understand each provision. This agreement contains a mandatory individual arbitration and class action/jury trial waiver provision that requires the use of arbitration on an individual basis to resolve disputes, rather than jury trials or class actions.

You must be able to form a legally binding contract online either as an individual or on behalf of a legal entity. You represent that, if you are agreeing to these Terms on behalf of a legal entity, you have the legal authority to bind the company or other legal entity to these Terms and you are at least 18 years old or the age of majority where you reside, whichever is older, can form a legally binding contract online, and have the full, right, power and authority to enter into and to comply with the obligations under these Terms.

You are advised to check these Terms periodically to familiarise yourself with any changes to the Terms. Shield in its sole discretion, reserves the right to make changes to our terms of services. Changes are binding on users of the Site and will take effect immediately upon posting. As a user, you agree to be bound by any changes, variations, or modifications to our terms of service and your continued use of the Site shall constitute acceptance of any such changes, variations, or modifications.

Shield will indicate on the Site of the changes to these Terms. You accept by doing so, we provide you with sufficient notice of such change.

Our Privacy Policy and Cookie Policy also apply to your use of the Site Intellectual Property Rights We are the owner of all intellectual property rights in the Site and the material published on them. These works are protected by copyright laws and all such rights are reserved.

<https://shieldex.io/> is the uniform resource locator (‘URL’) of Shield. You will not make use of this URL (or any other URL owned by us) on another website or digital platform without our prior written consent.

You agree not to monitor, use or copy our web pages without our prior consent. Any unauthorized use or reproduction may be prosecuted.

You will retain ownership of all copyright in data you upload or submit to the Site. You grant us a worldwide, royalty-free, irrevocable license to use, copy, distribute or publish and send this data in any manner.

Third-Party Links We don't share your personal information with third parties. Aggregated, anonymized data is periodically transmitted to external services to help us improve the Website and service.

We may allow third parties to provide analytics services. These third parties may use cookies, web beacons and other technologies to collect information about your use of the services and other websites, including your IP address, web browser, pages viewed, time spent on pages, links clicked and conversion information.

We also use social buttons provided by services like Twitter, Google+, LinkedIn, and Facebook. Your use of these third-party services is entirely optional. We are not responsible for the privacy policies and/or practices of these third-party services, and you are responsible for reading and understanding those third-party services' privacy policies.

Cookies We may use cookies on our site to remember your preferences. Disclaimers We do not guarantee that the Site will be secure or free from bugs or viruses.

You are responsible for configuring your information technology, computer programmes, and platform in order to access the Site. You should use your own virus protection software.

We cannot promise that the use of the Site, or any content taken from the Site, will not infringe the rights of any third party.

The content and materials available on the Site are for informational purposes only and is not intended to address your particular requirements. In particular, the content and materials available on the Site does not constitute any form of advice or recommendation by us, should not be regarded as an offer, solicitation, invitation or recommendation to buy or sell investments, securities or any other financial services and is not intended to be relied upon by you in making any specific investment or other decisions. We recommend that you seek independent advice from financial advisory before making any such decision.

Nothing included in the site constitutes an offer or solicitation to sell, or distribution of, investments and related services to anyone in any jurisdiction.

From time to time, reference may be made to data we have gathered. These references may be selective or, may be partial. As markets change continuously, previously published information and data may not be current and should not be relied upon. Opt-Out, Communication Preferences You may modify your communication preferences and/or opt-out from specific communications at any time. Please specify and adjust your preferences.

**Contact Us**&#x20;

Should you have any questions, concerns, suggestions, please contact us at <hello@shieldex.io>


