DeFiPy

A fully open source, DeFi simulation and modeling python package for users to model liquidity pool positions and parameters using real time, live mainnet data from the 0x Price API

  • 0 Raised
  • 361 Views
  • 0 Judges

Categories

  • ETHDam - Security Track

Gallery

Description

DeFiPy Project Details:

DeFiPy is the first and only open source Python package for modeling in DeFi.

It is a full Python refactor of UniSwap V2 smart contracts (UniSwap V3 coming soon) and uses the 0x Price API for real time data to paper trade LP positions on a front-end dashboard (launched at ETH Denver 2024: Live Dashboard Link)

As opposed to tools that measure profitability of deployed funds, DeFiPy simulates trades for user positions and new protocols alike, allowing for a comprehensive toolset for data scientists to use to gauge risk across dozens of DeFi applications.

By writing the codebase entirely in Python it also removes a barrier to entry for data scientists who may not otherwise be familiar with smart contract languages such as Rust or Solidity, and utilizes the language data scientists are most familiar with.

DeFiPy has already been used to model out the Pachira Token from Sys Labs before it's launch to ensure it will perform well in any market conditions, but we decided to make the tool itself open source under the MIT license to ensure any team or individual can have access to resources that make for a healthier and more stable ecosystem.

ETH Amsterdam Additions:

Github Branch for Hackathon

  • Added premium API key on the backend granted by 0x as part of their JumpStart program in private .env file
  • Gave users forking the repo the ability to specify their own 0x API key while keeping the free API key available if they don't have a key specified in their local .env
  • Added in Supabase integration for managing user records, giving users ability to login with email

We will be adding these additions to the live dashboard link after code review and cleanup so that users have access to additional throughput for live data feeds, can manage their own access, avoid being bottlenecked by the free tier default API key currently provided, and store this information on the application back-end to easily utilize their preferred API access levels while protecting the premium API usage from non-valid users who are unable to authenticate

Attachments