Purpose
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.
Markets → rates
Guarded VOW/VCurrency pricing from liquidity pools and approved FX oracles.
Purpose
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.
Basic workflow
Methods
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 · onlyVotingUpdates the named protocol configuration value or permission.
setFxOracle(address currency, address feed, uint64 maxAge, bool enabled)Transaction · onlyVotingUpdates the named protocol configuration value or permission.
vowForVSC(IUniswapV2Pair vowUSDTPair, IUniswapV2Pair vowVSCPair, address vow, address vsc, uint256 vscAmount, uint256 vowRateTolerance) returns (uint256)ReadExecutes the vow for vsc operation.
vscForVOW(IUniswapV2Pair vowUSDTPair, IUniswapV2Pair vowVSCPair, address vow, address vsc, uint256 vowAmount, uint256 vowRateTolerance) returns (uint256)ReadExecutes the vsc for vow operation.
registryName() returns (string memory)ReadReturns 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)ReadExecutes 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)ReadReads the requested contract state or calculated result without changing state.
Node.js
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);Deployment
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.