# Pool

DEFED Pool supports three functions, including the Exchange Pool for users to participate in asset exchanges with uncertain prices, the Lucky Pool for conducting lucky draws, and the Prize Pool for predicting specific asset prices to win rewards.

## Exchange Pool

### Summary

Exchange Pool is an exciting feature offered by DEFED, allowing users to participate in asset exchanges with uncertain prices. It enables users to potentially sell specified assets at high prices or buy them at low prices under certain conditions. The Prize Pool supports the addition of underlying assets and base assets, and after expiration, it settles counterparty assets proportionally among all participants.

### Details

To participate in the Prize Pool, users need to transfer assets from DEFED to an exclusive Activity Account and Vault contract.&#x20;

The assets in the Activity Account are divided into two states: pending and available.&#x20;

* When a user adds assets to the Prize Pool and places a bid, the smart contract encrypts the bid information and broadcasts it to the blockchain, freezing the assets in the user's bet and changing their status to pending.&#x20;
* No further operations can be performed on assets in the pending status until the Prize Pool expires and settles. Assets in the Activity Account that are not used for bidding are available and can be used for bidding or transferred out at any time.

The Prize Pool goes through four states: initialized, bid, settled and closed.&#x20;

These states correspond to the initial contract deployment, the open bidding phase for all participants, the closing of bidding and settlement, and the full closure of the Prize Pool, respectively. Assets can only be added to the Prize Pool during the bidding phase.

### Black-box mechanism

To ensure the black-box design of information during the bidding phase, the Prize Pool employs a unique approach. As the blockchain is open and transparent, publicly visible asset transfers can reveal the true exchange ratio of the Prize Pool, undermining the black-box aspect.&#x20;

Additionally, settling asset transfers after expiration could potentially allow users to manipulate the system and compromise fairness.&#x20;

To address these concerns, the Activity Account is exclusively used for adding assets to the Prize Pool. When a user initiates a bid, the signature is encrypted and broadcasted, and the corresponding assets change to the pending settlement status. Users can only transfer out the available balance in their Activity Account.

This design ensures that:

* No asset transferring occurs until expiration;
* Preventing the real asset information in the pool from being read on the blockchain;
* The smart contract guarantees successful debiting upon maturity, ensuring fairness;
* Assets not participating in the bid can be transferred out flexibly, maintaining flexibility.

## **Lucky Pool**

To encourage more DAO members to participate in the Exchange Pool, enhancing the uncertainty and fun of the Exchange results, DEFED has decided to launch the Lucky Pool.

You can qualify for the lucky draw by engaging in the bidding process in the Exchange Pool. In each phase of the Exchange Pool, DEFED accounts that have completed a bid are eligible to participate in the Lucky Pool.

A portion of the prizes from the Exchange Pool will be allocated to the Lucky Pool according to a pre-determined ratio. After each settlement of the Exchange Pool, the Lucky Pool will conduct a draw based on a pre-deployed on-chain random number smart contract. The winner will enjoy the entire reward pool of the Lucky Pool.

## **Prize Pool for Guess (Coming Soon)**
