gateway
gateway copied to clipboard
feat/carbondefi - Add Carbon DeFi AMM and CLOB_SPOT connector
Impact
The desired behaviour is to add new DeFi primitives supported by Carbon DeFi that will expand the on-chain capabilities of Hummingbot Gateway and benefit the Hummingbot users with on-chain limit orders, and a new AMM connection/liquidity source.
CarbonDeFi is a decentralised protocol live on Ethereum mainnet with similar deployments on Base, Mantle, Canto, Arbitrum, and Fantom which can be supported in the future, and supports any ERC-20 token (sans fee-on-transfer and rebase tokens, etc). Carbon DeFi allows any user to:
- Create on-chain one-sided BUY/SELL range and limit orders for a pair of ERC-20 tokens ("disposable strategy")
- Create two on-chain connected BUY and SELL range and limit orders ("recurring strategy") for a pair of ERC-20 tokens. Each order in the strategy adds to the liquidity of the other when selling tokens at the range the user selects.
- Trade against any on-chain orders to obtain the best price execution (calculated by the Carbon DeFi SDK).
- Future functionality with other types of strategies coming soon.
For this integration, supporting 1 and 3 works by creating an AMM connector and a CLOB_SPOT connector. A user can then trade against Carbon DeFi orders and create an on-chain limit order, which is executed against other exchanges on-chain via the Arb Fast Lane
Feature Suggestion
Add an AMM Carbon DeFi Connector that exposes the following endpoints:
-
/amm/price
-
/amm/trade
-
/amm/estimateGas
and a CLOB_SPOT Carbon DeFi Connector that exposes the following endpoints:
-
clob/markets
-
clob/orderBook
-
clob/ticker
-
clob/orders
-
clob/estimateGas
Additional context
Carbon DeFi documentation: https://docs.carbondefi.xyz
Example of some orders currently live on Carbon DeFi for the ETH-DAI pair (accessible through the explorer):