Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Osmosis Integration Tests + Improvements #27

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
752cb4d
Add balance logs to log_route.
dowlandaiello Oct 3, 2024
95a5eae
Make log balance prefix lowercase.
dowlandaiello Oct 3, 2024
8ebba6c
Fix balance log prefix base denom log.
dowlandaiello Oct 3, 2024
b1de2fb
Log next queued leg-related balances in route logs.
dowlandaiello Oct 3, 2024
2a174eb
Display balance information in log prefixes for all in/out per prov.
dowlandaiello Oct 4, 2024
82ad226
Update local-ic docker image.
dowlandaiello Oct 4, 2024
dc80f96
Fix failing tests.
dowlandaiello Oct 4, 2024
caf00b8
Reactive osmosis local-ic integration tests.
dowlandaiello Oct 4, 2024
e2ea392
Centralize all skip queries in context with caching.
dowlandaiello Oct 7, 2024
6e44e5e
Get osmo tests working.
dowlandaiello Oct 14, 2024
7cce893
Fix a small bug in route exec planning probing conditions.
dowlandaiello Oct 14, 2024
a57f3dd
Increase HTTP timeout.
dowlandaiello Oct 14, 2024
4c14798
Cache query_denom_info.
dowlandaiello Oct 14, 2024
f7d577f
Update integration tests target profit values.
dowlandaiello Oct 14, 2024
42da5b4
Update osmo integration test target profit again.
dowlandaiello Oct 14, 2024
fccaa4c
Add extra comments to one-liners in prefixing.
dowlandaiello Oct 14, 2024
ff18c79
Diable rebalancing logs by default.
dowlandaiello Oct 14, 2024
c27a4fc
Skip logging routes with logs disabled.
dowlandaiello Oct 14, 2024
8e39fa2
Increase http timeout again.
dowlandaiello Oct 14, 2024
2903e15
Use skip API v2.
dowlandaiello Oct 14, 2024
4005233
Lower concurrency factor.
dowlandaiello Oct 14, 2024
6a6bb11
Another route planning fix.
dowlandaiello Oct 14, 2024
00e2b26
Ratelimit skip requests, fix CI failing tests.
dowlandaiello Oct 14, 2024
94a188f
Lower HTTP client timeout.
dowlandaiello Oct 14, 2024
3ad374c
Remove extraneous sources of randomness from integration tests.
dowlandaiello Oct 14, 2024
3ba9498
Disable exhaustive rebalancing attempts.
dowlandaiello Oct 14, 2024
b36b319
See previous.
dowlandaiello Oct 14, 2024
454b858
Log rebalancing routes.
dowlandaiello Oct 14, 2024
70b020c
Put a hard stop on maximum iterations per route planning.
dowlandaiello Oct 14, 2024
f1cf81a
Addm ore debug logs to IBC transfers.
dowlandaiello Oct 14, 2024
107e1b4
See previous.
dowlandaiello Oct 14, 2024
8f9bfef
Allow more concurrent skip calls.
dowlandaiello Oct 14, 2024
260408a
Current status: debugging a blocking skip denom chain info call in tr…
dowlandaiello Oct 14, 2024
efb95e3
Fix dealocks, add caching in binary search.
dowlandaiello Oct 15, 2024
ea0d630
Migrate order history to sqlite.
dowlandaiello Oct 16, 2024
d99c185
Create db.py.
dowlandaiello Oct 16, 2024
2bbce5e
Remove autocommit arg to sqlite connect call.
dowlandaiello Oct 16, 2024
7486a56
Restore old route planning algorithm.
dowlandaiello Oct 16, 2024
ad52f28
See previous.
dowlandaiello Oct 16, 2024
b13e9b8
See previous.
dowlandaiello Oct 16, 2024
060385e
Gate log prefixes behind debug log level.
dowlandaiello Oct 17, 2024
93bc2fe
Remove denom balance prefix caching altogether.
dowlandaiello Oct 17, 2024
15f19a9
Track block heights at which legs in orders are submitted.
dowlandaiello Oct 17, 2024
6d05a26
Linter fixes.
dowlandaiello Oct 17, 2024
fda5eac
Add tests for unprofitable osmosis arbs.
dowlandaiello Oct 18, 2024
b1ab9cf
Use source channel endpoint for packet ack checks.
dowlandaiello Oct 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Debug information is logged to the DEBUG level, including:
* Profit levels for considered trades
* Intermediate debug logs

The log level may be set via the `LOGLEVEL` environment variable. Possible values are: `INFO`, `DEBUG`, or `ERROR`.
The log level may be set via the `LOGLEVEL` environment variable. Possible values are: `info`, `debug`, or `error`.

An example output is as follows:

Expand Down
29 changes: 29 additions & 0 deletions local-interchaintest/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions local-interchaintest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ itertools = "0.13.0"
shared_child = "1.0.0"
clap = { version = "4.5.8", features = ["derive"] }
derive_builder = "0.20.0"
sqlite = { version = "0.36.1" }
2 changes: 1 addition & 1 deletion local-interchaintest/chains/neutron_osmosis_gaia.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
"binary": "osmosisd",
"bech32_prefix": "osmo",
"docker_image": {
"version": "v25.0.4",
"version": "v26.0.2",
"repository": "ghcr.io/strangelove-ventures/heighliner/osmosis"
},
"gas_prices": "0.0025%DENOM%",
Expand Down
65 changes: 57 additions & 8 deletions local-interchaintest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mod util;
const TEST_MNEMONIC: &str = "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry";

/// Path to a file where found arbs are stored
const ARBFILE_PATH: &str = "../arbs.json";
const ARBFILE_PATH: &str = "../arbs.db";

/// The address that should principally own all contracts
const OWNER_ADDR: &str = "neutron1hj5fveer5cjtn4wd6wstzugjfdxzl0xpznmsky";
Expand Down Expand Up @@ -183,7 +183,56 @@ fn main() -> Result<(), Box<dyn StdError + Send + Sync>> {
.with_test(Box::new(tests::test_unprofitable_arb) as TestFn)
.build()?,
)?
/*
// Test case unprofitable osmo arb:
//
// - Astro: untrn-bruhtoken @ 1.5 bruhtoken/untrn
// - Osmo: bruhtoken-uosmo @ 0.001 uosmo/bruhtoken
// - Astro: uosmo-untrn @ 1 untrn/uosmo
.run(
TestBuilder::default()
.with_name("Osmosis Arb")
.with_description("The arbitrage bot not execute an unprofitable arb on Osmosis")
.with_denom(untrn_osmo.clone(), 100000000000)
.with_denom(uosmo.clone(), 100000000000)
.with_denom(bruhtoken.clone(), 100000000000)
.with_denom(untrn.clone(), 100000000000)
.with_denom(bruhtoken_osmo.clone(), 100000000000)
.with_pool(
untrn.clone(),
uosmo_ntrn.clone(),
Pool::Astroport(
AstroportPoolBuilder::default()
.with_balance_asset_a(10000000u128)
.with_balance_asset_b(15000000u128)
.build()?,
),
)
.with_pool(
uosmo.clone(),
bruhtoken_osmo.clone(),
Pool::Osmosis(
OsmosisPoolBuilder::default()
.with_funds(bruhtoken_osmo.clone(), 100000000u128)
.with_funds(uosmo.clone(), 100000u128)
.with_weight(bruhtoken_osmo.clone(), 100u128)
.with_weight(uosmo.clone(), 1u128)
.build(),
),
)
.with_pool(
untrn.clone(),
bruhtoken.clone(),
Pool::Auction(
AuctionPoolBuilder::default()
.with_balance_offer_asset(10000000u128)
.with_price(Decimal::percent(10))
.build()?,
),
)
.with_arbbot()
.with_test(Box::new(tests::test_unprofitable_osmo_arb) as TestFn)
.build()?,
)?
// Test case (astro -> osmo arb):
//
// - Astro: untrn-bruhtoken @ 1.5 bruhtoken/untrn
Expand Down Expand Up @@ -213,7 +262,7 @@ fn main() -> Result<(), Box<dyn StdError + Send + Sync>> {
bruhtoken_osmo.clone(),
Pool::Osmosis(
OsmosisPoolBuilder::default()
.with_funds(bruhtoken_osmo.clone(), 10000000u128)
.with_funds(bruhtoken_osmo.clone(), 100000000u128)
.with_funds(uosmo.clone(), 10000000u128)
.with_weight(bruhtoken_osmo.clone(), 1u128)
.with_weight(uosmo.clone(), 1u128)
Expand All @@ -223,16 +272,16 @@ fn main() -> Result<(), Box<dyn StdError + Send + Sync>> {
.with_pool(
untrn.clone(),
bruhtoken.clone(),
Pool::Astroport(
AstroportPoolBuilder::default()
.with_balance_asset_a(10000000u128)
.with_balance_asset_b(10000000u128)
Pool::Auction(
AuctionPoolBuilder::default()
.with_balance_offer_asset(10000000u128)
.with_price(Decimal::percent(10))
.build()?,
),
)
.with_arbbot()
.with_test(Box::new(tests::test_osmo_arb) as TestFn)
.build()?,
)?*/
)?
.join()
}
Loading
Loading