💻Developers
Last updated
Last updated
The Nabla Protocol is made up of a number of smart contracts. These include the Nabla Core contracts, which include the fundamental AMM logic, as well as a combination of contracts forming a pool ensemble/pool hub and Nabla periphery contracts, which e.g. enable cross-pool swaps.
The NablaPortal contract is the main entry point for users to interact with the Nabla ecosystem. It facilitates token swaps through the NablaRouter contracts, supporting advanced features such as multi-hop swaps and optional interactions with native ETH.
User key functions include swapExactTokensForTokens (swap ERC20 tokens for other ERC20 tokens), swapEthForExactTokens & swapExactTokensForEth (swap from or to native ETH) and quoteSwapExactTokensForTokens (retrieve quotes for token swaps, providing estimates of the amount of tokens that can be swapped for a given amount of tokens).
The NablaRouter contract facilitates seamless token swaps and real-time price feed updates.
User key function include swapExactTokensForTokens and getAmountOut, which are used to swap tokens and get a quote for a swap, respectively.
The NablaBackstopPool is a specialised contract and pool built on BackstopPoolCore. It allows users to deposit and withdraw liquidity from the backstop pool and redeem LP tokens from associated swap pools.
The backstop pool serves as an insurance mechanism, mitigating risks across a set of swap pools it supports. If a swap pool has low reserves, liquidity providers can perform an insurance withdrawal. This involves burning their swap pool shares in exchange for backstop liquidity.
The backstop pool owns all excess liquidity from its swap pools. It also assumes liability for any liquidity shortfalls. In return for this risk, the pool earns a share of the swap fees.
The SwapPool contract facilitates token swaps and liquidity management with features like capped deposits, configurable swap fees, and safe redeem mechanisms. It integrates with the NablaBackstopPool for risk coverage.
User key functions include deposit (swap tokens for pool shares), withdraw (redeem pool shares for tokens), backstopBurn (burn shares for underlying tokens), and backstopDrain (withdraw excess tokens).