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

feat(InventoryClient): Support 1:many HubPool mappings #1465

Merged
merged 98 commits into from
May 10, 2024
Merged

Conversation

pxrl
Copy link
Contributor

@pxrl pxrl commented Apr 30, 2024

This update to the InventoryClient permits multiple tokens to map to a single HubPool token. This will be used with USDC/CCTP, where the existing USDC deployment will map to both native USDC and bridged USDC on the various non-mainnet chains supported by Across. See below for an example of how this is configured. Note that the symbol _USDC is the temporary label for native USDC.

  "USDC": {
    "USDC.e": {
      "10": { "targetPct": 8, "thresholdPct": 4 },
      "137": { "targetPct": 4, "thresholdPct": 2 },
      "324": { "targetPct": 8, "thresholdPct": 4 },
      "42161": { "targetPct": 8, "thresholdPct": 4 },
      "59144": { "targetPct": 5, "thresholdPct": 2 }
    },
    "USDbC": {
      "8453": { "targetPct": 5, "thresholdPct": 2 }
    },
    "_USDC": {
      "137": { "targetPct": 4, "thresholdPct": 2 }
    }
  },

pxrl added 7 commits April 30, 2024 09:43
- Only append unwrapWethThreshold for WETH.
- Dereference the l1Token/chainId pair for less repetition.
This change permits the InventoryConfig to be specified in either
HubPool token address or token symbol. Token symbol is preferred because
it's simpler to configure and reduces the chance of mistakes.

During config, any symbols are resolved to their underlying token
addresses on the HubPool chain, so no subsequent changes are required
for any accesses into the post-processed inventory config.
This update to the InventoryClient permits multiple tokens to map to a
single HubPool token. This will be used with USDC/CCTP, where the
existing USDC deployment will map to both native USDC and bridged USDC
on the various non-mainnet chains supported by Across. See below for an
example of how this is configured. Note that the symbol _USDC is the
temporary label for native USDC.

  "USDC": {
    "USDC.e": {
      "10": { "targetPct": 8, "thresholdPct": 4 },
      "137": { "targetPct": 4, "thresholdPct": 1 },
      "324": { "targetPct": 8, "thresholdPct": 4 },
      "42161": { "targetPct": 8, "thresholdPct": 4 },
      "59144": { "targetPct": 5, "thresholdPct": 2 }
    },
    "USDbC": {
      "8453": { "targetPct": 5, "thresholdPct": 2 }
    },
    "_USDC": {
      "137": { "targetPct": 1, "thresholdPct": 1 }
    }
  },
src/clients/InventoryClient.ts Outdated Show resolved Hide resolved
Base automatically changed from pxrl/inventoryConfigSymbols to master May 1, 2024 09:14
src/clients/InventoryClient.ts Outdated Show resolved Hide resolved
@pxrl pxrl changed the base branch from master to pxrl/crossChainTransfer May 9, 2024 12:08
Base automatically changed from pxrl/crossChainTransfer to master May 9, 2024 19:41
Copy link
Contributor

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pxrl pxrl merged commit 8c179a7 into master May 10, 2024
4 checks passed
@pxrl pxrl deleted the pxrl/usdcInventory branch May 10, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants