Markets → rates

VLPricing

Guarded VOW/VCurrency pricing from liquidity pools and approved FX oracles.

What VLPricing is for.

Guarded VOW/VCurrency pricing from liquidity pools and approved FX oracles.

Governance configures voting and FX oracle policy. Applications use view quotes and handle stale/invalid quote reverts.

How it fits together.

  1. Governance configures currency oracle data.
  2. The contract reads pool reserves and current oracle rates.
  3. Callers receive guarded VOW-to-currency or currency-to-VOW quotations.

Declared public interface.

These are the public and external methods declared directly by VLPricing. Inherited token, ownership, and upgrade methods follow their respective standards.

setVoting(address newVoting)Transaction · onlyVoting

Updates the named protocol configuration value or permission.

setFxOracle(address currency, address feed, uint64 maxAge, bool enabled)Transaction · onlyVoting

Updates the named protocol configuration value or permission.

vowForVSC(IUniswapV2Pair vowUSDTPair, IUniswapV2Pair vowVSCPair, address vow, address vsc, uint256 vscAmount, uint256 vowRateTolerance) returns (uint256)Read

Executes the vow for vsc operation.

vscForVOW(IUniswapV2Pair vowUSDTPair, IUniswapV2Pair vowVSCPair, address vow, address vsc, uint256 vowAmount, uint256 vowRateTolerance) returns (uint256)Read

Executes the vsc for vow operation.

registryName() returns (string memory)Read

Returns the human-readable name used for contract registration.

vscPerVOW(IUniswapV2Pair vowUSDTPair, address vow, uint256 vowRateTolerance, bool isUSDRegion, bool usesInternalRate, uint256 oneUSD, address feed, uint256 internalRate, uint256 ratesUpdatedAt, uint256 maxRatesAge) returns (uint256)Read

Executes the vsc per vow operation.

getVOWToVSC(IUniswapV2Pair vowUSDTPair, address vow, uint256 vowRateTolerance, bool isUSDRegion, bool usesInternalRate, uint256 oneUSD, address feed, uint256 internalRate, uint256 ratesUpdatedAt, uint256 maxRatesAge) returns (uint256[2] memory)Read

Reads the requested contract state or calculated result without changing state.

Connect with ethers v6.

import { Contract, JsonRpcProvider, Wallet, encodeBytes32String, parseUnits } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);
const signer = new Wallet(process.env.SIGNER_PRIVATE_KEY, provider);
const at = (address, abi, writable = false) =>
  new Contract(address, abi, writable ? signer : provider);

const pricing = at(PRICING, [
  "function vscForVOW(address,address,address,address,uint256,uint256) view returns (uint256)"
]);
const out = await pricing.vscForVOW(vowUsdtPair, vowVCurrencyPair, vow, vCurrency, amount, 250n);

Use the address for the chain you selected.

Read the deployment manifest or resolve the configured registry entry for the target network. Test on a local or test network before using a privileged signer. See the contract source and contract index for the full interface.