fluid-contracts-public/deployments/mainnet/VaultLiquidationResolver.json

567 lines
98 KiB
JSON
Raw Normal View History

{
"address": "0x2472c29b0a89800C803975cf187ba3A1b280Ac85",
"abi": [
{
"inputs": [
{
"internalType": "contract IFluidVaultResolver",
"name": "vaultResolver_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "FluidVaultLiquidationsResolver__AddressZero",
"type": "error"
},
{
"inputs": [],
"name": "FluidVaultLiquidationsResolver__InvalidParams",
"type": "error"
},
{
"inputs": [],
"name": "VAULT_RESOLVER",
"outputs": [
{
"internalType": "contract IFluidVaultResolver",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenIn_",
"type": "address"
},
{
"internalType": "address",
"name": "tokenOut_",
"type": "address"
},
{
"internalType": "uint256",
"name": "inAmt_",
"type": "uint256"
}
],
"name": "exactInput",
"outputs": [
{
"internalType": "address",
"name": "vault_",
"type": "address"
},
{
"internalType": "uint256",
"name": "actualInAmt_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "outAmt_",
"type": "uint256"
},
{
"internalType": "bool",
"name": "withAbsorb_",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenIn_",
"type": "address"
},
{
"internalType": "address",
"name": "tokenOut_",
"type": "address"
},
{
"internalType": "uint256",
"name": "outAmt_",
"type": "uint256"
}
],
"name": "exactOutput",
"outputs": [
{
"internalType": "address",
"name": "vault_",
"type": "address"
},
{
"internalType": "uint256",
"name": "inAmt_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "actualOutAmt_",
"type": "uint256"
},
{
"internalType": "bool",
"name": "withAbsorb_",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getAllSwapPairs",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "vault",
"type": "address"
},
{
"internalType": "address",
"name": "tokenIn",
"type": "address"
},
{
"internalType": "address",
"name": "tokenOut",
"type": "address"
}
],
"internalType": "struct Structs.VaultData[]",
"name": "vaultDatas_",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenIn_",
"type": "address"
},
{
"internalType": "address",
"name": "tokenOut_",
"type": "address"
}
],
"name": "getSwapAvailable",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "vault",
"type": "address"
},
{
"internalType": "uint256",
"name": "inAmt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "outAmt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "inAmtWithAbsorb",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "outAmtWithAbsorb",
"type": "uint256"
}
],
"internalType": "struct Structs.SwapData",
"name": "swapData_",
"type": "tuple"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "vault_",
"type": "address"
},
{
"internalType": "address",
"name": "receiver_",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenInAmt_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "tokenOutAmt_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "slippage_",
"type": "uint256"
},
{
"internalType": "bool",
"name": "withAbsorb_",
"type": "bool"
}
],
"name": "getSwapCalldata",
"outputs": [
{
"internalType": "bytes",
"name": "calldata_",
"type": "bytes"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "vault_",
"type": "address"
}
],
"name": "getSwapDataForVault",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "vault",
"type": "address"
},
{
"internalType": "uint256",
"name": "inAmt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "outAmt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "inAmtWithAbsorb",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "outAmtWithAbsorb",
"type": "uint256"
}
],
"internalType": "struct Structs.SwapData",
"name": "swapData_",
"type": "tuple"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address[]",
"name": "tokensIn_",
"type": "address[]"
},
{
"internalType": "address[]",
"name": "tokensOut_",
"type": "address[]"
}
],
"name": "getSwapsAvailable",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "vault",
"type": "address"
},
{
"internalType": "uint256",
"name": "inAmt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "outAmt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "inAmtWithAbsorb",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "outAmtWithAbsorb",
"type": "uint256"
}
],
"internalType": "struct Structs.SwapData[]",
"name": "swapDatas_",
"type": "tuple[]"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenIn_",
"type": "address"
},
{
"internalType": "address",
"name": "tokenOut_",
"type": "address"
}
],
"name": "getVaultForSwap",
"outputs": [
{
"internalType": "address",
"name": "vault_",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address[]",
"name": "tokensIn_",
"type": "address[]"
},
{
"internalType": "address[]",
"name": "tokensOut_",
"type": "address[]"
}
],
"name": "getVaultsForSwap",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "vault",
"type": "address"
},
{
"internalType": "address",
"name": "tokenIn",
"type": "address"
},
{
"internalType": "address",
"name": "tokenOut",
"type": "address"
}
],
"internalType": "struct Structs.VaultData[]",
"name": "vaultDatas_",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0x70aecd1ae7c88b67965e96f072d8138381f87de6dda578345f7835e4530bec42",
"receipt": {
"to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"from": "0x588ee487e23eF3F5291A2F238e26A4846887B4ee",
"contractAddress": null,
"transactionIndex": 0,
"gasUsed": "30404",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000002000000080000000000000000000000000000000000000000000000000000000800000000400000000000000000000000000000000000000000000000000000000000000000040000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000200000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xa16a4ccab52aa5ba4d14486ceb996123538fa1c5892f2dbdf557e67a57bd917a",
"transactionHash": "0x70aecd1ae7c88b67965e96f072d8138381f87de6dda578345f7835e4530bec42",
"logs": [
{
"transactionIndex": 0,
"blockNumber": 15380655,
"transactionHash": "0x228eb378dd973949e28777fb5fd147aa90a2950b6caf2925b510521a520ca731",
"address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"topics": [
"0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65",
"0x000000000000000000000000588ee487e23ef3f5291a2f238e26a4846887b4ee"
],
"data": "0x000000000000000000000000000000000000000000000000001f161421c8e000",
"logIndex": 0,
"blockHash": "0xa16a4ccab52aa5ba4d14486ceb996123538fa1c5892f2dbdf557e67a57bd917a"
}
],
"blockNumber": 15380655,
"cumulativeGasUsed": "30404",
"status": 1,
"byzantium": true
},
"args": [
"0x8DD65DaDb217f73A94Efb903EB2dc7B49D97ECca"
],
"numDeployments": 1,
"solcInputHash": "b8c8b43989e7e1436bbea395bae67e9e",
"metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IFluidVaultResolver\",\"name\":\"vaultResolver_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FluidVaultLiquidationsResolver__AddressZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FluidVaultLiquidationsResolver__InvalidParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAULT_RESOLVER\",\"outputs\":[{\"internalType\":\"contract IFluidVaultResolver\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenIn_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"inAmt_\",\"type\":\"uint256\"}],\"name\":\"exactInput\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"vault_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"actualInAmt_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outAmt_\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"withAbsorb_\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenIn_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"outAmt_\",\"type\":\"uint256\"}],\"name\":\"exactOutput\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"vault_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"inAmt_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualOutAmt_\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"withAbsorb_\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllSwapPairs\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"}],\"internalType\":\"struct Structs.VaultData[]\",\"name\":\"vaultDatas_\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenIn_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut_\",\"type\":\"address\"}],\"name\":\"getSwapAvailable\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"inAmt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outAmt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inAmtWithAbsorb\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outAmtWithAbsorb\",\"type\":\"uint256\"}],\"internalType\":\"struct Structs.SwapData\",\"name\":\"swapData_\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vault_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenInAmt_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenOutAmt_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"slippage_\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"withAbsorb_\",\"type\":\"bool\"}],\"name\":\"getSwapCalldata\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"calldata_\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vault_\",\"type\":\"address\"}],\"name\":\"getSwapDataForVault\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"inAmt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outAmt\",\"type\":\
"bytecode": "0x60a060405234801561001057600080fd5b50604051611cb4380380611cb483398101604081905261002f91610061565b6001600160a01b038116608081905261005b576040516303c99f9d60e61b815260040160405180910390fd5b50610091565b60006020828403121561007357600080fd5b81516001600160a01b038116811461008a57600080fd5b9392505050565b608051611bec6100c860003960008181610159015281816104230152818161057a01528181610d6b01526110570152611bec6000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c80639842d25711610076578063d7e8af8a1161005b578063d7e8af8a146101db578063ed01d023146101ee578063f1c6b20a1461020157600080fd5b80639842d257146101c057806398499999146101d357600080fd5b80634f91e9a5116100a75780634f91e9a5146101345780637f3e2b481461015457806389456d6f146101a057600080fd5b8063404fcab2146100c35780634edc47c814610114575b600080fd5b6100d66100d136600461144a565b610221565b6040805173ffffffffffffffffffffffffffffffffffffffff9095168552602085019390935291830152151560608201526080015b60405180910390f35b61012761012236600461148b565b61036c565b60405161010b91906114a8565b610147610142366004611543565b6104df565b60405161010b91906115af565b61017b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010b565b6101b36101ae366004611624565b610a79565b60405161010b9190611690565b6100d66101ce36600461144a565b610c1c565b610147610d65565b61017b6101e93660046116fc565b611052565b6101276101fc3660046116fc565b6112b7565b61021461020f366004611543565b611313565b60405161010b9190611735565b600080600080600061023388886112b7565b9050806000015194508593506000816060015182608001516b033b2e3c9fd0803ce800000061026291906117f3565b61026c919061180a565b9050816020015187118015610288575081602001518260600151115b156102d8576001925081606001518711156102b0578160600151945081608001519350610361565b6b033b2e3c9fd0803ce80000006102c782896117f3565b6102d1919061180a565b9350610361565b6000826020015183604001516b033b2e3c9fd0803ce80000006102fb91906117f3565b610305919061180a565b90508082111561033b57600193506b033b2e3c9fd0803ce800000061032a838a6117f3565b610334919061180a565b945061035f565b6b033b2e3c9fd0803ce8000000610352828a6117f3565b61035c919061180a565b94505b505b505093509350935093565b6103b46040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160008152602001600081525090565b73ffffffffffffffffffffffffffffffffffffffff82166103d457919050565b6040517f1fcd364900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152600060248301819052917f000000000000000000000000000000000000000000000000000000000000000090911690631fcd36499060440160e0604051808303816000875af115801561046e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049291906118fd565b73ffffffffffffffffffffffffffffffffffffffff9093168252506060808301516020830152608080840151604084015260a08401519183019190915260c0909201519181019190915290565b606060006104ed83866117f3565b905060008167ffffffffffffffff81111561050a5761050a611845565b60405190808252806020026020018201604052801561057357816020015b60408051606081018252600080825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816105285790505b50905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a8d9f4936040518163ffffffff1660e01b8152600401600060405180830381865afa1580156105e3573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610629919081019061199c565b604080516101a081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101829052610180810182905291925090819060005b8451811015610930578481815181106106b5576106b5611a4e565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1663b7791bf26040518163ffffffff1660e01b81526004016101a060405180830381865afa158015610708573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072c9190611a8e565b9150
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100be5760003560e01c80639842d25711610076578063d7e8af8a1161005b578063d7e8af8a146101db578063ed01d023146101ee578063f1c6b20a1461020157600080fd5b80639842d257146101c057806398499999146101d357600080fd5b80634f91e9a5116100a75780634f91e9a5146101345780637f3e2b481461015457806389456d6f146101a057600080fd5b8063404fcab2146100c35780634edc47c814610114575b600080fd5b6100d66100d136600461144a565b610221565b6040805173ffffffffffffffffffffffffffffffffffffffff9095168552602085019390935291830152151560608201526080015b60405180910390f35b61012761012236600461148b565b61036c565b60405161010b91906114a8565b610147610142366004611543565b6104df565b60405161010b91906115af565b61017b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010b565b6101b36101ae366004611624565b610a79565b60405161010b9190611690565b6100d66101ce36600461144a565b610c1c565b610147610d65565b61017b6101e93660046116fc565b611052565b6101276101fc3660046116fc565b6112b7565b61021461020f366004611543565b611313565b60405161010b9190611735565b600080600080600061023388886112b7565b9050806000015194508593506000816060015182608001516b033b2e3c9fd0803ce800000061026291906117f3565b61026c919061180a565b9050816020015187118015610288575081602001518260600151115b156102d8576001925081606001518711156102b0578160600151945081608001519350610361565b6b033b2e3c9fd0803ce80000006102c782896117f3565b6102d1919061180a565b9350610361565b6000826020015183604001516b033b2e3c9fd0803ce80000006102fb91906117f3565b610305919061180a565b90508082111561033b57600193506b033b2e3c9fd0803ce800000061032a838a6117f3565b610334919061180a565b945061035f565b6b033b2e3c9fd0803ce8000000610352828a6117f3565b61035c919061180a565b94505b505b505093509350935093565b6103b46040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160008152602001600081525090565b73ffffffffffffffffffffffffffffffffffffffff82166103d457919050565b6040517f1fcd364900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152600060248301819052917f000000000000000000000000000000000000000000000000000000000000000090911690631fcd36499060440160e0604051808303816000875af115801561046e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049291906118fd565b73ffffffffffffffffffffffffffffffffffffffff9093168252506060808301516020830152608080840151604084015260a08401519183019190915260c0909201519181019190915290565b606060006104ed83866117f3565b905060008167ffffffffffffffff81111561050a5761050a611845565b60405190808252806020026020018201604052801561057357816020015b60408051606081018252600080825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816105285790505b50905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a8d9f4936040518163ffffffff1660e01b8152600401600060405180830381865afa1580156105e3573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610629919081019061199c565b604080516101a081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101829052610180810182905291925090819060005b8451811015610930578481815181106106b5576106b5611a4e565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1663b7791bf26040518163ffffffff1660e01b81526004016101a060405180830381865afa158015610708573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072c9190611a8e565b91506000925060005b8b81101561091f5760005b8a81101561090e578d8d8381811061075a5761075a611a4e565b905060200201602081019061076f919061148b565b73ffffffffffffffffffffffffffffffffffffffff168460a0015173ffffffffffffffffffffffffffffffffffffffff1614801561080257508b8b828181106107ba576107ba611a4e565b90506020020160208101906107cf919061148b565b73ffffffffffffffffffffffffffffffffffffffff16846080015173ffffffffffffff
"devdoc": {
"kind": "dev",
"methods": {
"exactInput(address,address,uint256)": {
"details": "returned data can be fed into `getSwapCalldata` to prepare the tx that executes the swap.",
"params": {
"inAmt_": "exact input token amount that should be swapped to output token",
"tokenIn_": "input token (debt token at vault)",
"tokenOut_": "output token (collateral token at vault)"
},
"returns": {
"actualInAmt_": "actual input token amount. Equals `inAmt_`, but if less then the desired swap amount is available, then the available amount is returned instead.",
"outAmt_": "received output token amount for `actualInAmt_` of input token",
"vault_": "vault address at which the swap is available.",
"withAbsorb_": "flag for using mode \"withAbsorb\". Is set to true if a) liquidity without absorb would not cover the desired `inAmt_` or if b) the rate of with absorb is better than without absorb."
}
},
"exactOutput(address,address,uint256)": {
"details": "returned data can be fed into `getSwapCalldata` to prepare the tx that executes the swap.",
"params": {
"outAmt_": "exact output token amount that should be received as a result of the swap",
"tokenIn_": "input token (debt token at vault)",
"tokenOut_": "output token (collateral token at vault)"
},
"returns": {
"actualOutAmt_": "actual output token amount. Equals `outAmt_`, but if less then the desired swap amount is available, then the available amount is returned instead",
"inAmt_": "required input token amount to receive `actualOutAmt_` of output token",
"vault_": "vault address at which the swap is available.",
"withAbsorb_": "flag for using mode \"withAbsorb\". Is set to true if a) liquidity without absorb would not cover the desired `outAmt_` or if b) the rate of with absorb is better than without absorb."
}
},
"getSwapAvailable(address,address)": {
"details": "returned data can be fed into `getSwapCalldata` to prepare the tx that executes the swap.expected to be called with callStatic, although this method does not do any actual state changes anyway.for native token, send 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE."
},
"getSwapCalldata(address,address,uint256,uint256,uint256,bool)": {
"params": {
"receiver_": "receiver address that the output token is sent to",
"slippage_": "maximum allowed slippage for the expected output token amount. Reverts iIf received token out amount is lower than this. in 1e4 percentage, e.g. 1% = 10000, 0.3% = 3000, 0.01% = 100, 0.0001% = 1.",
"tokenInAmt_": "input token amount (debt token at vault)",
"tokenOutAmt_": "expected output token amount (collateral token at vault)",
"vault_": "vault address at which the liquidation is executed",
"withAbsorb_": "set to true to trigger liquidation with executing `absorb()` first. Liquidity is >= when this is set to true. Rate can be better with or without, check before via other methods."
},
"returns": {
"calldata_": "the calldata that can be used to trigger the liquidation call, resulting in the desired swap."
}
},
"getSwapDataForVault(address)": {
"details": "returned data can be fed into `getSwapCalldata` to prepare the tx that executes the swap.expected to be called with callStatic, although this method does not do any actual state changes anyway."
},
"getSwapsAvailable(address[],address[])": {
"details": "returned data can be fed into `getSwapCalldata` to prepare the tx that executes the swap.expected to be called with callStatic, although this method does not do any actual state changes anyway.for native token, send 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE."
},
"getVaultForSwap(address,address)": {
"details": "for native token, send 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE."
},
"getVaultsForSwap(address[],address[])": {
"details": "for native token, send 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE."
}
},
"version": 1
},
"userdoc": {
"errors": {
"FluidVaultLiquidationsResolver__AddressZero()": [
{
"notice": "thrown if an input param address is zero"
}
],
"FluidVaultLiquidationsResolver__InvalidParams()": [
{
"notice": "thrown if an invalid param is given to a method"
}
]
},
"kind": "user",
"methods": {
"constructor": {
"notice": "constructor sets the immutable vault resolver address"
},
"exactInput(address,address,uint256)": {
"notice": "finds a swap from `tokenIn_` to `tokenOut_` for an exact input amount `inAmt_`. If available amount is less then the desired input amount, it returns the available amount. Considers the best rate available for mode with absorb and mode without absorb."
},
"exactOutput(address,address,uint256)": {
"notice": "finds a swap from `tokenIn_` to `tokenOut_` for an exact output amount `outAmt_`. If available amount is less then the desired output amount, it returns the available amount. Considers the best rate available for mode with absorb and mode without absorb."
},
"getAllSwapPairs()": {
"notice": "returns all token swap pairs available through Fluid Vault Liquidations"
},
"getSwapAvailable(address,address)": {
"notice": "finds the total available swappable amount for a `tokenIn_` to `tokenOut_` swap, considering both a swap that uses liquidation with absorb and without absorb. Sometimes with absorb can provide better swaps, sometimes without absorb can provide better swaps. But available liquidity for \"withAbsorb\" amounts will always be >= normal amounts."
},
"getSwapCalldata(address,address,uint256,uint256,uint256,bool)": {
"notice": "returns the calldata to execute a swap as found through this contract by triggering a vault liquidation. `tokenInAmt_` must come from msg.sender, `tokenOutAmt_` goes to `receiver_`. If the input token is the native token, msg.value must be sent along when triggering the actual call with the returned calldata."
},
"getSwapDataForVault(address)": {
"notice": "returns the available swap (liquidation) amounts at a certain `vault_`, considering both a swap that uses liquidation with absorb and without absorb. Sometimes with absorb can provide better swaps, sometimes without absorb can provide better swaps. But available liquidity for \"withAbsorb\" amounts will always be >= normal amounts."
},
"getSwapsAvailable(address[],address[])": {
"notice": "finds the total available swappable amount for any `tokensIn_` to any `tokesnOut_` swap, considering both a swap that uses liquidation with absorb and without absorb. Sometimes with absorb can provide better swaps, sometimes without absorb can provide better swaps. But available liquidity for \"withAbsorb\" amounts will always be >= normal amounts. Token pairs that are not available will not be listed in returned SwapData array. e.g. for tokensIn_: USDC & USDT and tokensOut_: ETH & wstETH, this would return any available token pair incl. the available swappable amounts, so for USDC -> ETH, USDC -> wstETH, USDT -> ETH, USDT -> wstETH."
},
"getVaultForSwap(address,address)": {
"notice": "returns the vault address for a certain `tokenIn_` swapped to a `tokenOut_`. returns zero address if no vault is available for a given pair."
},
"getVaultsForSwap(address[],address[])": {
"notice": "returns all available token pair swaps for any `tokensIn_` to any `tokensOut_` with the vault address."
}
},
"notice": "Resolver contract that helps in finding available token swaps through Fluid Vault liquidations.",
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}