Documentation

Using the testnet

Getting tokens, what is real and what is mocked.

Network#

FieldValue
NetworkX Layer testnet
Chain ID1952
RPChttps://testrpc.xlayer.tech/terigon
ExplorerOKLink
Gas tokenTestnet OKB

Getting started in three steps#

1. Get gas. You need a small amount of testnet OKB to send any transaction. Claim it from the X Layer faucet.

2. Get collateral. Each market has its own permissionless faucet for its mock stock token, one claim per address. Open any market and find it under Testnet Tools in the sidebar.

3. Get USDG, if you want to lend. USDG is a real testnet token and cannot be minted by this protocol. Claim it from the Paxos faucet. You do not need USDG to borrow, only to supply it as a lender or to repay a loan with interest.

Borrow depth is shallow

The lending pools hold only what has actually been supplied to them. If a borrow fails with an insufficient liquidity error, the pool is empty rather than broken. Supplying USDG through Earn deepens it for everyone.

What is real and what is mocked#

This project has been deliberate about not overstating what is real.

ComponentStatus
USDGReal testnet USDG, 6 decimals, not 18
Collateral tokensMocks, replicating the confirmed wrapped-xStock design
OracleMock contract, fed real equity prices by a keeper
SwapModuleStands in for a DEX, priced off the oracle
Multisig and timelockReal contracts, testnet parameters
AuditNone

Why the collateral is a mock#

No xStock, raw or wrapped, is confirmed to exist on X Layer testnet. Real wNVDAx liquidity does exist on X Layer mainnet. Rather than pretend otherwise, the mock replicates the confirmed wrapped-xStock design: non-rebasing, with value accruing through an exchange rate.

Why the oracle is a mock#

Real equity pricing on X Layer mainnet ships as Chainlink Data Streams, which is pull-based: there is no contract holding a current price to read. Separately, no production feed exposes a pause flag. A corporate-action pause is inferred from the feed going stale, and staleness alone cannot distinguish a corporate action from a weekend.

So the mock reproduces the pause mechanism faithfully rather than assuming a feed that does not exist. Closing that gap on mainnet needs a corporate-action feed or a market-hours calendar, not just a different address.

Real prices, through a mock oracle#

The oracle contract is a mock, but the prices in it are real. A keeper fetches live equity quotes and pushes them in, so the number shown on a market tracks the reference chart beside it rather than sitting at a made-up constant.

This is worth stating precisely: it is a single-key push feed, not a decentralised oracle network. The data is real, the trust model is not. No third-party oracle was available to use instead. Pyth does not deploy on X Layer at all, and Chainlink's equity coverage there is mainnet-only and pull-based, meaning there is no contract holding a current price to read.

A keeper cannot interfere with a halt

setPrice() reverts while the oracle is paused, so no amount of price pushing can overwrite or lift a halt. Only the multisig moves that state. The keeper also skips paused feeds outright, so a market being halted stays visibly frozen while the reference chart keeps moving.

Large moves are stepped, not forced. A single update is capped at 20% deviation to reject suspicious jumps, and rather than loosening that guard the keeper pushes the largest allowed step and converges over successive runs. The guard stays at 20% throughout.

Outside market hours the quote is simply the last close. Pushing it anyway keeps the timestamp fresh without inventing movement that did not happen, which matters because the mocks otherwise age past the 24-hour staleness window and borrowing stops across every market. If borrowing is failing everywhere at once, a stale feed is almost certainly why.

Governance is configured for convenience#

  • The multisig is 1-of-1.
  • The timelock delay is 10 minutes.
  • Neither is a meaningful security boundary as deployed. Both are real contracts, wired correctly, parameterised for a demo. See Governance.

Not audited

Foundry tests and static analysis are engineering hygiene, not a substitute for third-party review. Do not treat anything here as production-ready.