![Page cover image](https://docs.native.org/~gitbook/image?url=https%3A%2F%2F2236132028-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fta4g2TwHaleDMaDKVgwR%252Fuploads%252FmkSYT86pS5gOTD38fZzb%252FRectangle%25205.png%3Falt%3Dmedia%26token%3D91d208b1-0014-4db0-ac38-8396709365d7&width=1248&dpr=4&quality=100&sign=487cefc0&sv=1)
Credit Margin Engine
Transforming DeFi from inventory-based to credit-based trading
Credit Margin Engine (CME) forms the backbone of Native's architecture. It is a smart contract that consists of four main components:
![](https://docs.native.org/~gitbook/image?url=https%3A%2F%2F2236132028-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fta4g2TwHaleDMaDKVgwR%252Fuploads%252FBdYgsqAxOK0PhbyuXKVq%252FCredit%2520pools%2520%281%29.png%3Falt%3Dmedia%26token%3Dc6127e53-cadc-4756-bda3-c593ef735b5d&width=768&dpr=4&quality=100&sign=a0735bef&sv=1)
Liquidity pool: A pool where LPs deposit capital on each chain, functioning similar to a lending platform like Aave.
Credit component: A system that tracks each PMM's available credit based on their collateral, and records their long and short positions during live trading on each chain.
Settlement layer: A mechanism that ensures PMMs can pay off their long positions (assets pledged as collateral) as long as they return their short positions (assets borrowed for trades), along with any accrued credit financing fees.
Liquidation component: A process similar to Compound Finance, where PMM collateral and long positions are auctioned off to repay their short positions if they fail to meet their obligations.
A simple example to illustrate CME in action:
Josh, a retail trader, requests to swap 1 ETH for USDC through a Native-powered aggregator/solver. PMM1, a trading house, has pledged 100 USDC as collateral, securing a $100 credit from Native.
T0: Josh submits a Request for Quote (RFQ) through the aggregator.
T1: Native receives the RFQ and prompts PMM1 to respond.
T2: PMM1 responds with quote of 2600 USDC, even though it doesn't hold any USDC in its wallet, leveraging its $100 credit.
T3: Josh approves the transaction to swap 1 ETH for 2600 USDC.
T4: Native Credit pays Josh 2600 USDC, receives 1 ETH, and records a long 1 ETH and short 2600 USDC position on PMM1's credit record — all in a single transaction. Transaction is complete.
Following this trade, as long as the price of ETH doesn't drop below $2500, PMM1's $100 credit will be sufficient to cover its position. If the price falls below that threshold, the 100 USDC collateral plus 1 ETH would be subject to liquidation.
& btw, we've unlocked true chain abstraction 🔥
Notice how in the example above, it doesn't matter which chain Josh's request is made on, where PMM1 provides the quote, or where Native Credit Pool operates?
Thanks to our Credit Margin Engine, this entire swap has achieved true chain-abstraction.
The Native V1 source code is protected under a Business Source License (BSL), which strictly prohibits its use in any commercial or production setting until December 31st, 2026. This safeguards our innovation and deters premature exploitation for competitive gain.
Last updated