{"id":22111159,"url":"https://github.com/volumefi/aavecellar","last_synced_at":"2025-03-24T04:28:43.984Z","repository":{"id":119721200,"uuid":"405219931","full_name":"VolumeFi/aavecellar","owner":"VolumeFi","description":null,"archived":false,"fork":false,"pushed_at":"2021-10-26T13:48:25.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T10:29:36.859Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VolumeFi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-10T21:44:30.000Z","updated_at":"2021-10-26T13:48:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"10760a77-a565-4116-9551-4d396fcb92a5","html_url":"https://github.com/VolumeFi/aavecellar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolumeFi%2Faavecellar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolumeFi%2Faavecellar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolumeFi%2Faavecellar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolumeFi%2Faavecellar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VolumeFi","download_url":"https://codeload.github.com/VolumeFi/aavecellar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245209197,"owners_count":20577999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T10:35:01.590Z","updated_at":"2025-03-24T04:28:43.955Z","avatar_url":"https://github.com/VolumeFi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AAVE Cellar\n\n## Testing and Development on testnet\n\n### Dependencies\n* [nodejs](https://nodejs.org/en/download/) - \u003e=v8, tested with version v14.15.4\n* [python3](https://www.python.org/downloads/release/python-368/) from version 3.6 to 3.8, python3-dev\n* [brownie](https://github.com/iamdefinitelyahuman/brownie) - tested with version [1.14.6](https://github.com/eth-brownie/brownie/releases/tag/v1.14.6)\n* ganache-cli\n\nRun Ganache-cli mainnet-fork environment\n\n```bash\nganache-cli --fork https://mainnet.infura.io/v3/#{YOUR_INFURA_KEY} -p 7545\n```\n\nAdd local network setting to brownie\n\n```bash\nbrownie networks add Development local host=http://127.0.0.1 accounts=10 evm_version=istanbul fork=mainnet port=7545 mnemonic=brownie cmd=ganache-cli timeout=300\n```\n\nDeploy on local ganache-cli network\n\n```bash\nbrownie run scripts/deploy.py --network local\n```\n\nDeploy on mainnet\n\n```bash\nbrownie run scripts/deploy.py --network mainnet\n```\n\n### Running the Tests\n```bash\nbrownie test --network local\n```\n\n## External functions\n\n| Function Name     | Parameters                                 | Note | Description                                                  |\n| ----------------- | ------------------------------------------ | ---- | ------------------------------------------------------------ |\n| transfer          | address _to, uint256 _value                |      |                                                              |\n| approve           | address _spender, uint256 _value           |      |                                                              |\n| transferFrom      | address _from, address _to, uint256 _value |      |                                                              |\n| increaseAllowance | addresss _spender, uint256 _value          |      | Increase allowance                                           |\n| decreaseAllowance | address _spender, uint256 _value           |      | Decrease allowance                                           |\n| deposit           | uint256 amount                             |      | Deposit `u_token` by `u_token` balance                       |\n| withdraw          | uint256 amount                             |      | Withdraw `u_token` by cellar balance                         |\n| reinvest *        | Bytes[256] route, uint256 minPrice         |      | Withdraw all `u_token` and swap into new `u_token`, reinvest. |\n| harvest           | uint256 minPrice                           |      | Collect stkAAVE reward and Convert it into `u_token`, reinvest. |\n| setValidator      | address _validator, bool value             |      |                                                              |\n| transferOwnership | address, newOwner                          |      |                                                              |\n| setLendingPool    | addresss _lendingPool                      |      | Update lendingPool address                                   |\n| owner             |                                            | view |                                                              |\n| name              |                                            | view |                                                              |\n| symbol            |                                            | view |                                                              |\n| decimals          |                                            | pure |                                                              |\n| totalSupply       |                                            | view |                                                              |\n| balanceOf         | address account                            | view |                                                              |\n| allowance         | address owner_, address spender            | view |                                                              |\n| lendingPool       |                                            | view | Address of lending pool of AAVE protocol                     |\n| lp_balance        |                                            | view | crv3crypto LP balance                                        |\n| validator         | address                                    | view | Validator check (bool)                                       |\n\n\n\n### Reinvest\n\n```\nfunction reinvest(Bytes[256] route, uint256 minPrice)\n```\n\n`route` is swap route by UniswapV3. The last effective token is the new asset.\n\nThe meaning of route bytes are as follows.\n\n| Offset(Byte) | Route Data Meaning                                           |\n| ------------ | ------------------------------------------------------------ |\n| 0 - 31       | `Token0`                                                     |\n| 32 - 63      | Fee level of Uniswap V3 from original asset token to `Token0` |\n| 64 - 95      | `Token1` or all below `0` if `Token0` is the new asset token |\n| 96 - 127     | Fee level of Uniswap V3 from `Token0` to `Token1`            |\n| 128 - 159    | `Token2` or all below `0` if `Token1` is the new asset token |\n| 160 - 191    | Fee level of Uniswap V3 from `Token1` to `Token2`            |\n| 192 - 223    | `Token3` or all below `0` if `Token2` is the new asset token |\n| 224 - 255    | Fee level of Uniswap V3 from `Token2` to `Token3`            |\n\n`minPrice` is a limit of the ratio of the new token amount to the old token amount in 18 decimal digits.\nFor example, if the old token is USDC and the new token is WETH, WETH price is 1000USD/WETH at that time, 6 decimal digits for USDC, 18 decimal digits for WETH, 5% slippage, `minPrice` is as follows.\n\n```\nminPrice = 10 ** 18 / (1000 * 10 ** 6) * (95 / 100) * 10 ** 18\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolumefi%2Faavecellar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvolumefi%2Faavecellar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolumefi%2Faavecellar/lists"}