-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Abstract away vault interactions to its own encapsulating interface - Initial, partial, implementation - Add: Vault abstraction framework to easily work with different onchain vaults - Add: `eth_defi.velvet` - Add: `QuoterV2` support for Uniswap v3 - needed to get Base prices
- Loading branch information
Showing
41 changed files
with
2,709 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule uniswap-v3-periphery
updated
62 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,211 @@ | ||
{ | ||
"_format": "hh-sol-artifact-1", | ||
"contractName": "IQuoterV2", | ||
"sourceName": "contracts/interfaces/IQuoterV2.sol", | ||
"abi": [ | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes", | ||
"name": "path", | ||
"type": "bytes" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "amountIn", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "quoteExactInput", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "amountOut", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "uint160[]", | ||
"name": "sqrtPriceX96AfterList", | ||
"type": "uint160[]" | ||
}, | ||
{ | ||
"internalType": "uint32[]", | ||
"name": "initializedTicksCrossedList", | ||
"type": "uint32[]" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "gasEstimate", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"components": [ | ||
{ | ||
"internalType": "address", | ||
"name": "tokenIn", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "address", | ||
"name": "tokenOut", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "amountIn", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "uint24", | ||
"name": "fee", | ||
"type": "uint24" | ||
}, | ||
{ | ||
"internalType": "uint160", | ||
"name": "sqrtPriceLimitX96", | ||
"type": "uint160" | ||
} | ||
], | ||
"internalType": "struct IQuoterV2.QuoteExactInputSingleParams", | ||
"name": "params", | ||
"type": "tuple" | ||
} | ||
], | ||
"name": "quoteExactInputSingle", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "amountOut", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "uint160", | ||
"name": "sqrtPriceX96After", | ||
"type": "uint160" | ||
}, | ||
{ | ||
"internalType": "uint32", | ||
"name": "initializedTicksCrossed", | ||
"type": "uint32" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "gasEstimate", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes", | ||
"name": "path", | ||
"type": "bytes" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "amountOut", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "quoteExactOutput", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "amountIn", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "uint160[]", | ||
"name": "sqrtPriceX96AfterList", | ||
"type": "uint160[]" | ||
}, | ||
{ | ||
"internalType": "uint32[]", | ||
"name": "initializedTicksCrossedList", | ||
"type": "uint32[]" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "gasEstimate", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"components": [ | ||
{ | ||
"internalType": "address", | ||
"name": "tokenIn", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "address", | ||
"name": "tokenOut", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "amount", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "uint24", | ||
"name": "fee", | ||
"type": "uint24" | ||
}, | ||
{ | ||
"internalType": "uint160", | ||
"name": "sqrtPriceLimitX96", | ||
"type": "uint160" | ||
} | ||
], | ||
"internalType": "struct IQuoterV2.QuoteExactOutputSingleParams", | ||
"name": "params", | ||
"type": "tuple" | ||
} | ||
], | ||
"name": "quoteExactOutputSingle", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "amountIn", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "uint160", | ||
"name": "sqrtPriceX96After", | ||
"type": "uint160" | ||
}, | ||
{ | ||
"internalType": "uint32", | ||
"name": "initializedTicksCrossed", | ||
"type": "uint32" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "gasEstimate", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
} | ||
], | ||
"bytecode": "0x", | ||
"deployedBytecode": "0x", | ||
"linkReferences": {}, | ||
"deployedLinkReferences": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"_format": "hh-sol-artifact-1", | ||
"contractName": "MockObservable", | ||
"sourceName": "contracts/test/MockObservable.sol", | ||
"abi": [ | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "uint32[]", | ||
"name": "secondsAgos", | ||
"type": "uint32[]" | ||
}, | ||
{ | ||
"internalType": "int56[]", | ||
"name": "tickCumulatives", | ||
"type": "int56[]" | ||
}, | ||
{ | ||
"internalType": "uint160[]", | ||
"name": "secondsPerLiquidityCumulativeX128s", | ||
"type": "uint160[]" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "constructor" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "uint32[]", | ||
"name": "secondsAgos", | ||
"type": "uint32[]" | ||
} | ||
], | ||
"name": "observe", | ||
"outputs": [ | ||
{ | ||
"internalType": "int56[]", | ||
"name": "tickCumulatives", | ||
"type": "int56[]" | ||
}, | ||
{ | ||
"internalType": "uint160[]", | ||
"name": "secondsPerLiquidityCumulativeX128s", | ||
"type": "uint160[]" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
], | ||
"bytecode": "0x608060405234801561001057600080fd5b506040516107803803806107808339818101604052606081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825186602082028301116401000000008211171561008557600080fd5b82525081516020918201928201910280838360005b838110156100b257818101518382015260200161009a565b50505050905001604052602001805160405193929190846401000000008211156100db57600080fd5b9083019060208201858111156100f057600080fd5b825186602082028301116401000000008211171561010d57600080fd5b82525081516020918201928201910280838360005b8381101561013a578181015183820152602001610122565b505050509050016040526020018051604051939291908464010000000082111561016357600080fd5b90830190602082018581111561017857600080fd5b825186602082028301116401000000008211171561019557600080fd5b82525081516020918201928201910280838360005b838110156101c25781810151838201526020016101aa565b50505050905001604052505050825160021480156101e1575081516002145b80156101ee575080516002145b61023f576040805162461bcd60e51b815260206004820152601660248201527f496e76616c6964207465737420636173652073697a6500000000000000000000604482015290519081900360640190fd5b60405180606001604052808460008151811061025757fe5b602002602001015163ffffffff1681526020018360008151811061027757fe5b602002602001015160060b81526020018260008151811061029457fe5b6020908102919091018101516001600160a01b03908116909252825160008054928501516040958601519094166b01000000000000000000000002600160581b600160f81b031960069590950b66ffffffffffffff166401000000000266ffffffffffffff60201b1963ffffffff90941663ffffffff1990951694909417929092169290921792909216919091179055805160608101909152835181908590600190811061033e57fe5b602002602001015163ffffffff1681526020018360018151811061035e57fe5b602002602001015160060b81526020018260018151811061037b57fe5b6020908102919091018101516001600160a01b03908116909252825160018054928501516040909501519093166b01000000000000000000000002600160581b600160f81b031960069590950b66ffffffffffffff166401000000000266ffffffffffffff60201b1963ffffffff90931663ffffffff19909416939093179190911691909117929092169190911790555050506103638061041d6000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063883bdbfd14610030575b600080fd5b6100a06004803603602081101561004657600080fd5b81019060208101813564010000000081111561006157600080fd5b82018360208201111561007357600080fd5b8035906020019184602083028401116401000000008311171561009557600080fd5b509092509050610139565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156100e45781810151838201526020016100cc565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561012357818101518382015260200161010b565b5050505090500194505050505060405180910390f35b60008054606091829163ffffffff1690859085908161015457fe5b9050602002013563ffffffff1663ffffffff1614801561019c57506001805463ffffffff16908590859081811061018757fe5b9050602002013563ffffffff1663ffffffff16145b61020757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c696420746573742063617365000000000000000000000000000000604482015290519081900360640190fd5b6040805160028082526060820183526000926020830190803683375050600080548351939450640100000000900460060b9284925061024257fe5b600692830b830b602091820292909201015260018054835164010000000090910490920b91839190811061027257fe5b600692830b90920b602092830291909101820152604080516002808252606082018352600093919290918301908036833750506000805483519394506b010000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16928492506102dd57fe5b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526001805483516b01000000000000000000000090910490921691839190811061032557fe5b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101529092509050925092905056fea164736f6c6343000706000a", | ||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063883bdbfd14610030575b600080fd5b6100a06004803603602081101561004657600080fd5b81019060208101813564010000000081111561006157600080fd5b82018360208201111561007357600080fd5b8035906020019184602083028401116401000000008311171561009557600080fd5b509092509050610139565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156100e45781810151838201526020016100cc565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561012357818101518382015260200161010b565b5050505090500194505050505060405180910390f35b60008054606091829163ffffffff1690859085908161015457fe5b9050602002013563ffffffff1663ffffffff1614801561019c57506001805463ffffffff16908590859081811061018757fe5b9050602002013563ffffffff1663ffffffff16145b61020757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c696420746573742063617365000000000000000000000000000000604482015290519081900360640190fd5b6040805160028082526060820183526000926020830190803683375050600080548351939450640100000000900460060b9284925061024257fe5b600692830b830b602091820292909201015260018054835164010000000090910490920b91839190811061027257fe5b600692830b90920b602092830291909101820152604080516002808252606082018352600093919290918301908036833750506000805483519394506b010000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16928492506102dd57fe5b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526001805483516b01000000000000000000000090910490921691839190811061032557fe5b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101529092509050925092905056fea164736f6c6343000706000a", | ||
"linkReferences": {}, | ||
"deployedLinkReferences": {} | ||
} |
Oops, something went wrong.