gateway icon indicating copy to clipboard operation
gateway copied to clipboard

feat/carbondefi - Add Carbon DeFi AMM and CLOB_SPOT connector

Open tiagofilipenunes opened this issue 1 year ago • 0 comments

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:

  1. Create on-chain one-sided BUY/SELL range and limit orders for a pair of ERC-20 tokens ("disposable strategy")
  2. 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.
  3. Trade against any on-chain orders to obtain the best price execution (calculated by the Carbon DeFi SDK).
  4. 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):

Screenshot 2023-12-18 at 17 29 07

tiagofilipenunes avatar Dec 20 '23 09:12 tiagofilipenunes