# Strategy: Land Borrow Farm V2

### Overview <a href="#overview" id="overview"></a>

The PCS3 strategy leverages the Venus and PancakeSwapV3 protocols to maximise returns for its users. In essence, the PCS3 strategy follows a multi-step process that involves liquidity management, lending and borrowing required tokens, and participating in PancakeSwapV3 liquidity pools and farming. The ultimate objective is to earn rewards and distribute them to users in the form of BLID tokens.

### Smart Contracts <a href="#smart-contracts" id="smart-contracts"></a>

Behind each PCS3 strategy, there are the following set of smart contract:

* **Logic**. Defines all methods to operate with Venus and PancakeSwapV3 protocols
* **Strategy**. Provides methods to manage the strategy
* **PairManager**. Provides methods to manage the strategy pairs

### Pairs <a href="#pairs" id="pairs"></a>

PCS3 defines pairs as a strategy setting in order to properly manage liquidity on PancakeSwapV3 pools. Each pair is structured as follows:

```
struct Pair { // PancakeSwapV3 pool in which liquidity will be provided address pool;
// Percentage of available liquidity allocated to this pair
uint24 percentage;

// Minimum price range percentage (base = 10^5)
uint24 minPricePercentage;

// Maximum price range percentage (base = 10^5)
uint24 maxPricePercentage;

// Threshold for price changes in sqrtX96 Uniswap notation
uint160 sqrtPriceThreshold;

// Position's NFT ID
uint256 tokenId;
}
```

To obtain a comprehensive list of pairs, users can query the `getPairs` method of the `PairManager` contract. You can refer to an example of these pairs here: <https://bscscan.com/address/0x4753E0a12e8a997ce24A03F045AD3B6b921B5270#readProxyContract#F1.>

### Tasks <a href="#tasks" id="tasks"></a>

To support the entire process, the PCS3 strategy relies on a set of Gelato automation tasks.

### Supply Task <a href="#supply-task" id="supply-task"></a>

The Supply Task is executed when there is available liquidity on Multilogic that can be utilised by the strategy. This task involves the transfer of tokens, which are subsequently provided to the Venus protocol.

Example transaction: <https://bscscan.com/tx/0xfb939f888f3b3354130b9feb1ebc719049880d3c655891430249842db19e30b0>

### Venus Rebalance Task <a href="#venus-rebalance-task" id="venus-rebalance-task"></a>

The Venus Rebalance Task comes into play when the strategy needs to borrow or repay tokens within the Venus protocol to maintain a balanced collateral position. The PCS3 strategy operates with the aim of borrowing as many tokens as possible while maintaining a safe distance from the liquidation point. There are two types of Venus Rebalance Task: build and destroy.

#### Build Venus Rebalance Task <a href="#build-venus-rebalance-task" id="build-venus-rebalance-task"></a>

During build routine the strategy:

* calculates amount of tokens to be borrowed on Venus and provided to PancakeSwapV3 then
* borrow tokens on Venus
* provide liquidity to PancakeSwapV3 staking and farming

Example transaction: <https://bscscan.com/tx/0x8ac99305fcc3d33d8e80a83a6ef702d18bf344dcdc6bfaa203f749fb62661971>\
\
Example of portfolio after build task:

<figure><img src="blob:https://app.gitbook.com/7d43047e-c6e4-4b80-8411-8f138a78ba8a" alt=""><figcaption></figcaption></figure>

#### Destroy Venus Rebalance Task <a href="#destroy-venus-rebalance-task" id="destroy-venus-rebalance-task"></a>

During destroy routine the strategy:

* calculates amount of tokens to be removed from PancakeSwapV3 and repaid on Venus
* remove liquidity from PancakeSwapV3
* repay released tokens on Venus

### PancakeSwap Rebalance Task <a href="#pancakeswap-rebalance-task" id="pancakeswap-rebalance-task"></a>

The PancakeSwap Rebalance Task is executed when the price relationship between the strategy's staked tokens on PancakeSwapV3 experiences significant fluctuations. Each pair within the strategy defines a specific price range for liquidity provision, along with a price change threshold. If the price between tokens deviates beyond the predefined threshold, this task is initiated. During this process, PCS3 temporarily removes liquidity from farming and staking, rebalances token holdings, and put tokens into a new position.

Example transaction: <https://bscscan.com/tx/0x5d78aeab6768baa2efd354b24e619408376ce261cd6ba5b849686cd9015683d5>

### Rewards Distribution <a href="#rewards-distribution" id="rewards-distribution"></a>

PCS3 earns rewards in the form of XVS tokens from Venus and CAKE tokens from PancakeSwapV3 farming. Additionally, the strategy earns swap fees as a liquidity provider. A substantial portion of these rewards is converted into BLID tokens and subsequently distributed to our users.

Example transaction: <https://bscscan.com/tx/0x697b0bb8a585c7a1a47089b6221cba8fac8cedae40f399b29ff4b7d1a593fdb7>

\ <br>
