https://docs.rs/sqlx/0.4.0-beta.1/sqlx/postgres/types/index.html
CREATE DATABASE hunter OWNER postgres;
GRANT ALL PRIVILEGES ON DATABASE hunter to postgres;
- Ethereum (ETH)
- Optimism (OP)
- BSC (BNB)
- OKExChain (OKT)
- Moonbeam (GLMR)
- Polygon (MATIC)
-
tokens
- WBNB 0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd
- BUSD 0x78867BbEeF44f2326bF8DDd1941a4439382EF2A7
- USDT 0x7ef95a0FEE0Dd31b22626fA2e10Ee6A223F8a684
-
Pancake (length = 198964; domain = https://pancake.kiemtienonline360.com)
- route 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3
- factory 0xB7926C0430Afb07AA7DEfDE6DA862aE0Bde767bc
cargo run --bin arbitrager-bot -- run xxxxxxxx{private key}xxxxxxxx bsc
cargo run --bin arbitrager-bot -- fetch-pairs bsc-testnet
其他人实现的套利合约
https://bscscan.com/address/0xca4533591f5e5256f1bdb0f07fee3be76a1aae35 https://bscscan.com/address/0x0e534373dc7da707f0a170549d584d219add7112 https://bscscan.com/address/0xdcbfeaa3c882b82174361fb335f5732710985476 https://bscscan.com/address/0x270eb2621eb213a0600a03151af8f9be520e56d4 https://bscscan.com/address/0xfa4ca7ab66aa1d3ee009353aff841bb137ba320f https://bscscan.com/address/0xc84bd30ec457356ca0fa8f9638f594a6793c248a https://bscscan.com/address/0xc3be22a67f25e5249b6e56b2db2d0504e3e5714c https://bscscan.com/address/0x2818e19d3e37a8708e70cc0113036a860a830924
10 | 0x738B815eaDD06E0041b52B0C9d4F0d0D277B24bA // 未开源 30 | 0x0EeF723EfB04BCCf88B530450c9Bd305D3a06F6f // 未开源 47 | 0x31f191221F43f648073cF390e844655aF2da6b08 // 未开源 61 | 0xe0636f192a88De6F1c9ed1a6A0F265C9775c8596 // 未开源 70 | 0xB05803cAE7B20Aa280EecBF02091A6B0421A81Ec // 未开源 107 | 0x585E1D9abceBF97CdfbA8562cF5dEE5E0B3FF7a2 // 未开源 109 | 0x780B2A0D1B55cCdcF672f12484Fcdbb545b6Ae2F // 未开源 0xb5b4aE9413dFD4d1489350dCA09B1aE6B76BD3a8 0x3d077c05c3AbCE52257E453607209f81D9db01fC
套利思路:
- 套利路径长度为2和3的使用暴力循环法 ✅
- 套利路径长度为4和以上的使用图算法 Bellman Ford ✅
- 监控pending交易池内的大笔交易,计算套利空间
- 可靠的数据源,可以预先发现套利机会
- 对转账收取手续费的币种也可以套利
已经发现的问题:
- 套利交易时部分交易在合约中返回K错误,导致套利交易失败,是因为有些币种转账收取手续费
可能的问题:
- 数据源质量低,导致获取到的数据不能计算出套利空间
- 交易对币种,入与出可以不一样