Pinned Tweet
The Evolution of DeFi Oracles: From TWAP to RWAP and RVOL medium.com/p/the-evolution-o…
Interesting section from the docs. If you're interested in how these work, I created an explainer article with examples. Link below 👇
Flying Tulip’s multi-year roadmap is now live.
It outlines the evolution of our ecosystem, from trading infrastructure to stablecoin architecture, unified collateral, and beyond.
Each milestone represents deliberate, audited progress toward a safer and more secure DeFi foundation.
Explore the full roadmap: docs.flyingtulip.com/roadmap
1
1
230
The Evolution of DeFi Oracles: From TWAP to RWAP and RVOL medium.com/p/the-evolution-o…
4
84
"If someone I knew to be both a domain expert and a reasonable person proposed an idea that sounded preposterous, I’d be very reluctant to say 'that will never work.'... If the person proposing the idea is reasonable, then they know how implausible it sounds. And yet they’re proposing it anyway. That suggests they know something you don’t." - Paul Graham
This quoted post is unavailable.
Sniff, sniff... yep, smells different this time
Can't wait to see what has been cooked up ⏳
A frequent, and fair, criticism of my work is; "he abandons everything he builds", so why should @flyingtulip_ be different? In 2020-2021 I was obsessed with decentralization and immutability, the only true roadmap for that was Satoshi. The only way to let a protocol truly decentralize is for the founder to not be the visionary and to walk away. I achieved this by putting myself in a position I could walk away. No token allocation for myself. No money raised for the project. No built in fees or benefit for myself. No licenses, all given away for free.
With FT, I am raising, I have founder and team tokens, they are vested behind buybacks. I am not optimizing for decentralization, I am optimizing for building a killer product.
So many new unique crypto projects, all under one umbrella. What I previously built was entirely without personal incentives, imagine what I can do incentivized.
Thank you for coming to my Ted talk.
1
605
If you want some insight into why these new oracle types are a game-changer, reminder to check this piece out:
xitter.cf/SeaSaltyFunk/status/19…
Flyingtulip innovations;
- Adaptive curve AMM
- rVOL, IV, TWAP, & RWAP oracles
- Dynamic & vol adjusted LTV money markets
- 1kx leverage
- Perps & options on all LP
- Insurance
- Onchain, no gas, no wallets, no KYC
42% better quotes
9x higher LP returns
85% capital efficiency
1
1
342
If that piece is too technical or complex, here's the simple explainer:
xitter.cf/SeaSaltyFunk/status/19…
Replying to @SeaSaltyFunk
If the complex math and code examples are too much, check out the simplified companion piece that explains these concepts in more accessible terms:
seasaltyfunk.medium.com/the-…
1
217
Finally, defi doesn't suck! 🌷
It's about fucking time someone built a defi solution that doesn't make you want to throw your laptop out the window.
After months of silence, we suddenly got some big news from @flyingtulip_: they're raising capital, building out a full team, and just dropped a website update revealing more new features including their own protocol-native USD stablecoin (ftUSD)
What's actually exciting here is that Flying Tulip's plans tackle basically every criticism you can throw at defi, Andre, or user onboarding—then goes beyond fixing problems to actually innovating.
Shit UX? Fixed.
Gas fee roulette? Gone.
Andre abandoning projects? Full team structure.
defi fragmentation? Unified platform.
New user barriers? Subsidized onboarding.
Add on top some genuinely new innovations like volatility-aware curves and impact-based lending that work together as one cohesive system instead of random features bolted together. It's like someone actually sat down and made a list of everything that sucks about defi and decided to fix all of it at once.
Let me take you by the hand anon, and show you why now’s the first time in years you should let yourself get excited.
Why the capital raise is bullish AF
If you want to take on CEXs like Binance (billions in revenue) or compete with the big boys of defi already powered by VC lucre (Ethena, Uniswap, Curve, etc.), you can't just be some anon in a hoodie hunched over a laptop at 3AM trying to implement John C. Hull's derivatives textbook in Solidity while simultaneously moderating Discord trolls and answering "wen token?" messages in the Telegram group.
Flying Tulip raising capital shows they're serious about competing at the big leagues level.
This money goes toward:
➡️ Marketing that actually works: Getting normies to try defi without needing a computer science degree
➡️ Building a proper team: Developers, auditors, community managers—the works
➡️User acquisition: Competing with CEX marketing budgets requires real capital
For investors? You're getting exposure to a protocol that could capture massive market share from both CEXs and fragmented defi, plus tap into new users taking their first steps into defi through an easier onboarding path.
For users? You get one of defi's best innovators (@AndreCronjeTech) backed by a full platform that's way more than some homebrew solution—complete with proper UX tools, customer support, comprehensive docs, and all the infrastructure that makes protocols actually usable. Anyone who's tried to navigate defi knows how rare that shit is.
Andre's back: this time it's a different beast
Yeah, we know the concerns. Andre Cronje has a reputation for launching projects and moving on. But look closer—this isn't another solo Andre experiment. Flying Tulip is building a full team around the project, which is exactly what needed to happen.
The do-it-all-yourself approach leads to burnout and abandoned projects. This time, Andre isn't carrying everything on his shoulders alone. There's proper team structure, dedicated funding, and institutional backing. It looks different, smells different, and will taste different because it IS different—this is being setup to be a properly resourced company.
For context: Andre is basically the defi OG who pioneered half the shit we use today. Rehypothecated pools, yield strategy vaults, decentralized keepers, atomic swaps, uniquote for on-chain oracle storage, options liquidity mining, ve33 tokenomics, TWAP/TWAR oracles—thought leader, or at least partner, behind most first-of-their-kind defi innovations. Hell, he even reinvented developer incentive structures on @SonicLabs . Now, they’ve taken that same level of “think-differently” approach to raising VC funds (so help us god!)
Shhh, anon, it's okay to admit you're an Andre fanboy too.
The fact that serious capital is being raised with a real team structure tells you everything about how seriously this is being taken. This setup lets Andre focus on what he does best—thinking up cool shit and coding it—while a dedicated team can handle everything else. Plus, it's clear this isn't some experiment-in-prod-with-a-new-primitive approach—this is an idea that's been thought through, allowed to stew, planned meticulously, and is now on the verge of launch. There's actual skin in the game from multiple stakeholders.
UX for defi in current state is absolute shit
If you're an experienced anon, you know the pain. Want to provide liquidity? Cool, pick between trading fees (Uniswap), lending yield (Aave), or perp fees (GMX). Want all three? Congratulations, you now need to manage positions across three different protocols, bridge between chains, and pray to the gas gods that your transactions don't cost more than your potential profits.
Anon, we know you've experienced the pain of explaining to your non-native friends how to use defi.
"Hey friend, want to try defi? First, buy ETH on Coinbase, send to your on-chain wallet, approve six different tokens, understand impermanent loss, calculate optimal ranges, monitor health factors, and oh—hope Ethereum gas doesn't randomly spike to $200 per transaction."
Erm, wut?
By the middle point of the 2020s don't you deserve better anon? Why can't you just earn more without doing more? Is that too much to ask for? Flying Tulip doesn't think so...
Why self-custody beats trusting randos with your money
Alright anon, we get it. You've given up on the bullshit fragmentation of defi and settled for the simpler life of fucking around on CEXs. Binance has slick UX, fast execution, no gas fees to think about. So what if some defi maxis keep screeching about self-custody? You think you've heard all the arguments already.
But let's take a deep breath and recap why that's still a terrible idea, shall we?
When you keep funds on a CEX, you're not holding crypto - you're holding an IOU from some company that promises they have your Bitcoin somewhere. Your "1 BTC" is actually just a database entry that says "anon123 owns 1 BTC." If the exchange decides to exit scam, gets hacked, faces regulatory pressure, or runs afoul of local legislation and loses its license to operate, your database entry becomes worth exactly zero dollars.
"Not your keys, not your crypto" isn't just a meme - it's a warning written in the blood of Mt. Gox users (850,000 BTC gone), FTX users ($8B in user funds vanished), and all the users of all the other exchanges that went belly-up. When Sam Bankman-Fried was using customer deposits as his personal piggy bank, users learned the hard way that "trust us, bro" isn't a viable custody solution.
With a private wallet, your funds are controlled by cryptographic keys that only you possess - unless you're an idiot and post your seed phrase on X or fall for some "customer support" DM asking for your private keys. Assuming you have two brain cells to rub together, no CEO can lend your money to their hedge fund, no "hack" can drain your account, and no government can freeze your assets because they don't like your politics. Your crypto is mathematically yours.
Yeah, yeah, we get it - CEXs are so convenient. But what if you could have that convenience AND actually own your money AND earn way more than you do now?
Flying Tulip is suggesting it'll offer more fun, more opportunity, and better security than any CEX. There's really no excuse left for trusting some rando with your hard-earned money when you could be making it work harder than you do.
Don't work like a bitch, let your funds do the work instead (earning from multiple revenue streams simultaneously)
Want to drop $10,000 USD worth of funds for yield? In current defi setups, you pick your poison and miss out on everything else. Flying Tulip is designed to let your position simultaneously:
➡️ Earn AMM trading fees (0.02% vs Uniswap's 0.3%)
➡️ Collect lending interest when traders borrow against positions
➡️ Receive options premiums from integrated derivatives
➡️ Get liquidation bonuses when overleveraged positions get rekt
➡️Benefit from volatility-aware curve optimization (the AMM automatically adjusts to market conditions, giving you better execution and protecting against getting arbitraged)
Imagine you deposited your funds into the ftUSD / $WS (Wrapped Sonic) liquidity pool. When someone uses their own tokens for collateral to borrow some of your ftUSD for leverage, they're paying you fees, borrowing your assets, and potentially getting liquidated (more money for you). It's beautiful 😍
Flying Tulip is planning to make this accessible to everyone. Building on Sonic means subsidized transactions and direct on-ramping. New users don't need to understand gas concepts, bridge between chains, or navigate the defi maze. You can literally go from fiat to earning yield in Flying Tulip without ever thinking about transaction fees or cross-chain bullshit.
For experienced anons, it's unified liquidity paradise. Remember wanting to LP, trade perps, lend, AND earn from liquidations? Flying Tulip will allow you to do all of this from one position.
For newcomers, it's the easiest onramp to earning actual yield without the usual defi learning curve from hell.
Smart LPing that adapts instead of getting rekt
Using current AMMs requires too much work for you anon, your liquidity is acting like a zombie and it wants your brains to make it work - you have to constantly monitor and shepherd it, either moving it to new pools, topping up liquidity pairs to be better balanced, or worse yet actively managing concentrated liquidity ranges on Uni v3 like some ADHD-medicated degenerate day trader glued to their 15 monitors at 3 AM.
Uniswap's x*y=k formula distributes liquidity uniformly across a wide price range to secure infinite liquidity, but treats a 2% move the same as a 20% crash. Curve's stable formula works well for stablecoins, but you have to use a separate pool type and formula for volatile assets, and both require governance votes to change the rules that dictate how the pools work, which is too slow to react to market demands. The Gyroscope dynamic CLPs are new and cool but still guide the "zombie" back to range when it's drifted out of bounds. Plus all this depth of liquidity often means you're over-provisioning compared to actual swap volumes - basically throwing money at a problem and hoping it sticks.
Flying Tulip's planned AMM will improve upon the ideas in Curve to have concentrated liquidity that dynamically adjusts to concentrate around recent asset price ranges, adapting in close to real-time using EWMA volatility tracking:
➡️Calm markets: Curve flattens (minimal slippage, like Curve's stable-swap)
➡️Volatile markets: Curve steepens (toxicity protection, like Uniswap)
Practically: swap 2,000 ftUSD → $WS during low vol, get up to 42% better execution than traditional AMMs according to Flying Tulip's testing. Markets go crazy? The curve automatically protects LPs from getting arbitraged to death. Even better - you can relax because the zombie liquidity is being shepherded for you while simultaneously milking it for all it's worth through multiple liquidity utilization streams. Too much liquidity and not enough swap volume in a pool, no sweat, it’s probably being borrowed to earn more fees.
Impact-based lending: risk management that isn't theoretical bullshit
Aave: "ETH has 75% LTV because... reasons?"
Flying Tulip: "Your LTV is 1 - (actual slippage cost) - (volatility buffer)"
Want to borrow 7,500 ftUSD against your $10,000 value $WS position? Flying Tulip is designed to:
1⃣Simulates liquidating your exact position size
2⃣Calculates real slippage based on current market depth
3⃣Adds volatility buffer for current market conditions
4⃣Sets your max borrow limit accordingly
Deep liquidity + calm markets = 85% LTV. Thin books + volatile conditions = 60% LTV. The math adapts to reality instead of pretending infinite liquidity exists.
Leverage without getting rekt (and without losing sleep)
Traditional leverage = hard liquidation thresholds = getting absolutely destroyed by wick downs. Aave users loop stETH for leverage and pray they don't get liquidated at 2 AM by a flash crash.
f(x) Protocol pioneered a different approach with their xETH tokens offering up to 7x leverage through automatic rebalancing instead of liquidations—but it's still a fixed maximum that doesn't adapt to market conditions.
Flying Tulip takes this concept further with dynamic LTV ratios that automatically adjust based on real market conditions. Instead of offering "7x leverage," Flying Tulip gives you smart borrowing limits that change with the market:
➡️Stable markets + deep liquidity: Borrow up to 80% of your collateral value (5x effective leverage)
➡️Volatile conditions: Automatically drops to 50% LTV (2x leverage)
➡️Thin liquidity for your position size: Further reduced to 45% LTV (1.8x leverage)
Say you deposit $10,000 worth of $WS as collateral. In calm markets, you can borrow 8,000 ftUSD against it. Markets start getting spicy? The protocol automatically reduces your borrowing limit to $5,000 before you even think about it. No more 3 AM liquidation anxiety—the system manages risk for you.
The beauty is you get maximum leverage when it's actually safe, and automatic protection when it's not. f(x) Protocol gives you consistent 7x leverage regardless of market conditions. Flying Tulip lets you sleep safe at 3am like a normal person, anon. Wouldn't that be nice?
On-chain perps that actually compete with CEXs
Alright anon, we know you want to play with perps on-chain like every other degenerate leverage trader, farming skew wins and losses like a caffeinated hamster on a wheel that's somehow connected to a withdrawal account so that you can buy more shit you don't need from Amazon or fund your OnlyFans addiction. You've probably been grinding on Hyperliquid or dreaming about it while stuck on some dirty-ho -in-an-upmarket-dress of a CEX.
Hyperliquid built their own performant L1 specifically for order book perpetuals with one-block finality. It's impressive, but it's still the traditional approach - separate order books, isolated liquidity, and you're playing in their specific sandbox.
Flying Tulip says "fuck that" and plans to build something completely different. Instead of choosing between AMM or order book liquidity, they built a hybrid AMM + CLOB system where both work together. Your perp positions settle against opt-in LPs and the integrated trading infrastructure, which means deeper liquidity and tighter spreads.
Flying Tulip's perps are backed by delta-neutral strategies. The entire liquidity model runs on a synthetic delta-neutral pool powered by staking yield. This isn't just throwing your money into a perp and hoping for the best - it's a system designed to generate yield while maintaining price exposure.
Plus, they avoid the external oracle dependency bullshit that plagues other platforms. Markets settle directly against the AMM/CLOB hybrid, enabling permissionless asset pairs without waiting for some external dogshit oracle to wake up and figure out what price an asset should be.
Same unified liquidity serves your spot swaps, perp trades, lending positions, and leverage plays simultaneously. Try explaining that level of capital efficiency to your Hyperliquid maxi friends while they're stuck managing separate positions across different systems.
ftUSD: a stablecoin that isn't held together with hopes and prayers
Look, every serious DEX eventually realizes the same thing: relying on other people's stablecoins means leaving money on the table. Curve figured this out when they launched crvUSD and started funneling 100% of borrowing fees and interest directly to CRV holders instead of enriching some money market fund that has fat pockets full of Circle and Tether's stables. Smart move—why let someone else capture the stablecoin revenue when your users are already trading billions in volume?
Flying Tulip plans to follow the same playbook with ftUSD. According to their docs, "tokenized delta-neutral LP positions produce a USD-equivalent asset"—meaning ftUSD represents claims on the actual yield-generating delta-neutral strategies happening across the platform. The delta-neutral part means the stablecoin isn't getting rekt by directional price movements; it's backed by the spread capture and yield from the platform's operations.
Here's the clever part: launching with a native stablecoin from day one means Flying Tulip can create deep ftUSD liquidity pools against every major asset. Want to trade ETH? There's an ftUSD/ETH pool. Need WS exposure? ftUSD/WS is there. This creates natural arbitrage opportunities that keep the peg tight—if ftUSD trades at $1.02, arbitrageurs buy other stables and sell ftUSD until it's back to $1.00. All that arbitrage volume generates fees for the protocol.
Compare this to Ethena's USDe: both use delta-neutral strategies, but USDe depends on external CEX funding rates that can go negative. Flying Tulip will keep everything on-chain—the delta-neutral backing comes from their own AMM operations, lending activity, and integrated trading infrastructure.
The result? A stablecoin that generates revenue for the protocol while serving as the base currency for their entire ecosystem. Plus, any peg maintenance activity generates trading fees that flow back to the platform instead of enriching external protocols.
Proper limit orders that work like they should
Anon, I see you—you're time-poor and just can't be fucked to screw around figuring out which on-chain protocol offers limit orders in some janky way that requires reading docs or watching tutorials just to understand basic shit. You expect your limit orders to just work. From the 1970s guys in suspenders screaming across trading pits, to the 1980s Gordon Gekko wannabes with their brick phones, through the 1990s day traders with multiple 4:3 ratio monitors, right up to Robinhood users following some 19-year-old's DD post on r/wallstreetbets drafted in the comfort of his mom's basement about the next GameStop-like sure bet to moon—everyone just hits "buy limit at $X" and moves on with their life. Why should you be any different?
Try explaining current defi limit orders to any of these people and watch their mind melt:
Native DEX attempts: The smart ones did the obvious thing and moved to app-chains where they could build proper order books without Ethereum's limitations. Makes sense, except now you're trading in yet another isolated ecosystem instead of using the liquidity where it actually lives. More of that fragmentation we love so much.
The aggregator workarounds: CoW Protocol batches your order with others in auctions every few seconds, but whether YOUR order gets filled depends on if their solvers can make a profit including it. Could be the next batch, could be never. 1inch has gasless limit orders but only for swapping into ETH (cool!) and only if you hold tokens that support permits like USDC or DAI (less cool) and it runs on off-chain infrastructure (definitely not cool).
The Uniswap v3 hack: Want a limit order? Just provide single-sided liquidity in a narrow range and hope someone trades against it! Explain to a tradfi trader why they need to become a liquidity provider to place a buy order and watch their eye twitch.
Meanwhile, that Robinhood user is still just hitting "buy limit" and going back to scrolling TikTok.
Flying Tulip will implement limit orders as narrow AMM ranges with TWAP triggers and ERC-1155 position tokens. Place a buy order, earn fees while it rests, get filled when price hits your target. Groundbreaking stuff: limit orders that actually limit things at the prices you want.
The unified router chooses between immediate AMM execution or resting limit orders based on price impact. Same liquidity pool serves spot traders, limit order users, and LPs simultaneously. No separate systems, no off-chain components, no explaining why limit orders require a computer science degree.
Better yet, you earn fees while your order sits there waiting to be filled—something you'll never get on Binance or any CEX. Finally, defi that doesn't just match centralized exchanges but actually improves on them.
The CEX killer thesis: this time it's actually real
Look anon, you know why you end up back on Binance even though you probably hate making CZ even richer with every trade you make. Everything just fucking works. One login, one interface, one pool of margin across spot, futures, options, lending. You're not juggling twelve different protocols, approving tokens six times, or explaining to your tax software why you have 47 transactions just to make one leveraged trade.
Current DeFi makes you feel like a digital nomad with commitment issues—hopping between Aave for lending, Uniswap for swaps, GMX for perps, and some random yield farm that definitely isn't a rug pull (narrator: it was). Each with its own UI, its own tokens to approve, its own way of wrecking you when gas spikes to $200.
Flying Tulip says "fuck that" and is building what DeFi should have been from day one. Everything unified, everything working together, everything earning you money instead of just bleeding it. Better fees than Binance (0.02% vs 0.1%), better yields than anything centralized, and your keys never leave your wallet.
The difference? While CEX shareholders extract billions from your trading fees, Flying Tulip's VC structure actually makes sense—50% community foundation, 50% investors with downside protection instead of pure extraction. The raised funds go directly into token buybacks, liquidity programs, and protocol growth instead of some billionaire's fourth yacht.
You'll be over here earning protocol revenue instead of subsidizing random shareholders' Lamborghini collections, trading on the platform that finally figured out how to make DeFi not suck.
About damn time someone built this shit right.
Lot of talk about VC funding, but if you want to know why @flyingtulip_ on @SonicLabs is interesting then take a look at how it will uniquely use new types of oracles to offer improvements on existing DEX designs then read below 👇🏻
xitter.cf/SeaSaltyFunk/status/19…
"The Evolution of DeFi Oracles: From TWAP to RWAP and RVOL" – an in-depth exploration of oracle mechanisms in DeFi.
Learn how these critical price feeds evolved to address manipulation resistance, capital efficiency, and volatility calculation – fundamental building blocks for all modern DeFi protocols and AMMs. 🧵👇
3
297
Dynamic pools should work really well for on-chain forex pairs too
Many will probably copy the general methodology of @GyroStable's Dynamic Pools once they see it work.
It’s designed to inherit the track record of static pools, which actually look very good if you look back at the data.
Here's a static pool today with no incentives:
"The Evolution of DeFi Oracles: From TWAP to RWAP and RVOL" – an in-depth exploration of oracle mechanisms in DeFi.
Learn how these critical price feeds evolved to address manipulation resistance, capital efficiency, and volatility calculation – fundamental building blocks for all modern DeFi protocols and AMMs. 🧵👇
TWAP (Time-Weighted Average Price) began with Uniswap V2, calculating average prices weighted by duration to resist manipulation.
Keep3rV1Oracle enhanced this with 30-minute observations stored in an external contract, while early Solidly code (BaseV1Core) integrated this storage directly into AMM pairs before transitioning to RWAP in BaseV1Factory pre-launch.
1
49
Buckle up! Strap in, and let's go DEEP!
Last time I showed how @flyingtulip_'s LTV model could theoretically enable flash swaps, flash debt, and leveraged spot trades. Now let's explore HOW their four oracle types combined with this LTV model could make these primitives possible on @SonicLabs...
For an in-depth exploration of the precursors of each of these oracle types, their evolution, and how they prove the viability of RWAP & RVOL, check out my post here:
xitter.cf/SeaSaltyFunk/status/19…
If the complicated math and code examples are too much, you can check out the simplified explainer: xitter.cf/SeaSaltyFunk/status/19…
THE COMBINED FOUNDATION: LTV MODEL + ORACLES
First, a quick recap of Flying Tulip's innovative LTV model
The core formula combines volatility risk and market depth:
LTVmax(ΔX) = (1-δ)/(1+ΔX/X)
Where:
- (1-δ) creates a volatility buffer against price drops
- 1/(1+ΔX/X) accounts for liquidation price impact
- LTVmax is further adjusted by utilization: LTVallowed = LTVmax × (1-UB)
This beautiful formula ensures loans remain safe by:
1️⃣ Reducing LTV as volatility increases
2️⃣ Reducing LTV as position size grows relative to pool depth
3️⃣ Reducing LTV as utilization of borrowable assets rises
But here's the critical insight: This LTV model is only as good as the data that feeds it. That's where Flying Tulip's four oracle types become essential, creating a powerful synergy that could enable further sophisticated DeFi primitives.
THE ORACLE STACK
Flying Tulip integrates FOUR oracle types that, when combined with the LTV model, could create a manipulation-resistant foundation:
1️⃣ TWAP (Time-Weighted Average Price)
- Basic oracle calculating average price over time
- Feeds baseline price data to the LTV model
- Vulnerable alone, but forms the foundation layer
2️⃣ RWAP (Reserve-Weighted Average Price)
- Weights prices by actual capital commitment (reserves)
- Provides manipulation-resistant pricing to the LTV formula
- Makes the (1-δ) factor in the LTV model truly reliable
3️⃣ RVOL (Realized Volatility)
- Calculates historical volatility for accurate δ values
- Directly impacts the volatility buffer in the LTV formula
- Makes the (1-δ) component responsive to market conditions
4️⃣ IV (Implied Volatility)
- Provides forward-looking volatility for predictive δ values
- Complements RVOL to create a comprehensive risk assessment
- Further refines the volatility buffer in the LTV model
Together, these oracles don't just provide data – they provide precisely the right inputs needed for each component of the LTV formula, creating a symbiotic relationship that could enable sophisticated primitives.
FLASH SWAPS: ENABLED BY ORACLE-ENHANCED LTV
Flash swaps become possible when the LTV model knows exactly how much can be safely borrowed. The critical formula:
LTVmax(ΔX) = (1-δ)/(1+ΔX/X)
How the oracle integration enables this primitive:
- RWAP provides manipulation-resistant price data for the base calculation
- RVOL feeds historical volatility into the δ parameter
- IV adds forward-looking volatility expectations to δ
- Together they create a comprehensive δ = max(RVOL, IV)
- This precise δ value makes the volatility buffer (1-δ) accurately reflect risk
- The combined oracle + LTV system can then calculate exact safe borrowing limits
This integration could make flash swaps uniquely secure – using both backward and forward-looking volatility data to adjust borrowing limits based on real market conditions dynamically.
Cool! So how does it work? Let's take a look at a detailed example...
FLASH SWAP EXAMPLE: ETH/USDC ARBITRAGE
Why would someone use flash swaps? Imagine you're a DeFi trader who spots a price difference between Flying Tulip and another DEX. You know there's a profit opportunity, but you don't have the capital to execute the trade. Flash swaps solve this by allowing you to borrow the capital, capture the arbitrage, and return the funds in a single transaction – all without needing any upfront capital of your own. This democratizes arbitrage opportunities that would otherwise be limited to those with significant capital reserves.
In a theoretical ETH arbitrage scenario, the oracles and LTV model work together:
- RWAP provides the reliable $4,000 price point
- RVOL contributes the 15% historical volatility measure
- IV offers the 18% forward-looking volatility expectation
- The LTV model combines these into δ = max(15%, 18%) = 18%
- This feeds into the formula: LTVmax = (1-0.18)/(1+0.1) ≈ 0.75
- The utilization adjustment further refines this to 0.52
- Result: 52 ETH maximum flash swap
Without any one of these oracle components, the calculation would be less accurate and potentially unsafe.
FLASH DEBT: THE ORACLE-LTV SYNERGY
Flash debt's viability stems from the same unified system. The formula:
LTVallowed = [(1-δ)/(1+ΔB/Y)] × (1-UB)
How the oracle-LTV integration enables this primitive:
- RWAP provides reliable price data that isn't manipulable during the flash transaction
- RVOL determines precise historical volatility for different asset types
- IV anticipates potential market shifts during the transaction period
- This comprehensive δ calculation allows for asset-specific risk assessment
- The LTV model then calculates precise borrowing limits that remain safe
The synergy creates a system where flash debt becomes viable because the protocol can accurately assess risk even in the context of uncollateralized, single-transaction borrowing.
Let's take a walk through an example of flash debt use...
FLASH DEBT EXAMPLE: NFT PURCHASE
Why would someone use flash debt for an NFT purchase? Imagine you're a trader who strongly believes ETH is undervalued and will appreciate significantly. You discover a rare NFT that's underpriced at 20 ETH, but selling your ETH now means missing out on its future upside. Flash debt solves this dilemma by allowing you to acquire the NFT without selling your appreciated ETH position.
In a theoretical NFT purchase scenario, the oracles and LTV model work in concert:
- RWAP provides the reliable $4,000 per ETH valuation
- RVOL contributes the 0.5% historical stablecoin volatility
- IV offers the 0.8% forward-looking stablecoin volatility
- The LTV model combines these into δ = max(0.5%, 0.8%) = 0.8%
- Relative debt size calculation: ΔB/Y = 80,000/400,000 = 0.2
- This feeds into the formula: [(1-0.008)/(1+0.2)] × (1-0.4)
- Resulting in: 0.992 × 0.83 × 0.6 ≈ 0.49
- Maximum flash debt: 0.49 × 400,000 USDC = 196,000 USDC
The lower volatility of stablecoins (detected accurately by the oracles) allows for higher borrowing limits, while still accounting for utilization and market depth. Without this precise oracle data, the protocol would either be too restrictive or too risky.
LEVERAGED SPOT TRADES: PRECISION THROUGH INTEGRATION
Leveraged trading requires exceptional precision in risk assessment. The formula:
- Max Leverage = 1 + LTVallowed
- LTVallowed = [(1-δ)/(1+ΔX/X)] × (1-UB)
How the integrated system enables this primitive:
- RWAP provides manipulation-resistant valuation for positions
- RVOL calculates accurate historical volatility for the asset
- IV incorporates market expectations about future price movements
- Together they create a δ value that precisely reflects current market risk
- The LTV model uses this to determine safe leverage limits dynamically
- This creates position-specific, market-aware leverage caps
Without this oracle + LTV integration, leverage would either be too conservative (limiting capital efficiency) or too aggressive (creating systemic risk).
So... how and why would anyone use leveraged trading? Detailed example below
LEVERAGED TRADING EXAMPLE: ETH POSITION
Why would someone use leveraged spot trading? Imagine you've been following ETH closely and believe it's currently undervalued after a recent drop. You want to maximize your exposure to capture the upside, but you have limited capital. Leveraged spot trading allows you to amplify your position while maintaining a safe risk profile based on actual market conditions. Unlike perpetual futures that require funding payments, this leveraged spot position lets you hold the actual asset with no time limit, making it ideal for medium to long-term directional bets.
In a theoretical leveraged ETH position, the oracles and LTV model demonstrate their synergy:
- RWAP provides the reliable $4,000 per ETH valuation
- RVOL contributes the 25% historical volatility (elevated after recent price drop)
- IV offers the 28% forward-looking volatility (market expects continued turbulence)
- The LTV model combines these into δ = max(25%, 28%) = 28%
- Relative position size: ΔX/X = 5/100 = 0.05
- These feed into the formula: [(1-0.28)/(1+0.05)] × (1-0.3)
- Resulting in: 0.72 × 0.95 × 0.7 ≈ 0.48
- Maximum leverage: 1 + 0.48 = 1.48x
Notice how the higher volatility (detected by the oracles) significantly restricts leverage compared to the stablecoin example. This adaptive behavior, powered by precise oracle data feeding into the LTV model, creates a system that automatically adjusts risk parameters based on actual market conditions.
THE POTENTIAL ECOSYSTEM SHIFT
The true innovation here isn't just each oracle type or the LTV model individually – it's their integration into a unified system. While we don't know if Flying Tulip will implement all these primitives (though @AndreCronjeTech has hinted at them), the mathematics clearly shows they're possible through this combined approach.
DeFi development teams should take note – this integrated oracle-enhanced LTV model could shift what's possible dramatically. Instead of building separate protocols for different primitives, a single mathematically sophisticated foundation could support multiple financial functions.
On Sonic, this system becomes even more viable:
- 400,000 TPS with sub-second finality would enable rapid liquidations
- Fee Monetization (90% to developers) would make sophisticated oracle implementations economically feasible
- $0.01 target gas costs would make complex operations viable
This is exactly what we've been waiting for – not more forks or rehashed AMMs, but truly innovative financial primitives built on sophisticated mathematical foundations with reliable oracle data.
As teams catch onto this approach, we could see entirely new primitives emerge. Maybe we'll finally move beyond the endless forks that have dominated DeFi and get back to the exciting innovation that made DeFi revolutionary in the first place.
TL;DR:
Flying Tulip's genius lies in how its four oracle types (TWAP, RWAP, RVOL, IV) work together WITH its LTV model to potentially enable sophisticated primitives.
The oracles provide precisely the data each component of the LTV formula needs, creating a symbiotic relationship that could support flash swaps, flash debt, and leveraged trading – all from a unified mathematical foundation.
While not confirmed features, @AndreCronjeTech has hinted at these possibilities, potentially marking a shift from endless forks to innovative DeFi primitives that make on-chain finance exciting again 🥳🎉😍
It might be all that and then some...
Andre also once said:
"Quite a few primitives left to integrate there that I never launched; flash swaps, flash debt, leveraged spot trades, OI funding. So much you can do with a lender."
🧐 seems like @flyingtulip_ LTV model enables at least three of these primitives
Let me show you how this math creates an entire DeFi ecosystem...
The genius is in the formulas. By precisely calculating:
- Price impact during liquidation: Impact = ΔX/(X+ΔX)
- Volatility haircuts: LTV_base = 1-δ
- Combined safe limits: LTV_max = (1-δ)/(1+ΔX/X)
- Utilization adjustments: LTV_allowed = LTV_max*(1-U_b)
Flying Tulip can support the primitives @AndreCronjeTech mentioned without building separate protocols.
One model. Multiple primitives. Massive capital efficiency. All on @SonicLabs
HOW THE LTV MODEL PROVIDES TOOLS FOR EACH PRIMATIVE
Flash Swaps
The LTV model provides the essential building blocks for flash swaps through its precise AMM mechanics calculations. The formula:
B_out = YΔX/(X+ΔX)
Shows exactly how much of asset B will be received when selling ΔX of asset A, accounting for slippage. This precision is critical for flash swaps because:
1️⃣ Pool Mechanics: The model understands exactly how much value can be extracted from and returned to the pool
2️⃣ Risk Assessment: Price impact (ΔX/(X+ΔX)) calculations ensure the protocol knows the true cost of liquidity provision
3️⃣ Volatility Integration: The δ factor ensures flash swaps can account for potential price movements during execution
The model can calculate the exact impact for different trade sizes relative to pool depth, giving precise control over flash swap parameters. When ΔX/X is small, price impact is minimal, but as trade size increases relative to pool size, the model precisely accounts for increasing slippage.
Flash Debt
The volatility component of the LTV model provides the foundation for flash debt through:
1️⃣ Volatility Haircuts: By defining δ as the "worst case drop in price," the model can calculate exactly how much can be borrowed safely
2️⃣ Collateral Valuation: The formula Loan ≤ (1-δ) × Collateral Value provides the exact limit for safe debt
3️⃣ Dynamic Adjustment: As volatility increases, the model automatically reduces LTV
For example, a low-volatility asset with δ=10% might allow 90% base LTV, while a highly volatile asset with δ=30% would only permit 70% LTV. This lets Flying Tulip calculate how much can be borrowed in a flash debt scenario, knowing precisely the liquidation outcomes if the loan isn't repaid.
Leveraged Spot Trades
The combined formulas create the framework for leveraged trading:
1️⃣ Position Sizing: The LTV_slip = 1/(1+ΔX/X) formula adjusts leverage limits based on position size relative to pool depth
2️⃣ Combined Risk Management: LTV_max(ΔX) = (1-δ)/(1+ΔX/X) accounts for both volatility and market depth
3️⃣ Utilization Awareness: The model further adjusts for current pool utilization
This creates a dynamic leverage system that can automatically adjust leverage limits based on:
- Position size relative to pool depth
- Asset volatility
- Current pool utilization
Small positions in low-volatility assets with low utilization receive higher LTV, while large positions in volatile assets during high utilization receive much lower LTV. This ensures that leverage remains safe under all market conditions.
HOW THESE PRIMATIVES CAN BE USED?
Flash Swaps
- Arbitrage Without Capital: Profit from price differences between Flying Tulip and other markets without upfront funds
- Collateral Swapping: Instantly change collateral types without extra capital
- Complex Rebalancing: Restructure positions across multiple protocols in a single transaction
Flash Debt
- Leverage Restructuring: Adjust leverage without multiple transactions or additional capital
- Liquidation Protection: Quickly refinance positions that are close to liquidation
- Yield Strategy Transitions: Move between yield opportunities without idle funds
Leveraged Spot Trades
- Capital-Efficient Exposure: Get more exposure with limited capital
- Dynamic Leverage: Automatically adjusted based on market conditions
- Integrated Risk Management: Safer leverage that accounts for real-time volatility and liquidity
The brilliance of Flying Tulip's approach is that a single mathematical model can support all these primitives simultaneously without building separate protocols. The LTV model isn't just about calculating borrowing limits – it's a comprehensive framework that:
1⃣Understands AMM mechanics at a fundamental level
2⃣Precisely calculates liquidation outcomes
3⃣Dynamically adjusts to market conditions
4⃣Manages risk across multiple primitives simultaneously
It's not just a lending protocol – it's an integrated financial system where lending, trading, and liquidity provision all leverage the same underlying mathematics to work together seamlessly.
As Andre suggested, there's "so much you can do with a lender" when it's built on a mathematical foundation this sophisticated. The primitives aren't separate features but natural extensions of the core mathematics.
TL;DR: Flying Tulip's LTV model creates a unified mathematical foundation that naturally enables flash swaps, flash debt, leveraged trading – all from a single system instead of separate protocols. That's the magic.
It might be all that and then some...
Andre also once said:
"Quite a few primitives left to integrate there that I never launched; flash swaps, flash debt, leveraged spot trades, OI funding. So much you can do with a lender."
🧐 seems like @flyingtulip_ LTV model enables at least three of these primitives
Let me show you how this math creates an entire DeFi ecosystem...
The genius is in the formulas. By precisely calculating:
- Price impact during liquidation: Impact = ΔX/(X+ΔX)
- Volatility haircuts: LTV_base = 1-δ
- Combined safe limits: LTV_max = (1-δ)/(1+ΔX/X)
- Utilization adjustments: LTV_allowed = LTV_max*(1-U_b)
Flying Tulip can support the primitives @AndreCronjeTech mentioned without building separate protocols.
One model. Multiple primitives. Massive capital efficiency. All on @SonicLabs
HOW THE LTV MODEL PROVIDES TOOLS FOR EACH PRIMATIVE
Flash Swaps
The LTV model provides the essential building blocks for flash swaps through its precise AMM mechanics calculations. The formula:
B_out = YΔX/(X+ΔX)
Shows exactly how much of asset B will be received when selling ΔX of asset A, accounting for slippage. This precision is critical for flash swaps because:
1️⃣ Pool Mechanics: The model understands exactly how much value can be extracted from and returned to the pool
2️⃣ Risk Assessment: Price impact (ΔX/(X+ΔX)) calculations ensure the protocol knows the true cost of liquidity provision
3️⃣ Volatility Integration: The δ factor ensures flash swaps can account for potential price movements during execution
The model can calculate the exact impact for different trade sizes relative to pool depth, giving precise control over flash swap parameters. When ΔX/X is small, price impact is minimal, but as trade size increases relative to pool size, the model precisely accounts for increasing slippage.
Flash Debt
The volatility component of the LTV model provides the foundation for flash debt through:
1️⃣ Volatility Haircuts: By defining δ as the "worst case drop in price," the model can calculate exactly how much can be borrowed safely
2️⃣ Collateral Valuation: The formula Loan ≤ (1-δ) × Collateral Value provides the exact limit for safe debt
3️⃣ Dynamic Adjustment: As volatility increases, the model automatically reduces LTV
For example, a low-volatility asset with δ=10% might allow 90% base LTV, while a highly volatile asset with δ=30% would only permit 70% LTV. This lets Flying Tulip calculate how much can be borrowed in a flash debt scenario, knowing precisely the liquidation outcomes if the loan isn't repaid.
Leveraged Spot Trades
The combined formulas create the framework for leveraged trading:
1️⃣ Position Sizing: The LTV_slip = 1/(1+ΔX/X) formula adjusts leverage limits based on position size relative to pool depth
2️⃣ Combined Risk Management: LTV_max(ΔX) = (1-δ)/(1+ΔX/X) accounts for both volatility and market depth
3️⃣ Utilization Awareness: The model further adjusts for current pool utilization
This creates a dynamic leverage system that can automatically adjust leverage limits based on:
- Position size relative to pool depth
- Asset volatility
- Current pool utilization
Small positions in low-volatility assets with low utilization receive higher LTV, while large positions in volatile assets during high utilization receive much lower LTV. This ensures that leverage remains safe under all market conditions.
HOW THESE PRIMATIVES CAN BE USED?
Flash Swaps
- Arbitrage Without Capital: Profit from price differences between Flying Tulip and other markets without upfront funds
- Collateral Swapping: Instantly change collateral types without extra capital
- Complex Rebalancing: Restructure positions across multiple protocols in a single transaction
Flash Debt
- Leverage Restructuring: Adjust leverage without multiple transactions or additional capital
- Liquidation Protection: Quickly refinance positions that are close to liquidation
- Yield Strategy Transitions: Move between yield opportunities without idle funds
Leveraged Spot Trades
- Capital-Efficient Exposure: Get more exposure with limited capital
- Dynamic Leverage: Automatically adjusted based on market conditions
- Integrated Risk Management: Safer leverage that accounts for real-time volatility and liquidity
The brilliance of Flying Tulip's approach is that a single mathematical model can support all these primitives simultaneously without building separate protocols. The LTV model isn't just about calculating borrowing limits – it's a comprehensive framework that:
1⃣Understands AMM mechanics at a fundamental level
2⃣Precisely calculates liquidation outcomes
3⃣Dynamically adjusts to market conditions
4⃣Manages risk across multiple primitives simultaneously
It's not just a lending protocol – it's an integrated financial system where lending, trading, and liquidity provision all leverage the same underlying mathematics to work together seamlessly.
As Andre suggested, there's "so much you can do with a lender" when it's built on a mathematical foundation this sophisticated. The primitives aren't separate features but natural extensions of the core mathematics.
TL;DR: Flying Tulip's LTV model creates a unified mathematical foundation that naturally enables flash swaps, flash debt, leveraged trading – all from a single system instead of separate protocols. That's the magic.
Replying to @SiloIntern
💡 Wot mean
Mr. @AndreCronjeTech's Flying Tulip has an AMM-based LTV model that allows AMM liquidity to be duplicated for lending.
How would this look?
> Pool exists (let's say S-USDC)
> User deposits Token A (e.g. $S) to borrow Token B (e.g. $USDC)
TL;DR 1 LP for 2 actions
Struggled to follow along with the original piece? Don't sweat it!
I've got you covered with a more straightforward companion piece aimed at non-technical readers
seasaltyfunk.medium.com/the-…
1
168
Struggled to follow along with the original piece? Don't sweat it!
I've got you covered with a more straightforward companion piece aimed at non-technical readers
seasaltyfunk.medium.com/the-…
The Evolution of DeFi Oracles: From TWAP to RWAP and RVOL medium.com/p/the-evolution-o…
What does the adaptive curve proposed by @flyingtulip_ mean in simple terms?
For LPers this means you can add liquidity in concentrated liquidity positions that self-adjust based on the measurements of volatility over the historical price record, smoothed by EWMA (Exponentially Weighted Moving Averages)
As volatility is recorded, an adaptation of the volatility measure to map an adjustment in the exponent occurs, changing the shape of the curve, and thus, the concentration of liquidity
In straightforward terms:
* A flatter curve is more concentrated
* A more curved shape is less concentrated
For volatile asset pairs - the curve moves between the x+y=k (constant sum) and the x*y=k range (constant product). The blue line is the adaptive curve, the black line constant sum, green is constant product
Replying to @SeaSaltyFunk
THE ADAPTIVE CURVE AMM
The team at Flying Tulip already provided some details on how the Adaptive Curve AMM will work - flyingtulip.com/amm.html
Let's do a quick recap:
🔹 Measured Volatility, likely initially the RVOL, (σ) will be used to map to the exponent (n) in the adaptive curve formula in an inverse pattern
🔹 When volatility is low ⬇️ then n will be high ⬆️ and the curve will adjust to a shape similar to constant sum (x + y = k)
🔹 When volatility is high ⬆️ then n will be low⬇️and the curve will adjust to a shape similar to constant product (x * y = k)
This transformation has the effect of a self-adjusting concentrated liquidity position, similar in some ways to Curve CryptoSwap or v2 pools. However, it has some advantages over Curve in that:
CryptoSwap pools require that Amplification (A) and Gamma parameters get set on pool initialization and only adjusted through governance vote changes, which can mean they are slower to adapt to changing market conditions
There's a great breakdown of how these parameters work in Curve v2 - nagaking.substack.com/p/deep…
BTW, Curve v2 uses EMA within its own internal oracle rather than RVOL & TWAP or RWAP
In comparison, the adaptive curve AMM proposed by Flying Tulip has only a single parameter that automatically self-adjusts - presumably without any ongoing need for governance submission or voting
Additionally, and connecting back to TWAP & RWAP, feeding both TWAP RVOL (marginal price vol) & RWAP RVOL (liq-aware vol) into AMM logic:
➡️ Curve can self-adjust dynamically based on more complete risk assessment
➡️ E.g. Auto-widen spreads/fees or adjust liq concentration when effective vol (price & depth) spikes. Protecting LPs & improving trades
1
1
247
For correlated assets, like stablecoins or asset/staked asset pairs, you don't need the curve to adjust to the constant product at the upper bound since this is too wide a spread of liquidity when you expect prices of asset a in terms of asset b to be close to 1:1
This means the adaptive curve can limit its upper bounds to a polynominal invariant or a stableswap invariant, for example, something like the x3y + y3x = k formula we saw on Solidly
This gives an adaptive curve that moves in a more confined range & is a more capital-efficient solution for correlated asset types
1
126
But won't writing all those observations make gas costs high?
It doesn't really matter for either traders or LPers when @flyingtulip_ is promising "no gas"
This can be done because @SonicLabs is giving back 90% of the gas fees to devs, so this can act as a subsidy (and counter) for the effect of increased storage costs as Flying Tulip can redirect some of these fees to offset user costs (and this is also how you get to "no gas")
Replying to @SeaSaltyFunk
TWAP & RWAP ORACLES
Let's start here - because understanding what's happening in this area helps explain how the Adaptive Curve AMM works
First, what's RVOL (Realized Vol)?
Think rearview mirror price action. It measures how much an asset's price actually jumped around over a specific past period (last hour, day, week)
In DeFi, this can be used for:
🔹 Risk Mgmt (Lending, LPs)
🔹 Pricing Derivatives (Options)
🔹 Understanding Market Mood
How can you calculate RVOL on-chain?
We'll get into that in more detail later but, first, you need a price feed. Until now, in DeFi, this has most often been TWAP (Time-Weighted Avg Price)
✅ Pro: TWAPs smooth out price data & resist flash loan manipulation. Great for a stable price reference
The implementation of TWAP in Andre's most recent project (Solidly) was a little different, & we can assume that in Flying Tulip, this rationale will carry over
BTW, there's already an excellent explanation of how this TWAP is different in this post - xitter.cf/gavinmclelland/status/…
But, to summarize...
🔧 Under the Hood (TWAP): in Solidly's BaseV1Pair implements via...
1⃣ priceCumulativeLast: Stores Σ(price * time_elapsed). Updated on interactions
2⃣ _update(): Adds (current_price * time_since_last_update) to cumulative value
3⃣ Observation struct: Snapshots priceCumulativeLast & timestamp periodically (e.g. every 30 mins), stored in an array
Queries then calc avg price from snapshot differences
The current_price used by TWAP is the marginal price. Meaning it's the spot rate for the next, tiny, infinitesimal unit traded on the AMM curve at that exact moment
TWAP = Avg of these specific points over time
So when using TWAP to determine RVOL you get:
➡️ Result: TWAP-based RVOL tells us the volatility of the avg marginal price
⚠️ Limitation: It ignores slippage! A real-sized trade moves the price. TWAP shows avg price at the edge of the pool, not the avg execution price for size.
This is the "infinite depth" assumption – a key blind spot
So how can this limitation be tackled?
💡What if you had an oracle that tracked the avg liquidity(reserves) over time, not just the marginal price?
This is where RWAP comes in - unlike TWAP there's not a direct prior implementation that we can reference, however ,Andre provided some hints in this post- xitter.cf/AndreCronjeTech/status…
Some of this may be pure speculation (likely at least directionally correct), but how might this work on a technical detail?
🔧 Under the Hood (RWAP) could be implemented by...
The AMM contract utilizing:
1⃣ reserve0CumulativeLast, reserve1CumulativeLast: Store Σ(reserve * time_elapsed)
2⃣ Modified _update(): Accumulate (current_reserve * time_elapsed)
3⃣ Expanded Observation struct: Snapshot cumulative reserve values too
This means it'd be possible to query avg reserves & derive RWAP - Directly embedding the liquidity state of each pool within the AMM
✅ Pro: RWAP inherently includes liquidity depth info
➡️ Result: RWAP-based RVOL measures volatility reflecting both price changes & shifts in avg market depth/liq. Potentially closer to executable volatility
The REALLY interesting thing is the potential to use both TWAP RVOL & RWAP RVOL together ✨
Comparing them gives far richer insights:
🔹 Low TWAP RVOL / High RWAP RVOL? = Price calm, but liq thin/volatile. Hidden risk 🚨
🔹 High TWAP RVOL / Low RWAP RVOL? = Price swung, but likely in deep liquidity market
🔹 Both High? = True market turbulence price & depth
This combo of info paints a clearer picture of effective market risks
Okay, this is interesting... 🤔
"rVOL, IV, TWAP, & RWAP oracles" & "Adaptive curve AMM"
Let me explain why, attempt to explain how, and what this means for LPers...
👇
TWAP & RWAP ORACLES
Let's start here - because understanding what's happening in this area helps explain how the Adaptive Curve AMM works
First, what's RVOL (Realized Vol)?
Think rearview mirror price action. It measures how much an asset's price actually jumped around over a specific past period (last hour, day, week)
In DeFi, this can be used for:
🔹 Risk Mgmt (Lending, LPs)
🔹 Pricing Derivatives (Options)
🔹 Understanding Market Mood
How can you calculate RVOL on-chain?
We'll get into that in more detail later but, first, you need a price feed. Until now, in DeFi, this has most often been TWAP (Time-Weighted Avg Price)
✅ Pro: TWAPs smooth out price data & resist flash loan manipulation. Great for a stable price reference
The implementation of TWAP in Andre's most recent project (Solidly) was a little different, & we can assume that in Flying Tulip, this rationale will carry over
BTW, there's already an excellent explanation of how this TWAP is different in this post - xitter.cf/gavinmclelland/status/…
But, to summarize...
🔧 Under the Hood (TWAP): in Solidly's BaseV1Pair implements via...
1⃣ priceCumulativeLast: Stores Σ(price * time_elapsed). Updated on interactions
2⃣ _update(): Adds (current_price * time_since_last_update) to cumulative value
3⃣ Observation struct: Snapshots priceCumulativeLast & timestamp periodically (e.g. every 30 mins), stored in an array
Queries then calc avg price from snapshot differences
The current_price used by TWAP is the marginal price. Meaning it's the spot rate for the next, tiny, infinitesimal unit traded on the AMM curve at that exact moment
TWAP = Avg of these specific points over time
So when using TWAP to determine RVOL you get:
➡️ Result: TWAP-based RVOL tells us the volatility of the avg marginal price
⚠️ Limitation: It ignores slippage! A real-sized trade moves the price. TWAP shows avg price at the edge of the pool, not the avg execution price for size.
This is the "infinite depth" assumption – a key blind spot
So how can this limitation be tackled?
💡What if you had an oracle that tracked the avg liquidity(reserves) over time, not just the marginal price?
This is where RWAP comes in - unlike TWAP there's not a direct prior implementation that we can reference, however ,Andre provided some hints in this post- xitter.cf/AndreCronjeTech/status…
Some of this may be pure speculation (likely at least directionally correct), but how might this work on a technical detail?
🔧 Under the Hood (RWAP) could be implemented by...
The AMM contract utilizing:
1⃣ reserve0CumulativeLast, reserve1CumulativeLast: Store Σ(reserve * time_elapsed)
2⃣ Modified _update(): Accumulate (current_reserve * time_elapsed)
3⃣ Expanded Observation struct: Snapshot cumulative reserve values too
This means it'd be possible to query avg reserves & derive RWAP - Directly embedding the liquidity state of each pool within the AMM
✅ Pro: RWAP inherently includes liquidity depth info
➡️ Result: RWAP-based RVOL measures volatility reflecting both price changes & shifts in avg market depth/liq. Potentially closer to executable volatility
The REALLY interesting thing is the potential to use both TWAP RVOL & RWAP RVOL together ✨
Comparing them gives far richer insights:
🔹 Low TWAP RVOL / High RWAP RVOL? = Price calm, but liq thin/volatile. Hidden risk 🚨
🔹 High TWAP RVOL / Low RWAP RVOL? = Price swung, but likely in deep liquidity market
🔹 Both High? = True market turbulence price & depth
This combo of info paints a clearer picture of effective market risks
This quoted post is unavailable.















