Skip to content

mitosis-org/deprecated-redistribution-adapters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

redistribution-adapters

redistribution-adapters is a utility designed to assist in the redistribution of rewards and voting power for liquidity deposited in DApps.

Redistribution weight by user - Adapters

If you would like to receive support for redistribution, please create a script that can provide each contract that makes up your DApp and the corresponding user weight values in the specified format. There is no specific requirement for how the script should retrieve the data (e.g., Subquery indexer (Goldsky Subgraph), calling an indexing server, etc.). We do provide an example using Goldsky Subgraph.

Code Changes Expected

  1. Create a function like below:
export const getUserWeightsByBlock = async (
  blockNumber: number,
  blockTimestamp: number,
): Promise<OutputDataSchemaRow[]> => {
  // Retrieve data using block number and timestamp
  // YOUR LOGIC HERE
  return output;
};
  1. Output csv format
// ./{network}/interface.ts
export type OutputDataSchemaRow = {
  block_number: number;
  block_timestamp: number;
  source_address: string;
  account_address: string;
  weight: string;
};

Data Requirement

Goal: The list of how much redistribution will be allocated to DApp users.

For each protocol, we are looking for the following:

  1. Code that uses the above query, fetches all the data and converts it to csv file in below given format.
  2. weight should be an interger. It should not include any decimal points.

Output Data Schema

** The address type can be in lowercase, uppercase, or checksum format. We will handle it.

Data Field Notes
block_number
block_timestamp
source_address The contract address, which is one of the DApp contract that the user interacted with
account_address DApp user address
weight Weight for DApp users

Example:

block_number block_timestamp source_address account_address weight
673104 1731922900 0x076d78c2bfbbd82f2b36be69efb3c0963a5dacb6 0x8116358a843d431fd23e69f9406afbfd3e84eb18 1292848549482

Adapter Example

There is an adapter example with Uniswap v2. You can check this.

Adapter Example

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •