Carbon DeFi Dev
  • Carbon DeFi
    • Introducing Carbon DeFi
      • What Makes Carbon DeFi Unique?
      • Fees & Payments
      • Resources
    • Security & Audits
  • Contracts & Functions
    • Contracts
      • CarbonController
      • CarbonVortex
      • CarbonVortexBridge
      • Deployments
        • Mainnet Contracts
        • Testnet Contracts
    • CarbonController Functions
      • Write Functions
        • Transaction Prerequisites
          • approve() / allowance()
        • Trade
          • tradeBySourceAmount()
          • tradeByTargetAmount()
        • Strategy Management
          • createStrategy()
          • updateStrategy
          • deleteStrategy()
      • Read Functions
        • controllerType()
        • tradingFeePPM()
        • pairTradingFeePPM()
        • pair()
        • pairs()
        • strategy()
        • strategiesByPair()
        • strategiesByPairCount()
        • calculateTradeSourceAmount()
        • calculateTradeTargetAmount()
      • Data & Events
        • TradingFeePPMUpdated()
        • PairCreated()
        • StrategyCreated()
        • StrategyDeleted()
        • StrategyUpdated()
        • TokensTraded()
        • FeesWithdrawn()
    • CarbonVortex Functions
      • Write Functions
        • trade()
        • execute()
      • Read Functions
        • amountAvailableForTrading()
        • availableTokens()
        • expectedTradeInput()
        • expectedTradeReturn()
        • finalTargetToken()
        • minTargetTokenSaleAmount()
        • minTokenSaleAmount()
        • pairDisabled()
        • priceDecayHalfLife()
        • rewardsPPM()
        • targetToken()
        • targetTokenPriceDecayHalfLife()
        • targetTokenSaleAmount()
        • tokenPrice()
        • totalCollected()
        • tradingEnabled()
    • CarbonVortexBridge Functions
      • Write Functions
        • Bridge()
  • Rest API
    • Carbon DeFi Public REST API
  • Developer Guides
    • Carbon DeFi SDK
      • Getting started
      • Interacting with the SDK
        • Managing Strategies
        • Performing Trades
        • Getting User and Pair Data
        • Collecting Liquidity Data
      • SDK Functions
        • constructor
        • startDataSync
        • getCachedPairs
        • hasLiquidityByPair
        • getLiquidityByPair
        • getUserStrategies
        • getTradeData
        • composeTradeByTargetTransaction
        • composeTradeBySourceTransaction
        • createBuySellStrategy
        • updateStrategy
        • deleteStrategy
        • getMinRateByPair
        • getMaxRateByPair
        • getRateLiquidityDepthByPair
    • The Carbon DeFi versus Uniswap V3 Invariant Functions
    • Carbon DeFi Subgraph
      • Accessing the Subgraph
      • Creating Subgraph Queries
      • Subgraph Query in Python
      • Sample Subgraph Queries
    • Using CarbonVortex
      • CarbonVortex Dynamics
Powered by GitBook
On this page
  • Adjustable Spread
  • Rotating Liquidity
  • Unidirectional, Irreversible Orders
  • MEV Protection
  1. Carbon DeFi
  2. Introducing Carbon DeFi

What Makes Carbon DeFi Unique?

Compared to existing on-chain liquidity protocols and AMMs, Carbon DeFi gives users the ability to execute automated on-chain trading strategies with greater control and efficiency via:

  • an adjustable bid/ask spread

  • rotating liquidity

  • unidirectional, irreversible orders

  • protection from MEV sandwich attacks

Adjustable Spread

Users who create strategies in Carbon DeFi ("makers") are similar to liquidity providers in existing AMMs in that their activities supply liquidity for trading, and they collect fees from other users ("takers") who perform spot trades using their liquidity.

However, Carbon DeFi is unique in that each individual maker can customize the fee they collect from trades by selecting their buy and sell ranges. While legacy AMMs force their liquidity providers to adopt the fee of the AMM they're providing liquidity to, Carbon DeFi lets LPs set their own personalized fee (or spread) by selecting the specific price(s) where they'd like to buy and where they'd like to sell their tokens.

Rotating Liquidity

When a user provides liquidity in existing on-chain liquidity protocols/AMMs, their position buys and sells tokens using a single pricing curve ("bonding curve").

In Carbon DeFi, each user position consists of two bonding curves (or "orders") - one for buying and one for selling. When a user deposits a token pair, each token in the pair has one custom curve based on the settings decided by the user. Once your position buys or sells at your desired price, your liquidity is automatically rotated to its paired curve, where it sits inactive (in the case of a single limit or range order).

In the case of a recurring strategy, buy and sell orders trade in perpetuity, until the user chooses to stop the strategy. Such a strategy offers to buy in one price range and sell in a higher range, with liquidity automatically rotating between the selected ranges as each order is executed (akin to a "Grid Trading" or "Scalping" strategy).

When using a Carbon DeFi strategy to replicate a concentrated liquidity position, the effective spread (also known as the fee tier) may narrow over time due to the auto-compounding nature of order balances. To maintain your intended spread, it’s recommended to periodically update the strategy and reconfigure the desired fee tier.

Unidirectional, Irreversible Orders

In existing on-chain liquidity protocols, executed orders may be reversed when markets retrace. This is due the bidirectional nature of AMM liquidity: Once a buy order for one asset is traded against, a sell order for the other asset is placed at the same price. To avoid order reversal, users must manually monitor and withdraw their liquidity upon execution (or rely on external tooling to do so).

MEV Protection

PreviousIntroducing Carbon DeFiNextFees & Payments

Last updated 3 days ago

In contrast, limit/range orders in Carbon DeFi flow in a single direction and are therefore irreversible on execution. This removes the need for users to constantly monitor their orders and manually withdraw in time, or rely on a third-party to do so.

Due to the irreversibility of Carbon DeFi orders, spot trades that execute against Carbon DeFi strategies are protected from MEV sandwich attacks. .

Read more about Carbon DeFi limit orders
.
Read more about Carbon DeFi and MEV