CurveCryptoViews
Last updated
Last updated
Get the amount of coin i one would have to pay for receiving dy of coin j (before any trading fees are charged)
Does not get the identical estimate (i.e. get_dy(get_dx(100))) ~= 100) Question: Why is that the case? Answer: Newton_y stops when the converge limit is reached: https://github.com/curvefi/curve-crypto-contract/blob/d7d04cd9ae038970e40be850df99de8c1ff7241b/contracts/two/CurveCryptoSwap2.vy#L355Should be used for external contracts to get a fairly precise "estimate" of the amount of tokens one has to pay to receive dy tokenssimplified version where we use that PRECISIONS = [1, 1]
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Get the amount of coin j one would receive for swapping dx of coin i
solidity wrapper around CryptoSwap's get_dy
Get the amount of coin j one would have to pay as trading fees for swapping dx of coin i
Get the share of coin j one would have to pay as trading fees for swapping dx of coin i
Get the amount of coin j one would receive for swapping dx of coin i (excl. fees)
solidity implementation of the get_dy excluding the last last line where fees are deductedsimplified version where we use that PRECISIONS = [1, 1] https://github.com/curvefi/curve-crypto-contract/blob/d7d04cd9ae038970e40be850df99de8c1ff7241b/contracts/tricrypto/CurveCryptoViews3.vy#L40-L78
Curve Math Contract
Emitted when the result overflows uint256.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
cryptoSwap
contract ICryptoSwap
Curve Cryptoswap contract
i
uint256
Index of the coin to sell
j
uint256
Index of the coin to buy
dy
uint256
Amount to tokens to receive
_0
uint256
Amount of tokens to sell
cryptoSwap
contract ICryptoSwap
Curve Cryptoswap contract
i
uint256
Index of the coin to sell
j
uint256
Index of the coin to buy
dx
uint256
Amount to sell
_0
uint256
Amount of tokens to received (in j)
cryptoSwap
contract ICryptoSwap
Curve Cryptoswap contract
i
uint256
Index of the coin to sell
j
uint256
Index of the coin to buy
dx
uint256
Amount to sell
_0
uint256
Amount of token j paid as trading fees. 18 decimals
cryptoSwap
contract ICryptoSwap
Curve Cryptoswap contract
i
uint256
Index of the coin to sell
j
uint256
Index of the coin to buy
dx
uint256
Amount to sell
_0
uint256
Share of token j paid as trading fees. 18 decimals
cryptoSwap
contract ICryptoSwap
Curve Cryptoswap contract
i
uint256
Index of the coin to sell
j
uint256
Index of the coin to buy
dx
uint256
Amount to sell
_0
uint256
Amount of tokens to received + Any trading fees paid (in j)
_0
contract IMath
undefined
prod1
uint256
undefined
denominator
uint256
undefined