{
    "Function": "getSample",
    "File": "contracts/contracts/VelodromeLibrary.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "IRouter",
        "IPair"
    ],
    "Internal Calls": [
        "_getAmountOut"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function getSample(address tokenIn, address tokenOut, bool stable) external view returns (uint) {\n        (uint dec0, uint dec1, uint r0, uint r1, bool st, address t0,) = IPair(router.pairFor(tokenIn, tokenOut, stable)).metadata();\n        uint sample = tokenIn == t0 ? r0*dec1/r1 : r1*dec0/r0;\n        return _getAmountOut(sample, tokenIn, r0, r1, t0, dec0, dec1, st) * 1e18 / sample;\n    }"
}