Skip to content

VDB-8: List UXRP market in Core pool on BNB Chain testnet#725

Draft
trumpgpt-bot wants to merge 2 commits into
mainfrom
bot/VDB-8-list-uxrp-market-in-core-pool-on-bnb-chain-testnet
Draft

VDB-8: List UXRP market in Core pool on BNB Chain testnet#725
trumpgpt-bot wants to merge 2 commits into
mainfrom
bot/VDB-8-list-uxrp-market-in-core-pool-on-bnb-chain-testnet

Conversation

@trumpgpt-bot

Copy link
Copy Markdown

What changed

vips/ (branch bot/VDB-8-...)

  • vips/vip-664/bsctestnet.ts — VIP proposal (ProposalType.REGULAR) listing vUXRP in the Core Pool.
  • simulations/vip-664/bsctestnet.ts + abi/ (Comptroller, ERC20, ResilientOracle, VToken) — fork simulation.

venus-protocol-documentation/

  • deployed-contracts/markets.md — added UXRP (underlying) and vUXRP (market) under BNB Chain Testnet → Core Pool.

venus-protocol/ — param edits + deploy artifacts (MockUXRP, vUXRP) were already committed during the preceding deploy step; no further changes.

Deployed addresses (three-way verified)

Contract Address deploy_result artifact on-chain read
MockUXRP 0xE4090cA6392c35D181164484476A6B09979364c9 deployments/bsctestnet/MockUXRP.json symbol()UXRP
vUXRP 0xDfc35DDed555F2B9E45846fb5E8aB81Fc7c02567 deployments/bsctestnet/vUXRP.json symbol()vUXRP, admin()→NormalTimelock 0xce107…, underlying()→MockUXRP, interestRateModel()0x1CcDaf…6b80, totalSupply()→0 ✓

IRM reused (not redeployed): JumpRateModel … 0x1CcDaf39085bae4e27c3Ba100561b1AD1B5A6b80 — base 0%, multiplier 6.67%/yr, kink 75%, jump 627%/yr (exact match to the requirement, confirmed on-chain as the vUXRP IRM).

VIP command sequence (Core Pool, corePoolId 0)

  1. ChainlinkOracle.setDirectPrice(UXRP, $2.50) — standard testnet ChainlinkOracle; timelock already holds the permission (per vip-596 precedent, no grant needed).
  2. ResilientOracle.setTokenConfig — Chainlink as the sole (main) source.
  3. Unitroller._supportMarket(vUXRP)
  4. _setMarketSupplyCaps([vUXRP],[236e18])
  5. _setMarketBorrowCaps([vUXRP],[236e18])
  6. setIsBorrowAllowed(0, vUXRP, true) — required to enable borrowing (see note below).
  7. setAccessControlManager(ACM), setProtocolShareReserve(PSR), setReduceReservesBlockDelta(28800), _setReserveFactor(0.25)
  8. setCollateralFactor(vUXRP, 0.6, 0.7) (CF / LT), setLiquidationIncentive(vUXRP, 1.1)
  9. Initial liquidity: faucet 0.26 UXRP → mint → burn 0.026 vUXRP → transfer 0.234 vUXRP to VTreasury.

All risk params per spec: CF 60%, LT 70%, LI 10%, RF 25%, supply/borrow caps 236, borrowing enabled.

Key technical decisions

  • Borrowing enablement (non-obvious): the bsctestnet Core Pool is the multi-pool Diamond comptroller; _supportMarket leaves isBorrowAllowed=false, so borrow would revert BorrowNotAllowedInPool. Added setIsBorrowAllowed(0, vUXRP, true). The two most recent market-addition precedents (vip-596, vip-633) pause borrow and never show this path, so it isn't visible by copying them.
  • Oracle staleness: verified in ChainlinkOracle.sol that setDirectPrice stores prices[asset] and getPrice returns it directly, bypassing _getChainlinkPrice's stale check. So UXRP's price never goes stale on the time-warped fork — no setMaxStalePeriod workaround is needed for UXRP (the requirement's staleness concern is handled structurally by using the direct price).
  • Behavioral test signer: the borrow test uses a fresh ethers.getSigners()[0] rather than GENERIC_TEST_USER_ACCOUNT, because that shared testnet account already has 4 markets in assetsIn (vBNB, vXVS, vUSDC, vSXP) whose real feeds go stale on the fork and revert the liquidity check with invalid resilient oracle price. A fresh signer only prices vUXRP (pinned), and self-funds via the mock faucet.

Simulation — npx hardhat test simulations/vip-664/bsctestnet.ts --fork bsctestnet

Fork block 115008600 (just after the MockUXRP/vUXRP deploy txs). Result: 53 passing, 0 failing.

  • Pre-VIP: vUXRP not listed.
  • Execution: full propose→vote→queue→execute; expectEvents asserts MarketListed, NewSupplyCap, NewBorrowCap, BorrowAllowedUpdated, NewAccessControlManager, NewProtocolShareReserve, NewReduceReservesBlockDelta, NewReserveFactor, NewCollateralFactor, NewLiquidationThreshold, NewLiquidationIncentive (×1 each).
  • Post-VIP state: IRM params, checkVToken, checkRiskParameters (RF 0.25, CF 0.6, supply/borrow caps 236), oracle price = $2.50, LT = 0.7, LI = 1.1, isBorrowAllowed = true, admin/ACM/PSR/reduceReservesBlockDelta, total supply, burned + receiver vToken balances.
  • Post-VIP behavioral: a user supplies UXRP and borrows within the CF (balance delta asserted); borrowing beyond the CF reverts; minting beyond the 236 supply cap reverts. (Borrow cap is verified via checkRiskParameters storage — it can't be hit behaviorally below the equal supply cap.)

Lint / typecheck

  • npx eslint vips/vip-664/bsctestnet.ts simulations/vip-664/bsctestnet.ts → clean (exit 0).
  • npx prettier --write applied.
  • npx tsc --noEmit → no vip-664 errors.

Assumptions

  • corePoolId = 0 (established convention, vip-548/vip-599).
  • Converters/DBO/flash-loan config omitted (not requested; vip-633 — the most recent Core-pool addition — also omits them). Reserve factor is still set; testnet reserves simply won't auto-convert.

Opened by the Venus dev bot. Review required; the bot cannot merge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread vips/vip-664/bsctestnet.ts Outdated

Oracle:

- Chainlink integration via Resilient Oracle (direct price of $2.50 on testnet)`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove the mention of direct price in the description.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

2 participants