Skip to content

Commit e056462

Browse files
mattgloryclaude
andcommitted
Fix naming: bitflow-arb-receiver -> bitflow-arb-receiver-v4 throughout
The confirmed M1 tx (0xabd33fc4) used bitflow-arb-receiver-v4. Update README, monitor script, and all docs to reference the correct deployed contract name. Also update test count (82) and testing guide date. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 913ce67 commit e056462

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ All contracts deployed under `SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5`.
3535
| `flashstack-stx-pool` | LP pool — anyone deposits STX, earns fees | [View](https://explorer.hiro.so/address/SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.flashstack-stx-pool?chain=mainnet) |
3636
| `flashstack-pool-oracle` | Collateral oracle — share price for lending protocols | [View](https://explorer.hiro.so/address/SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.flashstack-pool-oracle?chain=mainnet) |
3737
| `stx-test-receiver` | Basic receiver — borrow STX, repay principal + fee | [View](https://explorer.hiro.so/address/SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.stx-test-receiver?chain=mainnet) |
38-
| `bitflow-arb-receiver` | Bitflow STX/stSTX arbitrage receiver | [View](https://explorer.hiro.so/address/SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.bitflow-arb-receiver?chain=mainnet) |
38+
| `bitflow-arb-receiver-v4` | Bitflow STX/stSTX arbitrage receiver | [View](https://explorer.hiro.so/address/SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.bitflow-arb-receiver-v4?chain=mainnet) |
3939

4040
### Canonical sBTC Flash Loan System
4141

@@ -81,7 +81,7 @@ The script derives your testnet address automatically, deploys all 5 contracts i
8181

8282
| # | Asset | Type | Tx |
8383
|---|-------|------|-----|
84-
| 1 | STX | Bitflow arb receiver — STX→stSTX→STX round-trip on Bitflow stableswap | [View](https://explorer.hiro.so/txid/0xabd33fc46ffa204ce61f25664f057e414063f28ce75c8387a6df9116453110cb?chain=mainnet) |
84+
| 1 | STX | `bitflow-arb-receiver-v4` — STX→stSTX→STX round-trip on Bitflow stableswap | [View](https://explorer.hiro.so/txid/0xabd33fc46ffa204ce61f25664f057e414063f28ce75c8387a6df9116453110cb?chain=mainnet) |
8585
| 2 | sBTC | Test receiver — canonical sBTC borrowed and repaid atomically | [View](https://explorer.hiro.so/txid/0x67f0c77d9d7ab9762c08a3638ba0990d5bbc3d19db8adc1a0d616cd7170f9baa?chain=mainnet) |
8686
| 3 | sBTC | Test receiver — executed via production frontend UI | [View](https://explorer.hiro.so/txid/0xc9d8e86f5ffcfc61537a25d6108a4b8ac0cf075568027a878cf2e9bcf6d53b4e?chain=mainnet) |
8787

@@ -275,7 +275,7 @@ flashstack/
275275
flashstack-sbtc-core.clar # sBTC flash loan engine
276276
flashstack-sbtc-pool.clar # sBTC LP pool
277277
sbtc-flash-receiver-trait.clar # sBTC receiver interface
278-
bitflow-arb-receiver.clar # Live Bitflow arb receiver
278+
bitflow-arb-receiver.clar # Bitflow arb receiver (v4 is the live deployed version)
279279
velar-sbtc-arb-receiver.clar # Velar sBTC arb receiver
280280
zest-liquidation-receiver.clar # Zest zero-capital liquidator (4 modes)
281281
alex-arb-receiver.clar # ALEX STX/ALEX arb receiver

docs/BUILD_A_RECEIVER.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ All FlashStack contracts are under `SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5`.
3838
| `sbtc-flash-receiver-trait` | sBTC callback interface |
3939
| `stx-test-receiver` | Minimal working STX receiver |
4040
| `sbtc-test-receiver` | Minimal working sBTC receiver |
41-
| `bitflow-arb-receiver` | Live STX/stSTX arb on Bitflow |
41+
| `bitflow-arb-receiver-v4` | Live STX/stSTX arb on Bitflow |
4242
| `velar-sbtc-arb-receiver` | Live sBTC/wSTX arb on Velar |
4343

4444
Canonical sBTC token: `SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token`
@@ -132,7 +132,7 @@ Minimum working receiver:
132132
)
133133
```
134134

135-
Live example to read: [contracts/bitflow-arb-receiver.clar](../contracts/bitflow-arb-receiver.clar) and [contracts/alex-arb-receiver.clar](../contracts/alex-arb-receiver.clar).
135+
Live example to read: [contracts/bitflow-arb-receiver.clar](../contracts/bitflow-arb-receiver.clar) (deployed as `bitflow-arb-receiver-v4` on mainnet) and [contracts/alex-arb-receiver.clar](../contracts/alex-arb-receiver.clar).
136136

137137
---
138138

docs/TESTING_GUIDE_STX.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# FlashStack STX Testing Guide
22

3-
**Last Updated:** April 2026
3+
**Last Updated:** May 2026
44
**For:** External testers and developers
5-
**Status:** STX is the active path — sBTC is legacy
5+
**Status:** Both STX and canonical sBTC flash loans are live on mainnet
66

77
---
88

@@ -28,7 +28,7 @@ All active contracts are under deployer wallet `SP20XD46NGAX05ZQZDKFYCCX49A3852B
2828
| `flashstack-stx-core` | Flash loan engine — holds reserve, executes loans | [View](https://explorer.hiro.so/address/SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.flashstack-stx-core?chain=mainnet) |
2929
| `flashstack-stx-pool` | LP pool — anyone deposits STX, earns fees | [View](https://explorer.hiro.so/address/SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.flashstack-stx-pool?chain=mainnet) |
3030
| `stx-test-receiver` | Basic receiver — borrows and repays, no strategy | [View](https://explorer.hiro.so/address/SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.stx-test-receiver?chain=mainnet) |
31-
| `bitflow-arb-receiver` | DEX receiver — STX→stSTX→STX arb on Bitflow | [View](https://explorer.hiro.so/address/SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.bitflow-arb-receiver?chain=mainnet) |
31+
| `bitflow-arb-receiver-v4` | DEX receiver — STX→stSTX→STX arb on Bitflow | [View](https://explorer.hiro.so/address/SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.bitflow-arb-receiver-v4?chain=mainnet) |
3232

3333
---
3434

@@ -37,7 +37,7 @@ All active contracts are under deployer wallet `SP20XD46NGAX05ZQZDKFYCCX49A3852B
3737
- **There is no testnet deployment.** All STX contract testing hits Stacks mainnet.
3838
- The frontend at [flashstack.vercel.app](https://flashstack.vercel.app) is connected to mainnet. Flash loans are atomic — if the receiver fails to repay, the entire tx reverts and you lose only the Stacks tx fee (~0.001 STX, ~$0.001). No other funds are at risk.
3939
- Do **not** run arbitrage scenarios via the UI without checking with Matt first — if the Bitflow spread is zero, the tx will revert cleanly but wastes gas.
40-
- The `bitflow-arb-receiver` is whitelisted in `flashstack-stx-core`. Any new receiver contract you deploy must be approved via `add-approved-receiver` (admin-only) before it can borrow.
40+
- The `bitflow-arb-receiver-v4` is whitelisted in `flashstack-stx-core`. Any new receiver contract you deploy must be approved via `add-approved-receiver` (admin-only) before it can borrow.
4141

4242
---
4343

@@ -102,7 +102,7 @@ Call `get-reserve-balance` on `flashstack-stx-core`. The result must be ≥ your
102102
| `get-max-single-loan` | `(ok u5000000000)` — 5000 STX limit |
103103
| `get-admin` | `(ok SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5)` |
104104
| `is-approved-receiver` with `SP20XD46...stx-test-receiver` | `(ok true)` |
105-
| `is-approved-receiver` with `SP20XD46...bitflow-arb-receiver` | `(ok true)` |
105+
| `is-approved-receiver` with `SP20XD46...bitflow-arb-receiver-v4` | `(ok true)` |
106106
| `calculate-fee u10000000` | `(ok u5000)` — fee on 10 STX |
107107

108108
---
@@ -132,10 +132,10 @@ amount: u1000000 (1 STX)
132132
**What it tests:** Flash loan → Bitflow STX/stSTX swap → repayment in one tx.
133133
**Contract:** `flashstack-stx-core`
134134
**Function:** `flash-loan`
135-
**Receiver:** `SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.bitflow-arb-receiver`
135+
**Receiver:** `SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.bitflow-arb-receiver-v4`
136136

137137
**How the flow works:**
138-
1. `flashstack-stx-core` sends STX to `bitflow-arb-receiver`
138+
1. `flashstack-stx-core` sends STX to `bitflow-arb-receiver-v4`
139139
2. Receiver swaps STX → stSTX on Bitflow (`stableswap-stx-ststx-v-1-2`)
140140
3. Receiver swaps stSTX → STX on Bitflow
141141
4. Receiver repays `flashstack-stx-core` principal + 0.05% fee
@@ -144,11 +144,11 @@ amount: u1000000 (1 STX)
144144
**Parameters:**
145145
```
146146
amount: u10000000 (10 STX)
147-
receiver: SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.bitflow-arb-receiver
147+
receiver: SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.bitflow-arb-receiver-v4
148148
```
149149

150150
**Before running — check profitability:**
151-
Call `estimate-profit u10000000` on `bitflow-arb-receiver`. If it returns a positive number, the arb is live. If it returns 0 or errors, the spread is zero and the tx will revert — wait for a better moment.
151+
Call `estimate-profit u10000000` on `bitflow-arb-receiver-v4`. If it returns a positive number, the arb is live. If it returns 0 or errors, the spread is zero and the tx will revert — wait for a better moment.
152152

153153
**What success looks like:**
154154
- Transaction confirmed
@@ -179,15 +179,15 @@ These should all fail cleanly with no fund loss:
179179
| Receiver | In scope | Notes |
180180
|----------|----------|-------|
181181
| `stx-test-receiver` | Yes — start here | Safe, always repays |
182-
| `bitflow-arb-receiver` | Yes — main DEX test | Check `estimate-profit` first |
182+
| `bitflow-arb-receiver-v4` | Yes — main DEX test | Check `estimate-profit` first |
183183
| `arkadiko-liquidation-receiver` | Optional | Requires an undercollateralised Arkadiko vault |
184184
| All sBTC receivers (`SP3TGRVG7...`) | No | Legacy — do not test |
185185

186186
---
187187

188188
## Clarinet / Local Tests
189189

190-
The 86 Clarinet tests in `tests/` cover the **sBTC path** on simnet. They are not relevant to STX testing.
190+
The 82 Clarinet tests in `tests/` cover the core protocol on simnet.
191191

192192
There is no Clarinet setup for the STX contracts because the core dependency (`SP3TGRVG7...stx-flash-receiver-trait`) is a mainnet-deployed contract that Clarinet cannot resolve locally. STX contract testing is mainnet-only until a testnet deployment is set up.
193193

scripts/monitor-opportunities.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function hiroFetch(url, opts = {}) {
5151
}
5252

5353
// Receiver contract
54-
const RECEIVER_STANDARD = `${DEPLOYER}.bitflow-arb-receiver`;
54+
const RECEIVER_STANDARD = `${DEPLOYER}.bitflow-arb-receiver-v4`;
5555

5656
// Bitflow STX/stSTX stableswap
5757
const BITFLOW_POOL = "SPQC38PW542EQJ5M11CR25P7BS1CA6QT4TBXGB3M";

0 commit comments

Comments
 (0)