{"id":18847151,"url":"https://github.com/anthias-labs/arena","last_synced_at":"2025-04-14T09:32:17.376Z","repository":{"id":247837856,"uuid":"824155335","full_name":"anthias-labs/arena","owner":"anthias-labs","description":"Framework for holistic economic modelling and simulation of Uniswap v4 strategies, hooks and pools.","archived":false,"fork":false,"pushed_at":"2024-11-23T15:54:50.000Z","size":2450,"stargazers_count":23,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-12T13:03:54.026Z","etag":null,"topics":["blockchain","ethereum","rust","uniswap"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/arena-core","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anthias-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-04T13:25:21.000Z","updated_at":"2025-02-20T13:26:37.000Z","dependencies_parsed_at":"2024-08-02T22:43:51.683Z","dependency_job_id":"87cba9f9-c1d9-4cba-8534-66b37d2040ef","html_url":"https://github.com/anthias-labs/arena","commit_stats":null,"previous_names":["arena-rs/arena","anthias-labs/arena"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthias-labs%2Farena","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthias-labs%2Farena/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthias-labs%2Farena/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthias-labs%2Farena/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anthias-labs","download_url":"https://codeload.github.com/anthias-labs/arena/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248854303,"owners_count":21172335,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","ethereum","rust","uniswap"],"created_at":"2024-11-08T03:05:28.776Z","updated_at":"2025-04-14T09:32:16.983Z","avatar_url":"https://github.com/anthias-labs.png","language":"Rust","funding_links":[],"categories":["📑 Table of Contents"],"sub_categories":["From Community"],"readme":"# arena 🏟️\n\n![visitors](https://visitor-badge.laobi.icu/badge?page_id=arena-rs.arena)\n[![Twitter Badge](https://badgen.net/badge/icon/twitter?icon=twitter\u0026label)](https://twitter.com/anthiasxyz)\n![Telegram badge](https://img.shields.io/badge/chat-Discuss-blue?logo=telegram\u0026style=flat-square\u0026link=https://t.me/+U043cjuV5lA2ZDQ8)\n![Github Actions](https://github.com/arena-rs/arena/workflows/lint/badge.svg)\n\n![image](https://github.com/arena-rs/.github/blob/main/arena_banner.png)\n\n\u003e *Arena is a powerful and extensible framework for holistic economic modelling and simulation of Uniswap v4 strategies, hooks and pools.*\n\nTrack how metrics evolve over time, and over various market conditions.\n\nArena has an [examples](https://github.com/arena-rs/arena/tree/main/examples) folder on how to use the framework.\n\n## Overview\n\nArena introduces a novel approach to LP simulation through a highly-configurable event-driven runtime. Each event consists of integral market information for a strategy, from which the actor can derive insight from.\n\nArena is an [alloy](https://alloy.rs) native project, utilizing many crate-native features such as the `sol!` procedural macro, and the `Anvil` testnet node implementation.\n\n## Key features\n- Event-driven simulation runtime.\n- Flexible performance analysis and telemetry.\n- Multi-strategy support.\n- Customizable stochastic process price feeds.\n- Customizable arbitrageur and market dynamics. \n\n## Technical details\nEvery LP strategy must implement the `Strategy` trait. This contains two key methods:\n- `init()` is called upon initialization of the Arena runtime.\n- `process()` is called each discrete timestep of the simulation.\n\nThese methods allow LP strategies to define specific behaviors and heuristics based on general market updates. Both functions are provided with:\n- An `Engine` for liquidity modification\n- A provider connected to the Anvil instance\n- A `Signal` containing comprehensive market information\n\nAdditionally, each LP strategy accepts an `Inspector`. An `Inspector` allows custom behavior to be defined for performance analysis of strategy and continuous telemetry. Arena provides default `Inspector` implementations for CSV output and JSON output. \n\nThe runtime can hold multiple strategies in paralell.\n\nThe price of the Uniswap pool being simulated is set via the `Feed` trait. This allows for custom stochastic processes or backtesting feeds to be defined. The price of the pool is pegged to this price feed by utilizing an arbitrageur. \n\nArena also provides an infinitely liquid exchange, much like centralized exchanges in real markets, which the price is set on. The arbitrageur then swaps between this and the pool, thus tying the two prices.\n\nThe arbitrageur makes swaps every timestep to equalize the price between these two markets. Arena also provides an `Arbitrageur` trait, allowing for custom behaviors to be defined and custom arbitrage strategies. We recommend most users use the `FixedArbitrageur` implementation, which swaps a fixed amount each price equalization. This simulates an inefficient market whilst also tracking the price feed effectively.\n\nBelow is a graph showing the price of the liquid exchange with relation to the Uniswap pool, using a `FixedArbitrageur`. The `FixedArbitrageur` accepts a `depth` parameter, which controls how much is swapped on each timestep. The below graph shows a run with a depth of 100000, which we find is a good balance between tracking granularity and minimizing tracking lag.\n\n![image](./assets/price_tracking_example.jpg)\n\n## Usage\n\nTo use Arena, the Rust programming language alongside the Foundry framework must be installed on your machine. This is commonly achieved using [`rustup`](https://rustup.rs/), and [`foundryup`](https://book.getfoundry.sh/getting-started/installation)\n\nArena can be added to your library or binary with \n```\ncargo add arena-core\n```\n\nIf you wish to build from source, the project can be cloned with:\n```\ngit clone https://github.com/arena-rs/arena.git\ncd arena\ngit submodule update --init --recursive\n```\n\n## Next steps\n\n- Explore the documentation for detailed usage instructions.\n- Check out example strategies in the `examples/` directory.\n\nWe welcome contributions!\n\nSee our [Contributing Guidelines](https://github.com/arena-rs/arena/blob/main/CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthias-labs%2Farena","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanthias-labs%2Farena","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthias-labs%2Farena/lists"}