Tutorial
Glossary
Base / Quote
In XLM/USDC:
- Base = XLM
- Quote = USDC
The price indicates how much Quote is needed for 1 Base.
Long Base
You benefit if Base price rises vs Quote.
On Untangled Loop (via Blend), you typically end with:
- Collateral: Base
- Debt: Quote
Short Base
You benefit if Base price falls vs Quote.
You typically end with:
- Collateral: Quote
- Debt: Base
Flash loan
A loan taken and repaid in the same transaction. Used to atomically build or unwind a position.
Collateral
Asset deposited to secure borrowing in the money market.
Debt / liability
Asset borrowed against collateral.
Leverage
Amplification of exposure via borrowed funds. Effective leverage is constrained by money market collateral parameters and current utilisation.
Slippage / min output
Swaps can execute worse than quoted due to market movement. Trades include a minimum acceptable output to prevent adverse execution.
Swap chain (multi-hop route)
A sequence of Aquarius pools used to swap token_in → token_out through multiple steps.
Funding (net rate)
The net of:
- collateral supply yield
- debt borrow cost
This is the closest analogue to “funding” in this architecture.
FAQs
What is Untangled Loop?
Untangled Loop is the looping layer on Stellar that lets you create synthetic long/short exposure using spot + money markets, automated via flash loans.
Do I need to manually loop or repeat steps?
No. The contracts automate the loop atomically: flash loan → swap → collateralize → borrow → repay.
Is this a perpetuals exchange?
No. There is no order book matching engine. Exposure is created via:
- spot swaps (Aquarius)
- collateral + debt positions (Blend)
Where is my position stored?
In Blend under your account (collateral + liabilities). Untangled Loop orchestrates creation and closing of that position.
What determines carry / “funding”?
Carry is driven by money market rates:
- supply yield on your collateral
- borrow cost on your debt
Net carry changes with utilisation and market conditions.
Why is there a MarginManager contract?
Blend calls exec_op (flash-loan callback) on the receiver contract. MarginManager exists to:
- receive the flash loan callback
- transfer funds to the user
- execute the Aquarius swap (optional)
- clear temporary swap config
How do I find the best swap route?
Use Aquarius route discovery and pass the resulting swap chain to the contract.
What happens if execution is worse than expected?
If the swap output is below your configured minimum output, the transaction should revert. This prevents unexpected bad fills, but it also means trades can fail in volatile or illiquid conditions.
What are the biggest risks?
- liquidation risk on the underlying money market
- oracle/reference pricing deviations
- spot execution slippage/price impact
- rate spikes and utilisation shifts
- smart contract and integration risk