WorkflowCredmark Logo

Develop in DeFi & Web3 Simply

A Model Framework Example

Wen-Chiao Su

2022/04/06

Resources to check out:

  • Model Framework Introduction
  • Model Framework Walkthrough
  • How to install and run the Model Framework

Streamline Building in DeFi & Web3

The Credmark Model Framework makes rapid prototyping and deployment of crypto financial models simple. It enables builders to:

  • easily access current and historical blockchain data,
  • use existing validated models (composability FTW!),
  • and build and deploy new models.

Model Plug & Play

Web 3 developers, quants, data scientists, or modelers can immediately get started after forking the credmark-models-py repository. The framework enables the users to access the list of models in the local repository and run local models. Public models are also accessible with API calls. With over 30+ models readily available, builders can significantly reduce the amount of time to begin building useful Web3 software without the complexity of most Web3 development tools.

The web3.py library is complex. The Credmark Model Framework is simple and even more powerful. It reduces the line of code to fetch the same data compared to the web3.py library. In addition, it provides real-time and historical on-chain data of numerous protocols such as Aave, Compound, Uniswap, and Sushiswap. Any builder can use this framework and build applications on top of it. It provides builders with a toolkit and verifiable data all in one place.

Two Examples

To fetch data for each protocol or token can be a repetitive and redundant process. To illustrate the difference between web3.py python library and the Credmark Model Framework, we compare the two methods:

  1. Fetch the total supply of the Credmark ($CMK) token and,
  2. Fetch the pool address of two tokens on Sushiswap.

Fetching the Total Supply of CMK

To provide a fair comparison the inputs for the model are stated below:

Execution of the Model Framework

Result

  • Model Framework: 8 lines of code
  • Web3.py Library: 16 lines of code

Fetching the pool address of two tokens on Sushiswap

  • Token0 as USDC
  • and token1 as WETH

Inputs for the Model Framework

Executing the Model Framework

Result

  • Model Framework: 15 lines of code
  • Web3.py Library: 20 lines of code

Complexity Reduced

The Model Framework abstracts a lot of the complexity involved in the web3.py library. Not only is deploying models easy and fast, the actual inputs to build the models are greatly simplified. Users no longer have to search for the individual token addresses — simply insert the token symbol. Variable declarations are also no longer necessary for the ABIs. We’ve reduced the complexity in the background to offer a better experience to the end-user.

About Credmark

Credmark is a financial modeling platform for DeFi, powered by verifiable on-chain data. It provides the infrastructure necessary to build models. An API allows anyone to consume the output of these models.

Our modeling tools are the most flexible and robust available today. The Credmark Model Framework streamlines prototyping and deployment. Community members are incentivized to build and improve models. As a result, users benefit from verifiable data and best-in-class analyses.

Credmark is a decentralized project. Our community participates in governance, provides research, and develops models. Become a member of Credmark to advance the next-generation financial system.

copy to clipboard

Sign up for our newsletter for the latest product updates, partnerships, and more.

Ready to get started?

Sign up for our free Token API

Get the latest news

Footer

Credmark logo
DiscordDiscord iconTwitterTelegramTelegram iconYoutubeYouTube iconGitHub

© 2023 Credmark Labs, Inc. All rights reserved.

Products

  • All Products
  • Token API
  • Portfolio API
  • DeFi API
  • Raw Data

Documentation

  • Token API Reference
  • Portfolio API Reference
  • DeFi API Reference
  • Transformation Reference
  • Framework Reference

Resources

  • FAQ
  • Blog
  • Reports
  • Media

About

  • Careers
  • About us
  • Community

Support

  • Status
  • Contact us