redistribution-adapters is a utility designed to assist in the redistribution of rewards and voting power for liquidity deposited in DApps.
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.
- 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;
};- Output csv format
// ./{network}/interface.ts
export type OutputDataSchemaRow = {
block_number: number;
block_timestamp: number;
source_address: string;
account_address: string;
weight: string;
};Goal: The list of how much redistribution will be allocated to DApp users.
For each protocol, we are looking for the following:
- Code that uses the above query, fetches all the data and converts it to csv file in below given format.
weightshould be an interger. It should not include any decimal points.
** 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 |
There is an adapter example with Uniswap v2. You can check this.