This document provides a reviewer-oriented package for Milestone 1,2 : Off-chain integration enabling Long/Short positions via Minswap + Liqwid, including clearly mapped acceptance criteria, evidence artifacts, and how a reviewer can verify end-to-end without local setup.
Repository (open source)
Minswap Interface (Trading tMIN - ADA Page)
Liqwid Interface
Demo Interface
Off-chain integration enabling long position operations through Minswap and the chosen lending protocol on Cardano (either Liqwid or Lenfi).
- User can open-close long position (Isolated Margin Long $MIN) through Minswap Dex V2 + Liqwid V2 via a simple POC Interface.
- Multi-steps Transactions flow were executed seamlessly via password-less Nitro Wallet, reducing user signing many transactions while preserving non-custodial control on-device, also save user time to wait many transactions confirmed and adhoc tasks on interface.
- Minswap x Liqwid Integration SDK is fully functional.
Off-chain integration successfully enables asset supply, borrowing, and purchasing for long positions.
- The off-chain integration between Minswap V2 and Liqwid V2 has been completed and is fully functional, allowing users to open leveraged long positions in isolated margin mode – exactly the same experience as margin trading on centralized exchanges (CEX).
-
With Nitro Wallet, User doesn't need to sign any transaction to open-close Position.
-
With Liqwid Integration SDK, User doesn't need go to Liqwid Page then supply-borrow-repay-withdraw.
-
User doesn't care about any states, just focus on trading.
-
For example if User (Alice) do it by herself: 0. Alice need to learn about how Liqwid work and how to leverage trading by borrowing tokens.
- Alice create BUY order ADA -> MIN on Minswap.
- Alice keep waiting and refresh page until Order was batched.
- Alice go to Liqwid page and try to supply her $MIN tokens.
- Alice keep waiting and refresh page util she received $qMIN tokens.
- Alice deposit $qMIN as collaterals and borrow some $ADA tokens (self calculated how many ADA need to be borrowed)
- Alice keep waiting and refresh page until her borrow position has approved and she received borrowed ADA.
- Alice take $ADA to BUY more $MIN on Minswap. ...... a few moments later
- Alice want to close position, then she start sell all her $MIN
- Alice keep waiting and refresh page util Order was batched.
- Alice take $ADA and go to Liqwid Page to repay her loan.
- Alice keep waiting and refresh page util her loan fully repaid and closed.
- Alice take $qMIN and go to Liqwid Page to withdraw and get back her $MIN.
- Alice keep waiting and refresh page util she received $MIN tokens back.
- Alice go to Minswap Page, create SELL order to sell her $MIN and capture her profit.
- Alice keep waiting and refresh page util Order was batched.
-> Lesson for Alice: Open Minswap Lending Market, go try it yourself, open a 1.5x $MIN long with 400 ADA and tell me it’s not seamless. I dare you 😎
- Partially achieved in current milestone, with full optimization scheduled for the next milestone after Liqwid releases the required APIs.
- Explanation & Evidence:
- The Liqwid V2 smart contracts currently have the following technical limitations that directly prevent full optimization at the smart-contract interaction layer:
- Building Transactions in Liqwid is centralize (required Liqwid's Admin Signed) and only support via Liqwid APIs.
- Supplying assets on Liqwid only supports PubKey addresses, not Script addresses (Native or Plutus).
- → This forces the frontend/dApp connector (in this case Minswap) to manually construct the supply transaction instead of using Liqwid's high-level SDK, which significantly increases complexity and prevents batching/optimization at the protocol level.
- While Borrow, Repay, and Liquidation operations technically allow script-to-script interaction, Liqwid's current BuildTx API does not expose the necessary endpoints to build these transactions when the user address is a script (Minswap Order Script Address). → As a result, I cannot yet batch multiple actions (e.g., open leveraged position → supply collateral → borrow → execute swap on Minswap in a single transaction) in the most efficient way possible.
- I have been continuous contact with the Liqwid team. They have confirmed that they've been updating their APIs in order to support script-to-script interaction.
- Once their API is live, I will immediately:
- Refactor code to educe the number of required transactions. → As a result, It will minimize time processing and achieve the lowest possible fees for users
- Minswap Order on Lending Market will apply Minswap Instant Batching Mode (will implement at Milestone 3).
-
This Milestone 1 POC is built purely to prove the core concept works end-to-end and to deliver the "How Long Position work?". It is not Ready-Production for users.
-
What it does NOT include yet (all planned for Milestone 3 – Frontend Interface):
- Polished production UI/UX (current interface is minimal & intentional)
- Some numbers/values are hard-coded or placeholder (will be fixed with final design)
- Liquidation Flow (waiting for Liqwid to ship on-chain price oracles on Testnet Preview)
- Advanced use-cases, edge cases, and full error handling
- Liqwid currently does not support Oracle to update Token Price on https://dev.liqwid.finance => I omit Liquidation flow on Milestone 1, waiting Liqwid team to support and support it at Milestone 3.
-
Milestone 1 = "It works, it's live, real users are already trading with leverage."
-
Milestone 3 = "Pixel-perfect, bulletproof, ready for millions."Everything else will be shipped in the next phase. Thanks for understanding!
Off-chain integration enabling short position operations through Minswap and the chosen lending protocol integration on Cardano (if Liqwid is not possible, we use LenFi).
- User can open-close short position (Isolated Margin Short $MIN) through Minswap Dex V2 + Liqwid V2 via a simple POC Interface.
- Multi-steps Transactions flow were executed seamlessly via password-less Nitro Wallet, reducing user signing many transactions while preserving non-custodial control on-device, also save user time to wait many transactions confirmed and adhoc tasks on interface.
- Minswap x Liqwid Integration SDK is fully functional.
- The POC includes
interest calculationsandliquidation scenarios.
Off-chain integration successfully facilitate asset supply, borrowing, selling, and repurchasing for short positions.
- With ADA only, user can short $tMIN with leverage margin 0.5x. For example, Alice has 1000 ADA, she can short 20k %tMIN (~= 500 ADA) and expecting $tMIN price go down and capture her profit.
Integration handles the complexities of short positions, including interest calculations and liquidation scenarios.
- Interest Calculations:
- Add some new functions for Liqwid Provider SDK to query
Supply, Borrow Interest Data(e.g. Supply APY, Borrow APY, Supply Interest, Borrow Interest, ...) - Support calculate Estimate PnL
- Add some new functions for Liqwid Provider SDK to query
- Liquidation Scenarios:
- In Testnet-Preview, Liqwid has not supported price Oracle yet. Therefore, the POC Liquidation Scenario is auto-trigger when SHORT Token price go up 10%. For example, if you open SHORT tMIN at price 0.22 ADA/MIN, the Liquidation will be triggered when price reach 0.242 ADA/MIN.
- To test the liquidation scenario, I manipulated the ADA-MIN price to increase by 10% or more, successfully triggering the liquidation process. This simulation helps verify that the protection mechanism works correctly and prevents real liquidations for users on Liqwid Platform.
- Work similar to Milestone 1.
- Non-custodial: private key persists on the user’s device.
- Security: Never send any data to Backend.
- seamless: Auto-sign within user-granted scope: enables multi-step flows (e.g., long/short) without repeated password prompts.
- Privacy: No on-chain linkage to the user’s primary wallet account beyond what’s inherent to transactions.
- User connect wallet
- User create Nitro Wallet
- User Deposit fund to Nitro Wallet to start trading Long/Short
- Setup your trading (example: LONG $MIN token with total buy in 300 ADA and leverage margin is 1.5x)
- Place Long Position.
- Nitro Wallet auto handle opening Long position.
- User can close Long Position and capture their profit.
- User connect wallet
- User create Nitro Wallet
- User Deposit fund to Nitro Wallet to start trading Long/Short
- Setup your trading (example: SHORT $MIN token with total supply 1000 ADA and leverage margin is 0.5x)
- Place Short Position.
- Nitro Wallet auto handle opening Short position.
- User can close Short Position and capture their profit.
- When you want to clear all Position and test again, please click on
Clear History & ResetButton.
5. Buying Asset TxReference
6. Supplying Token TxReference
7. Borrow Token TxReference
8. Buy More Long Asset TxReference
11. Selling Token TxReference
12. Repay Loan TxReference
13. Withdraw Collateral TxReference
14. Sell All Long Asset TxReference
- When you want to clear all Position and test again, please click on
Clear History & ResetButton.
5. Supplying ADA TxReference
6. Borrowing $tMIN TxReference
7. Short $tMIN TxReference
11. Buy Back Token TxReference
12. Repay Loan TxReference
13. Withdraw Collateral TxReference
- In Testnet-Preview, Liqwid has not supported price Oracle yet. Therefore, the POC Liquidation Scenario is auto-trigger when SHORT Token price go up 10%. For example, if you open SHORT tMIN at price 0.22 ADA/MIN, the Liquidation will be triggered when price reach 0.242 ADA/MIN.
- So for testing, after
position is opening, I manipulateADA-MINprice go up that trigger Liquidation Process: 



















