1 unstable release

0.1.0 Jul 13, 2024

#27 in #ratio

45 downloads per month
Used in 11 crates (3 directly)

MIT/Apache

1.5MB
33K SLoC

Base Token Adjuster

This crate contains all the logic to handle ZK Chain with custom base tokens.

Overview

The Base Token Ratio Persister

Contains the building blockss for the BaseTokenRatioPersisterLayer.

  • Connects with external APIs to get the current price of the base token and of ETH.
  • Persists the ETH<->BaseToken ratio in the database.
  • Upon certain configured threshold, update the L1 ETH<->BaseToken conversion ratio.

The Base Token Ratio Provider

Contains the building blocks for the BaseTokenRatioProviderLayer.

  • Periodically fetches from the DB and caches the latest ETH<->BaseToken conversion ratio.
  • Exposes this ratio upon request.

Dependencies

~85MB
~1.5M SLoC