Oracle3
Open-source trading engine and MCP server for prediction markets. Fee-aware no-arbitrage trading across related contracts, live on Kalshi, Polymarket and Solana or on paper.
Open flash-loan infrastructure on Stacks. Borrow STX or canonical sBTC with zero collateral and repay in the same transaction.
FinanceClarity · JavaScriptGitHub @mattgloryOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Atomic flash loan protocol for Bitcoin Layer 2 (Stacks blockchain)
Translation pending
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
Open flash-liquidity infrastructure for Bitcoin Layer 2
Atomic, uncollateralized flash loans on Stacks (Bitcoin L2). Borrow STX or canonical sBTC with zero collateral, run any on-chain strategy, and repay — all in a single transaction. If repayment fails, the whole transaction reverts. Zero risk to the protocol.
FlashStack is neutral, standalone flash-liquidity any Clarity contract can integrate — no lending market to join. It is also the rail behind DeepStack, a Bitcoin-native market-making agent that rebalances through it:Read the full README ↗Open flash-liquidity infrastructure for Bitcoin Layer 2
Atomic, uncollateralized flash loans on Stacks (Bitcoin L2). Borrow STX or canonical sBTC with zero collateral, run any on-chain strategy, and repay — all in a single transaction. If repayment fails, the whole transaction reverts. Zero risk to the protocol.
FlashStack is neutral, standalone flash-liquidity any Clarity contract can integrate — no lending market to join. It is also the rail behind DeepStack, a Bitcoin-native market-making agent that rebalances through it:
DeepStack volume → FlashStack fees → LP yield → deeper reserves → more DeepStack capacity ↻
The first live DeepStack → FlashStack → Bitflow flash-rebalance ran on mainnet in one atomic transaction.
Flash loan. Call flash-loan(amount, receiver) on a core. The core sends the asset to your receiver, invokes its callback, and requires the reserve to grow by at least the fee before the transaction ends — otherwise everything reverts. Repayment is never trusted; it is measured. This is the Aave live-reserve model, so a malicious receiver can only fail, never drain the pool.
LP pool. Anyone deposits STX or sBTC and receives shares. Every flash-loan fee stays in the pool, so each share appreciates. Withdraw principal + accrued yield anytime. Share value is exposed to lending protocols via a collateral oracle (get-share-price / get-lp-value).
Fee: 0.05% per loan. Assets: STX and canonical sBTC (SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token).
Flash-loan engines & receivers — SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5
| Contract | Description |
|---|---|
flashstack-stx-core | STX flash-loan engine (reserve model) |
flashstack-sbtc-core | Canonical sBTC flash-loan engine |
bitflow-arb-receiver-v4 | Bitflow STX/stSTX arbitrage — de-approved (F-10): no contract-caller check. Hardened rewrite: bitflow-arb-receiver-v5, not yet deployed |
velar-sbtc-arb-receiver | Velar wSTX↔sBTC arbitrage — non-functional, de-approved: hardcodes Velar pool u70, which is not an sBTC/STX pool |
zest-v2-liquidation-receiver | Zero-capital Zest liquidator, v0-8-market (5 modes) — not yet deployed |
alex-arb-receiver-v2 | ALEX STX/ALEX arbitrage — de-approved (F-10): no contract-caller check. Approved successor: alex-arb-receiver-v5 |
Hardened LP pools & oracle (v2) — SPR9PQANV6XHSDNRAX2GNKCA5Z1KH61961KE0BYG
| Contract | Description |
|---|---|
flashstack-stx-pool-v2 | STX LP pool — virtual-shares hardened |
flashstack-sbtc-pool-v2 | sBTC LP pool — virtual-shares hardened, built-in oracle |
flashstack-pool-oracle-v2 | STX collateral oracle |
The v2 pools add virtual shares/assets (OpenZeppelin ERC-4626 style) against first-depositor share inflation. The earlier v1 pools are deprecated.
Status: mainnet, not yet professionally audited. Use at your own risk.
contracts/test/, not the canonical sources; see docs/security/CONTRACT_INVENTORY.md §5 (D6).A professional third-party audit is the top priority before opening real LP deposits.
git clone https://github.com/mattglory/Flashstack.git
cd flashstack
npm install
npm test # 254 tests passing
npm run check # clarinet check — type-checks contracts registered in Clarinet.toml
# (script-deployed receivers aren't in the project; see docs/BUILD_A_RECEIVER.md)
cd web && npm install && npm run dev # frontend at http://localhost:3000
Requirements: Node.js 18+, Clarinet 2.0+.
Scripts read wallet mnemonics from the environment only. Never hardcode or commit a mnemonic.
Any Clarity contract implementing the receiver trait can borrow. New to Clarity? Start with the New Developer Walkthrough.
(impl-trait 'SP3TGRVG7DKGFVRTTVGGS60S59R916FWB4DAB9STZ.stx-flash-receiver-trait.stx-flash-receiver-trait)
(define-constant CORE 'SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.flashstack-stx-core)
(define-public (execute-stx-flash (amount uint) (core principal))
(begin
;; Only the real core may call this, and repayment goes to it, never to `core` (F-10)
(asserts! (is-eq contract-caller CORE) (err u403))
(let (
(fee-bp (unwrap! (contract-call? CORE get-fee-basis-points) (err u500)))
(fee (let ((raw (/ (* amount fee-bp) u10000))) (if (> raw u0) raw u1)))
)
;; ...your strategy here — `amount` STX is already in this contract...
(unwrap! (as-contract (stx-transfer? (+ amount fee) tx-sender CORE)) (err u500))
(ok true)
)
)
)
Before asking for approval, run docs/security/RECEIVER_VETTING.md. Deploy to mainnet, then open a GitHub issue with your contract address to get whitelisted. Full templates: BUILD_A_RECEIVER.md · TESTING_GUIDE_STX.md · TESTING_GUIDE_SBTC.md.
| Asset | Type | Tx |
|---|---|---|
| STX | DeepStack flash-rebalance (borrow → Bitflow swap → repay) | 0x1f826abe… |
| STX | Bitflow STX/stSTX round-trip | 0xabd33fc4… |
| sBTC | Canonical sBTC borrowed & repaid atomically | 0x67f0c77d… |
See ROADMAP.md — audit-readiness → audit → deploy v2 → LP deposits, the vault/AUM future, and permissionless-post-audit.
Built by Glory Matthew — @flashstackbtc · GitHub · [email protected]
stx-test-receiver / sbtc-test-receiver | Minimal borrow-and-repay receivers — de-approved (F-10): no contract-caller check. A loan naming either returns (err u306) |