# Loop & Short

Teller enables developers to implement long and short strategies in decentralized finance (DeFi) through time-based loans secured by ERC20 long tail collateral tokens. These strategies are facilitated by Teller’s isolated order books, which offer fixed-duration loans with predetermined APRs, mitigating risks associated with market volatility.

<figure><img src="https://3904891226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvp8vs3kAi1iyPrx6sout%2Fuploads%2Fw0aHr6d4OKGdhFJFIxNr%2Fimage.png?alt=media&#x26;token=d3171547-5c8a-456b-9a8c-2f4c77d91ff9" alt=""><figcaption><p>Teller built-in strategies</p></figcaption></figure>

### 📈 Long Strategy Implementation

A long strategy involves borrowing assets to increase exposure to a particular token, anticipating its value will appreciate over time. Developers can utilize Teller's platform to execute this strategy by following these steps:​

1. **Collateral Selection**: Choose an asset from the connected wallet to serve as collateral.​
2. **Loan Offer Evaluation**: Review available loan offers based on the selected collateral, considering factors such as token pair, loan duration, and maximum loan amount.​
3. **Loan Execution**: Initiate the loan transaction, which transfers the collateral into an on-chain escrow smart contract and disburses the loaned amount to the wallet.​
4. **Position Enhancement**: Deploy the borrowed funds to acquire additional tokens, thereby increasing exposure to the asset.​
5. **Repayment and Collateral Release**: At the end of the loan term, repay the loan along with any accrued interest to release the collateral from the escrow contract.​

This approach allows developers to implement long positions without the risk of liquidation due to market fluctuations, as the loan is time-based rather than price-based.​

***

### 📉 Short Strategy Implementation

A short strategy entails borrowing assets to sell them at the current market price, with the intention of repurchasing them at a lower price in the future. To execute this strategy using Teller's platform, developers can:​

1. **Collateral Selection**: Identify an asset in the wallet to use as collateral for the loan.​
2. **Loan Offer Evaluation**: Examine available loan offers, focusing on the token pair, loan duration, and maximum loan amount.​
3. **Loan Execution**: Initiate the loan transaction, transferring the collateral into an on-chain escrow smart contract and receiving the loaned amount in the wallet.​
4. **Asset Sale**: Sell the borrowed tokens at the current market price to realize immediate proceeds.​
5. **Asset Repurchase and Loan Repayment**: At the end of the loan term, repurchase the tokens at the prevailing market price and repay the loan along with any accrued interest to release the collateral.​

Implementing this strategy allows developers to profit from anticipated declines in asset prices, while the time-based nature of the loan mitigates the risk of liquidation.​

***

### 🧠 Summary

Teller’s **time-based loans** enable structured strategies without the risk of **price-triggered liquidations**. These strategies are deterministic—repayment terms are fixed and independent of market volatility—making them useful for automated or algorithmic DeFi operations.

| Strategy | Borrow     | Swap Type  | Risk Profile |
| -------- | ---------- | ---------- | ------------ |
| Long     | Stablecoin | Buy token  | Token ↓ risk |
| Short    | Token      | Sell token | Token ↑ risk |

### 🛠 Developer Considerations

* **Smart Contract Interaction**: Developers can integrate Teller's loan functionality into decentralized applications (dApps) by interacting with Teller's smart contracts, enabling automated loan origination, repayment, and collateral management.​
* **Widget Integration**: Teller provides software development widget for various platforms, facilitating seamless integration of loan features into existing dApp infrastructures.​
* **Risk Management**: While Teller's time-based loans reduce the risk of liquidation, developers should implement additional risk management strategies, such as monitoring collateral value and loan health ratios, to ensure the sustainability of positions.

### 💻 Smart Contract Patterns

| Step              | Function / Contract Interaction      |
| ----------------- | ------------------------------------ |
| Initiate Loan     | `TellerV2.acceptBid()`               |
| Repay Loan        | `TellerV2.repayLoan()`               |
| Escrow Management | Escrow contracts hold the collateral |
| DEX Trade         | Integrate with Uniswap V3            |

### Conclusion

Teller provides a robust solution for DeFi users seeking to manage positions without the risk of liquidation. By offering time-based loans with fixed terms, Teller enables users to enhance trade health, participate in yield farming, and capitalize on market opportunities while maintaining control over their collateral.
