Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMM: Implement the indexer #606

Closed
Braqzen opened this issue Mar 24, 2023 · 1 comment
Closed

AMM: Implement the indexer #606

Braqzen opened this issue Mar 24, 2023 · 1 comment
Labels
App: AMM Label used to filter for the app issue New Feature New addition that does not currently exist

Comments

@Braqzen
Copy link
Contributor

Braqzen commented Mar 24, 2023

Indexer Guideline

The AMM consists of two contracts therefore we can separate the indexer into two modules.

Each index should contain functions in the format index_<event_name>.

E.g.

#[indexer(manifest = "<path/to/file/amm.manifest.yaml>")]
mod amm_index {
    fn index_register_pool_event(event: RegisterPoolEvent, block: BlockData) { ... }
}

#[indexer(manifest = "<path/to/file/amm-exchange.manifest.yaml>")]
mod amm_exchange_index {
    fn index_add_liquidity_event(event: AddLiquidityEvent, block: BlockData) { ... }

   // more events
}

Each type in graphql should have a required field.

Certain event fields would benefit from the @indexed directive.

  • AMM
    • RegisterPoolEvent
      • asset_pair
      • pool
  • Exchange
    • AddLiquidityEvent
      • added_assets
    • DepositEvent
      • deposited_asset
    • RemoveLiquidityEvent
      • removed_reserve
    • SwapEvent
      • input
      • output
    • WithdrawEvent
      • withdrawn_asset

From the BlockData we should retrieve the block height and add it to each event so that we have a measure of time for when the event took place.

@Braqzen Braqzen added New Feature New addition that does not currently exist App: AMM Label used to filter for the app issue labels Mar 24, 2023
@bitzoic
Copy link
Member

bitzoic commented Feb 21, 2024

Closing in favor of #605

@bitzoic bitzoic closed this as completed Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App: AMM Label used to filter for the app issue New Feature New addition that does not currently exist
Projects
None yet
Development

No branches or pull requests

2 participants