Perps were always the plan for Flint.
We're building a fully on-chain perp DEX on @solana with multi-collateral support, spot margin borrow/lend and full cross-margin.
@Josh_E_Wa at @SolanaSummitOrg 🇸🇬
Why Build On Solana?
Last week, at a few conference side events, multiple people brought up the on-chain cost of running a heavy, compute-intensive application like a PerpDex on @solana.
It was always phrased as if running your application on Solana was basically not worth it, extractive by the chain or merely a marketing play.
The L2 and corpo-chain narratives have unfortunately muddied the water here and I think a stronger re-invigoration of the messages around real ‘DeFi’ is necessary; a clear and clean call. Let me try.
The chain fees paid by application developers, operators and users are not ‘wasted’; we are paying for and receiving a service.
Firstly, we are paying for compute à la AWS; we publish a program which is executable on a VM that at some point in the stack runs on real hardware someone has to maintain; computers, networking infra and more. That’s just the beginning, and with centralized computing it’s ‘cheap’ because you’re trusting whoever runs it.
Secondly, and mainly, we are paying for consensus and security of the state the computer operates on. At the time of writing, the state of the network is secured by staked SOL valued at 65 billion USD (take 1/3 or 2/3 of that depending on whether you’re talking about halting or finalizing).
If decentralization and verifiability are goals, you need a credibly decentralized, high-stake-TVL chain. How much do you think that will cost you? What do you think the developers, devops, computers and seed capital will cost you to build an L1 and start a network? At the very least a few million a year, with far less stake valuation, high start-up costs, and a massive distraction.
Now, you are no longer building your application and all the domain-specific aspects of it; you are now bogged down building a chain stack, from code, to infra, to marketing and BD.
Just use Solana.
“People can literally plug in and start quoting within 30 minutes.”
@Josh_E_Wa explains how Flint handles the complexity of trading on @solana, so market makers can focus on their quoting strategies.
ADL: Surprises and Fairness
A year on from 10/10, I wanted to write a little about how @flint_trade_ will be thinking about ADL, as that was the dominating mechanic on that fateful day.
First, a quick recap. ADL (Auto-Deleveraging) generally refers to the venue forcibly closing profitable positions, or haircutting positive PNL, to cover ‘bad debt’. Bad debt is what the market accrues when a user’s losses exceed their collateral and their equity goes negative before they can be liquidated. The market is basically insolvent if everyone was ‘closed out’ at that moment in time.
So ADL is used to fix things when all else has failed (liquidations, backstop takeovers, the insurance fund). The bad debt must be covered or the exchange and everyone’s capital would be at risk. Sad but understandable. So the real question is what mechanic and decision framework to use for that? What objective function to focus on and maximize?
At a high level, the biggest themes within the ADL problem space are ‘surprises’ and ‘fairness’.
‘Surprises’ are not something desired in a risk engine. You want predictability. You want to know the terms and conditions of the venue you are trading on: how it will act and react given market conditions and when certain stressors are triggered. While most exchanges publish some general guidelines of how/when ADL will be triggered, some of the rules are quite opaque and they usually reserve some ability to put their thumb on the scale, leaving some traders blindsided by how much of their equity is seized, and under what rules. On most venues, you can’t check any of this. You find out who was picked and why after the fact, if at all.
On the other hand, ‘fairness’ is basically trying to find the right balance between sharing the load across all market participants (socialization) versus concentration on the users/positions that introduced the highest amount of risk on the venue (leverage targeted). From different perspectives, both can be seen as fair. Socialization is ‘nice’ because on a per-user basis the hit is small. Leverage targeting is ‘nice’ because the cost lands on those who brought the most risk.
At @flint_trade_, amongst other things, we are aiming for alignment between the venue and its traders, and for verifiability, which has measurable effects on our ADL design. While at the time of writing we (mainly the resident quant @davethereiss) are aggressively stress-testing the parameters of the final design, we feel strongly about the following:
- Balancing between socialization and risk-concentrated users.
- Verifiable on-chain targeting: the rules that decide who can be deleveraged, and the limit on how much, are enforced on-chain.
The idea will be that traders know what they are getting themselves into and will be able to plan accordingly if they have certain requirements. Additionally, while users introducing more risk to the exchange will share a larger load of covering the bad debt, they will not be immediately ‘wiped out’ when ADL is triggered. Positions are closed at the bankruptcy price of the account that failed, and only positions in profit at that price are eligible, so a trader who gets ADL’d still walks away with a profit on what was closed.
Putting elaborate financial rules on chain is not for the faint of heart. It is far harder from the code and design perspective, but it is worth it for the seriousness of the commitment. The general idea is that every eligible position gets a score based on its PNL% and its leverage. A threshold sets the minimum score needed for ADL. It starts high, so only the highest-scoring positions qualify, and decays over time, faster if the bad debt isn’t being cleared. Each hit is capped to a portion of the position and followed by a cooldown, so the load spreads instead of landing on one trader. ADL instructions will be submitted by incentivized keepers, but the program checks every one of them on-chain: a keeper can only touch positions that clear the threshold.
While alignment is a broad term, it is something we take seriously and it comes up in every design discussion. As we get closer to launch, I’ll continue to share more thoughts about the various mechanics underpinning the Flint Perps system.
Of course, formal specifications for all this will be published as articles and eventually open-sourced code.
DG
ADL: Surprises and Fairness
A year on from 10/10, I wanted to write a little about how @flint_trade_ will be thinking about ADL, as that was the dominating mechanic on that fateful day.
First, a quick recap. ADL (Auto-Deleveraging) generally refers to the venue forcibly closing profitable positions, or haircutting positive PNL, to cover ‘bad debt’. Bad debt is what the market accrues when a user’s losses exceed their collateral and their equity goes negative before they can be liquidated. The market is basically insolvent if everyone was ‘closed out’ at that moment in time.
So ADL is used to fix things when all else has failed (liquidations, backstop takeovers, the insurance fund). The bad debt must be covered or the exchange and everyone’s capital would be at risk. Sad but understandable. So the real question is what mechanic and decision framework to use for that? What objective function to focus on and maximize?
At a high level, the biggest themes within the ADL problem space are ‘surprises’ and ‘fairness’.
‘Surprises’ are not something desired in a risk engine. You want predictability. You want to know the terms and conditions of the venue you are trading on: how it will act and react given market conditions and when certain stressors are triggered. While most exchanges publish some general guidelines of how/when ADL will be triggered, some of the rules are quite opaque and they usually reserve some ability to put their thumb on the scale, leaving some traders blindsided by how much of their equity is seized, and under what rules. On most venues, you can’t check any of this. You find out who was picked and why after the fact, if at all.
On the other hand, ‘fairness’ is basically trying to find the right balance between sharing the load across all market participants (socialization) versus concentration on the users/positions that introduced the highest amount of risk on the venue (leverage targeted). From different perspectives, both can be seen as fair. Socialization is ‘nice’ because on a per-user basis the hit is small. Leverage targeting is ‘nice’ because the cost lands on those who brought the most risk.
At @flint_trade_, amongst other things, we are aiming for alignment between the venue and its traders, and for verifiability, which has measurable effects on our ADL design. While at the time of writing we (mainly the resident quant @davethereiss) are aggressively stress-testing the parameters of the final design, we feel strongly about the following:
- Balancing between socialization and risk-concentrated users.
- Verifiable on-chain targeting: the rules that decide who can be deleveraged, and the limit on how much, are enforced on-chain.
The idea will be that traders know what they are getting themselves into and will be able to plan accordingly if they have certain requirements. Additionally, while users introducing more risk to the exchange will share a larger load of covering the bad debt, they will not be immediately ‘wiped out’ when ADL is triggered. Positions are closed at the bankruptcy price of the account that failed, and only positions in profit at that price are eligible, so a trader who gets ADL’d still walks away with a profit on what was closed.
Putting elaborate financial rules on chain is not for the faint of heart. It is far harder from the code and design perspective, but it is worth it for the seriousness of the commitment. The general idea is that every eligible position gets a score based on its PNL% and its leverage. A threshold sets the minimum score needed for ADL. It starts high, so only the highest-scoring positions qualify, and decays over time, faster if the bad debt isn’t being cleared. Each hit is capped to a portion of the position and followed by a cooldown, so the load spreads instead of landing on one trader. ADL instructions will be submitted by incentivized keepers, but the program checks every one of them on-chain: a keeper can only touch positions that clear the threshold.
While alignment is a broad term, it is something we take seriously and it comes up in every design discussion. As we get closer to launch, I’ll continue to share more thoughts about the various mechanics underpinning the Flint Perps system.
Of course, formal specifications for all this will be published as articles and eventually open-sourced code.
DG
Why build another perp DEX? And why @solana?
Our co-founder and CTO @thedavidgorski explains why decentralisation and verifiability matter to Flint.
And why we’re building our perp DEX on Solana’s high-performance, neutral execution layer.
@flint_trade_ is building perps on @solana.
I'm very excited to start sharing more about our goals; especially regarding the level of verifiability, permissionlessness and on-chain logic.
My off-the-cuff thoughts in this video.
this is quite possibly the best article ive read about development on solana
when i started out with rust, i really fell in love with the type system. it's really what makes rust powerful.
i always did explicit types for everything
unfortunately when i got into solana, i noticed that we don't really do that here, and especially with Anchor it's difficult to do something out of the ordinary
so this makes me very happy, and after reading the article i am super bullish on @flint_trade_
Missing out on market-making opportunities on @solana?
Building your own trading infrastructure can take months, require specialist engineers and come with significant costs.
Flint handles the complexity. Plug into our API and start quoting in less than 30 minutes.
Market maker? Get in touch.
No perfect perp DEX, only tradeoffs
Mark price basics
1/TLDR:
Follow the book too closely and liquidations can trigger more liquidations. Lean too heavily on the oracle and bids may fall outside liquidation price limits.
The right balance depends on liquidity.
“We wouldn’t be building on @solana if we didn’t think it was possible. I think it absolutely is. The main thing is to lean into Solana’s strengths.”
@thedavidgorski Co-Founder and CTO of Flint speaking with @SuperteamAU.
Watch ↓
TOKEN2049 camera roll 🇸🇬
@joinfrontier, @token2049, and @Josh_E_Wa talking Flint perps.
Active perp trader and want early access to our closed alpha on @solana? DM us
Where your Solana / Rust bug gets caught:
trusted types → in your editor
const asserts/lints → when you compile
pinning tests → when you run tests
runtime checks → in production ... hopefully
Move everything you can up the list.
Read how at https://t.co/VgFPruLRqZ
Our co-founder and CEO @Josh_E_Wa shares what 4+ years at @dydxfoundation taught him and how those lessons are shaping our upcoming perp DEX on @solana:
• Be deliberate about what we build ourselves
• Earn every trade
• Build alignment early
• Keep the team small and ownership real
• Raise what we need. Build toward break-even