What are routers

Routers are customizable smart contracts that serve as the swapping component of SandCastle. They are vital to the protocols functionality as they are needed for liquidations & V3 position creation.

How do they work?

A router can be thought of something that intakes a token and outputs another with no other parameters passed. The functions of a router when called swap tokens and then send them back. With regards to existing Uniswap V3 pools, a router is needed for each fee level. For Uniswap V2 pools, only 1 router is needed.

Two Party Agreement

A lender can specify any amount of lenders to be used in their protocol. From this list a borrower can they choose a list of routers that they support. This ensures that both parties agree on fair routing.

Customization

Routes can be greatly customized to have more features. For example, Sand Castle features a couple basic routes including some that have circuit breakers. These detect large price movements and block position creation during volatility.

Last updated