Skip to main content

Backtesting and forward-testing (via Monte Carlo sims) for DeFi strategies.

Project description

backtest-ape

Backtesting and forward-testing (via Monte Carlo sims) for DeFi strategies.

Installation

hatch build
hatch shell
(backtest-ape) $ ape plugins install .

Build

(backtest-ape) $ ape compile --size

Test

(backtest-ape) $ ape test -s

Usage

(backtest-ape) $ ape run backtester
INFO: Starting 'anvil' process.
You are connected to provider network ethereum:mainnet-fork:foundry.
Runner type (BaseRunner, BaseCurveV2Runner, BaseUniswapV3Runner, CurveV2LPRunner, UniswapV3LPRunner): CurveV2LPRunner
Runner kwarg (ref_addrs): {"pool": "0xD51a44d3FaE010294C616388b506AcdA1bfAAE46"}
Runner kwarg (num_coins): 3
Runner kwarg (amounts): [1000000000000, 5946382600, 820567784927637667840]
Deploying mock ERC20 tokens ...
Start block number: 16219691
Stop block number [-1]:
Step size [1]:
Initializing state of mocks from block number 16219691 ...
Iterating from block number 16219692 to 16270201 with step size 1 ...
Processing block 16219692 ...
State of refs at block 16219692: {'balances': [49753542730360, 299470579545, 42256392553951116624718], 'D': 149811847101739918524603074, 'A_gamma': [183752478137306770270222288013175834186240000, 581076037942835227425498917514114728328226821, 1633548703, 0], 'prices': [16693207875853529503168, 1185215639716509143580], 'total_supply': 179765246450053705933358}
Backtester value at block 16219692: 2981325191662

Results

Curve Tricrypto2 LP position from block 16048833 to 16273534:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

backtest_ape-0.1.0a3.tar.gz (333.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

backtest_ape-0.1.0a3-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file backtest_ape-0.1.0a3.tar.gz.

File metadata

  • Download URL: backtest_ape-0.1.0a3.tar.gz
  • Upload date:
  • Size: 333.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.3

File hashes

Hashes for backtest_ape-0.1.0a3.tar.gz
Algorithm Hash digest
SHA256 db73ab4ed721dee2ec2146546166a0484a87ab495d1fbc9fb7f83d4176784c25
MD5 37ce2f675b23e7f988b994dd5d676f79
BLAKE2b-256 107ffe5d5a378177fd0f983d3d1e5b1719d80aa0f1b177aec034a1dd2b0c3e9a

See more details on using hashes here.

File details

Details for the file backtest_ape-0.1.0a3-py3-none-any.whl.

File metadata

File hashes

Hashes for backtest_ape-0.1.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 9b7722fded86aaa886b8ce84691f17dfdfb2a879102e88a3b057e35c4d748d3b
MD5 5ac89f572e259250b9fa8f0e5e61d801
BLAKE2b-256 33eabbcdbce45a39c0e0bdf22db19a1c3d5f77aeda7b90636c58a17819f574fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page