OH Swap

Introduction

OtterHome is a decentralized exchange (DEX) platform that prioritizes simplicity and efficiency, providing users with a seamless and user-friendly token swapping experience. The platform operates on the Liquidity Book protocol, a unique automated market maker (AMM) that enables token swaps by calling the router and specifying the desired input or output of a pair of tokens, or by using native currencies like ETH.

Individual Swaps

When conducting swaps on OtterHome, the liquidity can cross one or multiple bins within a token pair contract called LBPair. The swap starts from the active bin and consumes liquidity until the desired amount is reached or the bin becomes empty. When a bin is emptied, liquidity is taken from the next closest bin at the exchange rate defined by the bin, and that bin becomes the new active bin for the pair. This mechanism ensures that token swaps can be conducted seamlessly, with zero slippage within the bins.

Liquidity Book Router

Swaps on OtterHome can be executed using a router contract called LBRouter, which simplifies the swap process and allows chained swaps across several pairs. This feature enables users to conduct more complex token swaps and provides greater flexibility for liquidity providers. OtterHome supports the creation of multiple LBPairs with the same tokens, differentiated by the binStep parameter. When requesting a swap through the router, each swap step is described using {token In, token Out, bin step}.

Overall, OtterHome's focus on simplicity and efficiency, combined with the advanced features of the Liquidity Book protocol, make it an attractive option for users who value a seamless and user-friendly DEX platform. By leveraging the power of AMM and router contracts, OtterHome can provide faster, more secure, and more flexible token swaps than traditional centralized exchanges, while also maintaining the core principles of decentralization and transparency.

Last updated