Proposal Date
2025-06-30
Relevant Contracts
LetterOfCredit Proxy Admin: 0x12225bB169b38EF8849DD4F5Cc466ae5996e341D
LetterOfCredit Proxy: 0x14db9a91933aD9433E1A0dB04D08e5D9EF7c4808
LetterOfCredit Singleton v2: 0x24573b112456d3a96c97fb460b436e8ca870e27e
PythPriceOracle: 0xC6f3405c861Fa0dca04EC4BA59Bc189D1d56Ee05
Background
Overview
In order to facilitate additional integrations and use cases that intend to utilize Anvil’s Letter Of Credit (LOC) system, it is productive to revisit the Letter Of Credit related contracts and their configurations. The Anvil team has engaged with various projects to determine how to best leverage the protocol, especially as it comes to dynamic LOC token support. The result of these discussions was the clear preference to expand the tokens that can be leveraged as collateral in dynamic use to include ERC-20 representations of BTC as well as yield bearing assets. Notably, there have been no existing use cases explored that justify an expansion of the credited token offerings. The initial configuration of the LOC contracts in September 2024 included USDT, USDC, and WETH as credited tokens; based on current research it is clear that USDT and USDC are sufficient for credited asset types.
In order to best support the dynamic LOC collateral token additions, the Anvil core team has conducted both internal and external analyses to identify conservative collateral factors for token pairs. This included revisiting the existing collateral factors against updated methodology and latest market conditions. The resulting proposed changes are listed in the “Executed Changes” section.
In addition to token support updates, the team also looked at improvements with regard to maximizing liquidation efficiency as well as the LOC management user experience. This resulted in appending simple and lightweight passthrough parameters to the LOC creation and conversion/redeem/liquidation functionalities as well as reducing the time window in which price updates are valid. These changes are reflected in LetterOfCreditSingletonV2
and are described below.
Note: None of the proposed changes will affect existing LOCs
Description Of Changes
Letter Of Credit Proxy Changes
Collateral Factor Changes
- Adds dLOC support for four (4) new tokens as collateral (cbBTC, sUSDe, WBTC, wstETH), enabling each by adding collateral factors mapping to both USDC and USDT as credited tokens (8 new collateral factors in total)
- Modifies collateral factors set for USDC -> USDT, USDT -> USDC, WETH -> USDC, WETH -> USDT to be in line with latest market analysis (4 updates in total)
- Modifies collateral factors to essentially disable WETH as the credited token (USDC -> WETH, USDT -> WETH) by setting the creation collateral factor and the liquidation collateral factor to 0bps and 1bps respectively
- While this may seem redundant given the changes to the credited token configuration, this is good hygiene. If WETH is re-enabled as a credited token in the future, it requires its collateral factors to be deliberately set .
Credited Token Changes
- Disables WETH support as a credited token in dLOCs by updating its token configuration so that its relevant parameters (min per dLOC, max per dLOC, global max in use) are all set to 0.
Pricing Changes
- Modifies the maximum window that a price update is valid for by reducing the maximum from 5 minutes to 1 minute.
Pyth Price Oracle Changes
- Adds Pyth price feed IDs for the new dLOC collateral tokens to the
PythPriceOracle
contract so that pricing can be calculated (4 in total).
Upgrades To Letter Of Credit Singleton
- Adds fixed length (
bytes32
)tag
as an optional parameter for LOC Creation- Improves UX by giving creators/integrators the ability to associate metadata to the LOC creation
- Not stored in contract state, simply passed through to the emission of the
LOCCreated
event
- Adds a dynamic length (
bytes
)liquidatorParams
optional parameter for functions related to LOC liquidation- This can be leveraged to inform an end liquidator contract how to most efficiently liquidate a position. This will allow liquidator contracts to leverage DEX protocol routers and aggregator protocols to maximize efficiency and access to liquidity.
Executed Changes
Calls LetterOfCreditProxyAdmin.upgradeAndCall(...)
to upgrade LetterOfCreditProxy
to use LetterOfCreditSingletonV2
(0x24573b112456d3a96c97fb460b436e8ca870e27e) as the implementation.
Calls LetterOfCreditProxy.upsertCollateralFactors(...)
to set the following collateral factors:
Collateral Token | Credited Token | Creation Collateral Factor | Collateral Factor (Liquidation) | Liquidator Incentive |
---|---|---|---|---|
cbBTC | USDC | 6000 (60%) | 7100 (71%) | 800 (8%) |
cbBTC | USDT | 6000 (60%) | 7100 (71%) | 800 (8%) |
sUSDe | USDC | 7100 (71%) | 8300 (83%) | 800 (8%) |
sUSDe | USDT | 7100 (71%) | 8300 (83%) | 800 (8%) |
USDC | USDT | 7100 (71%) | 8300 (83%) | 800 (8%) |
USDC | WETH | 0000 (0%) | 0001 (0.01%) | 800 (8%) |
USDT | USDC | 7100 (71%) | 8300 (83%) | 800 (8%) |
USDT | WETH | 0000 (0%) | 0001 (0.01%) | 800 (8%) |
WBTC | USDC | 6000 (60%) | 7100 (71%) | 800 (8%) |
WBTC | USDT | 6000 (60%) | 7100 (71%) | 800 (8%) |
WETH | USDC | 5600 (56%) | 6600 (66%) | 800 (8%) |
WETH | USDT | 5600 (56%) | 6600 (66%) | 800 (8%) |
wstETH | USDC | 5600 (56%) | 6600 (66%) | 800 (8%) |
wstETH | USDT | 5600 (56%) | 6600 (66%) | 800 (8%) |
Calls LetterOfCreditProxy.upsertCreditedTokens(...)
to effectively disable WETH as a credited token for dynamic use by setting the token configuration value for minPerDynamicLOC
, maxPerDynamicLOC
, and globalMaxInUse
all to 0
.
Calls LetterOfCreditProxy.updateMaxPriceUpdateSecondsAgo(...)
to update the valid price window to 60
seconds.
Calls PythPriceOracle.upsertPriceFeedIds(...)
to set price feeds for the following tokens:
Token | Address | Price Feed Id |
---|---|---|
cbBTC | 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf | 0x2817d7bfe5c64b8ea956e9a26f573ef64e72e4d7891f2d6af9bcc93f7aff9a97 |
sUSDe | 0x9D39A5DE30e57443BfF2A8307A4256c8797A3497 | 0xca3ba9a619a4b3755c10ac7d5e760275aa95e9823d38a84fedd416856cdba37c |
WBTC | 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599 | 0xc9d8b075a5c69303365ae23633d4e085199bf5c520a3b90fed1322a0342ffc33 |
wstETH | 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 | 0x6df640f3b8963d8f8358f791f352b8364513f6ab1cca5ed3f1f7b5448980e784 |