-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR slightly restructures the price fetching for converting token amount for rewards. - Instead of having functions for converting to and from ETH (`eth_in_token`, `token_in_eth`) we just provide an exchange rate for conversion between two tokens (`exchange_rate_atoms`). This will make it easier to add conversion between COW and the native token of the chain, as well as between XDAI and ETH. - Instead of using token ids as argument, the main function accepts addresses. This is mostly to avoid leaking the implementation of the price fetching (token id on coin paprika) into the rest of the code. It also avoids a circular dependency in making the reward token part of the configuration in #412. The `TokenId` abstraction still feels a bit stange as there is some overlap with `Token` due to decimals. Supporting USDC seems a bit artificial since that is only used for testing and checking that decimals are correctly accounted for. Tests for price fetching were adapted accordingly. Transfers for the accounting week starting on 2024-10-29 only differ on the level of floating point precision. --------- Co-authored-by: Haris Angelidakis <[email protected]>
- Loading branch information
Showing
4 changed files
with
58 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters