Trevee Clear Integration
Author
[Beg1 (Trevee, Data Analyst), Figue (Trevee, co-founder), Mason Lok (Trevee, Developer)]
Contact: romain @ mithras . xyz
Simple Summary
Clear protocol is a stablecoin focused liquidity source, formally providing better rates for depegged stablecoin swaps by emitting IOUs corresponding to the delta between market price and target 1:1 rate, enabling traders to sell it at market price, without slippage, as well as earning a bonus in IOUs, ultimately offering a premium vs any other amm or oracle feed.
Motivation
What unique value does your liquidity source bring?
In alignment with cowswap Surplus mechanism, Clear offers price improvement on quoted liquidity sources by quantifying the target rate deviation on stablecoin swaps and adding it to the trade in the form of IOUs.
Clear provides a unique peg protection mechanism, absorbing selling pressure during high volatility events, and maintaining upside of peg recovery. It also offers 0 slippage swaps and mitigates price impact on large size trades.
How will it improve settlement quality?
These IOUs can be zap swapped atomically in the trade through a IOU/TargetToken pool to top up the initial quote, thus effectively settling the swap at a better rate than other routes (given it’s gas efficient at the time of the swap).
When a trader’s swap zap the IOUs emitted into the Target Token it ultimately adds a premium on the base quote solved, when the IOU/TargetToken pool is imbalanced by IOUs zap selling pressure, the protocol or external arbitrageurs can step in and buy IOUs from the pool to redeem it for their underlying in Clear protocol reserve as the stablecoin peg recover (either on the market or through native redemptions e.g GSM for GHO) thus realizing the part of upside the trader forfeited when zap swapping it.
What trading pairs/assets are supported?
In V0 Clear will process swap only with USDC token out i.e GHO → USDC ; USDT → USDC ; DAI → USDC, …etc and will iterate to transact more and more stablecoins in the coming weeks.
Current trading volumes and liquidity depth
Clear can be tested on Arbitrum Sepolia, and is now live on Ethereum Mainnet.
At launch, Clear will run with private LPs and TVL caps (starting with $50k, gradually increasing to $10M over next months), it is projected to be able to process volume according to simulations available on Clear Simulator (Vercel).
Technical Specification
Price Discovery
Two methods available:
-
On-chain (recommended): Call
ClearSwap.previewSwap(vault, tokenIn, tokenOut, amountIn)- Returns
(amountOut, ious)- the expected output amount and IOUs generated - Fully deterministic, no off-chain dependencies
- Returns
-
API: GraphQL endpoint for vault discovery (endpoints available on request)
- Query available vaults and their supported tokens
Response format (previewSwap):
amountOut: uint256 // Tokens received
ious: uint256 // IOUs generated (bonus)
Rate limits: No rate limits on RPC calls. GraphQL API: standard rate limiting.
Settlement Interface
Smart contract addresses:
Ethereum Mainnet:
- ClearSwap (proxy):
0xC12247E25bf2ec1a1d43eFa7b5f9e6b579B32F40 - ClearOracle (proxy):
0xA84933DEE05514258E4C2b54468389539567634F - ClearFactory:
0xcEAc924839ba0ef49613d8FF10609434939bEb5b - AccessManager:
0x42d3E0D351cD3E8aE25b1632611d4411E8d801D9
Arbitrum Sepolia (testnet):
- ClearSwap (proxy):
0x799E139f31CE15760A73B22f2DA7f3e402037EaE - ClearOracle (proxy):
0x5a1703857B441b205d1f2071766788F86889271f - ClearFactory:
0xd4CE4e5dd7F855A6D02510f7477EF439948338B1 - AccessManager:
0x3Be1099f5DBC321A537fC57197a351193DaF0b5B
Function signature:
function swap(
address receiver, // Recipient of output tokens
address vault, // Clear vault address
address tokenIn, // Input token
address tokenOut, // Output token
uint256 amountIn, // Amount to swap
uint256 minAmountOut, // Slippage protection
bool receiveIOU // false = receive tokens only, true = also receive IOUs
) external returns (uint256 amountOut, uint256 ious);
Gas cost estimate: ~150,000 gas per swap
Example flow:
- Query vault via GraphQL or known vault address
- Call
previewSwap()to get quote - Execute
swap()withreceiveIOU = falsefor standard settlement
Integration Incentives
Are you offering integration grants?
No
Additional Information
Security audits: None for now
Known limitations: -
Future roadmap:
- Stablecoin integrations: USDS, USDe, crvUSD, …
- Chains expansion: Arbitrum, Base, …
- Routes variety: New assets pairs
- Fee-switch and LP incentives: IOUs fee sharing
Testing environment details: Arbitrum Sepolia
Contact Information
- Development team contacts: romain @ mithras . xyz / @Figu3
- Technical support channels: Discord & Telegram available on request
- Response time expectations: 1-2h