Skip to content

Tools for Arbitrage in Bostrom, Space-Pussy, Osmosis and Crescent Networks

License

Notifications You must be signed in to change notification settings

Snedashkovsky/cyber-arbitrage

Repository files navigation

Arbitrage in Bostrom, Space-Pussy, Osmosis and Crescent Networks

GitHub Python

Pools

TVL on DefiLlama

Price Formulas

Bostrom and Space-Pussy

Tendermint Liquidity Module Light Paper

formulas without orderbook matching (Liquidity Pool Model only)

$$Price = \frac{Target Coin Pool Amount \times (1 - Pool Fee)}{Source Coin Pool Amount + 2 \times Source Coin Amount}$$ $$Target Coin Amount = \frac{Source Coin Amount \times Target Coin Pool Amount \times (1 - Pool Fee)}{Source Coin Pool Amount + 2 \times Source Coin Amount}$$

where Pool Fee = 0.003 as most common value

Osmosis

Module Gamm documentation

$$Price = \frac{Target Coin Pool Amount \times (1 - Pool Fee)}{Source Coin Pool Amount + (1 - Pool Fee) \times Source Coin Amount} \times \frac{Source Coin Pool Weight}{Target Coin Pool Weight}$$ $$Target Coin Amount = \frac{Source Coin Amount \times Target Coin Pool Amount \times (1 - Pool Fee)}{Source Coin Pool Amount + (1 - Pool Fee) \times Source Coin Amount} \times \frac{Source Coin Pool Weight}{Target Coin Pool Weight}$$

Analytics

it's usually more convenient to use the cyb.ai

Get Data

Pools Data

from src.data_extractors import get_pools, get_prices, get_price_enriched

pools_df = get_pools(networks=['bostrom', 'space-pussy', 'osmosis', 'crescent'], bostrom_related_osmo_pools=None)

Direct Prices

price_df = get_prices(pools_df=pools_df)

Enriched Prices

price_df = get_price_enriched(price_df=price_df, base_coin_denom='uosmo')

How to start

you should have python version 3.9, 3.10 or 3.11, check it

python --version

clone repo

git clone https://github.com/Snedashkovsky/cyber-arbitrage && \
cd cyber-arbitrage

install jupyter notebook

pip install notebook

install python requirements

pip install -r requirements.txt

run jupyter notebook

jupyter notebook