├── .gitbook └── assets │ ├── 0ba42e0a-87cc-4694-9a73-52334a5fd28e.png │ ├── 17b75928-d6a2-4207-9a0b-89d1d41690d4.png │ ├── 2024-03-07 13.23.50.jpg │ ├── 2024-03-07 13.24.17.jpg │ ├── 2024-03-07 13.24.30.jpg │ ├── 64b08edf-1ddc-4a51-b38f-6fdabc45df28.png │ ├── 6e01c33d-ac9e-41d6-9542-fc2f3b0ecb90.png │ ├── Dark.svg │ ├── Governance.svg │ ├── Group 55047.png │ ├── Group 55072 (1).png │ ├── Group 55072.png │ ├── Isolated Pools.svg │ ├── Oracles.svg │ ├── Screenshot 2023-08-02 at 10.01.29 AM.png │ ├── Screenshot 2023-08-02 at 9.30.23 AM.png │ ├── Screenshot 2023-08-02 at 9.33.46 AM.png │ ├── Screenshot 2023-08-02 at 9.33.54 AM.png │ ├── Screenshot 2023-08-02 at 9.35.46 AM.png │ ├── Screenshot 2023-08-02 at 9.38.18 AM.png │ ├── Screenshot 2023-08-02 at 9.38.32 AM (1).png │ ├── Screenshot 2023-08-02 at 9.38.32 AM.png │ ├── Screenshot 2023-08-02 at 9.38.48 AM.png │ ├── Screenshot 2023-08-02 at 9.39.02 AM.png │ ├── Screenshot 2023-08-02 at 9.39.11 AM.png │ ├── Screenshot 2024-01-22 at 1.15.11 PM.png │ ├── Screenshot 2024-01-22 at 1.25.29 PM.png │ ├── Screenshot 2024-01-22 at 1.31.35 PM.png │ ├── Screenshot 2024-03-08 at 2.48.53 PM.png │ ├── Screenshot 2024-03-08 at 2.51.30 PM.png │ ├── Screenshot 2024-03-12 at 8.50.41 AM.png │ ├── Screenshot 2024-03-12 at 8.51.21 AM.png │ ├── VIP_actions_5-4.jpg │ ├── VIP_confirm_5-5.jpg │ ├── VIP_create_modal_3.png │ ├── VIP_create_proposal_3 (1).jpg │ ├── VIP_create_proposal_3.jpg │ ├── VIP_import_confirm_4-2.png │ ├── VIP_proposal_info_5-2.jpg │ ├── VIP_select_type_5-1.jpg │ ├── VIP_voting_options_5-3.jpg │ ├── Venus_account.png │ ├── XVS_bridge_BNB_to_dest.svg │ ├── XVS_bridge_dest_to_BNB.svg │ ├── XVS_bridge_risks.svg │ ├── apy_graph_transparent.png │ ├── apy_graph_transparent_2500.png │ ├── apy_graph_transparent_2500_aligned.png │ ├── apy_graph_transparent_2500_corrected_labels.png │ ├── apy_graph_transparent_2500_spaced (1).png │ ├── apy_graph_transparent_2500_spaced.png │ ├── auctions.png │ ├── automatic-income-allocation.svg │ ├── b79b9065-5c69-4a0e-bd3f-7e3199086527.png │ ├── borrow.png │ ├── brand_kit │ ├── VAI │ │ ├── VAI.png │ │ ├── VAI.svg │ │ ├── VAI_2x.png │ │ └── preview.png │ ├── XVS │ │ ├── XVS.png │ │ ├── XVS.svg │ │ ├── XVS_2x.png │ │ └── preview.png │ ├── logo_black │ │ ├── preview.png │ │ ├── venus_logo_black.png │ │ ├── venus_logo_black.svg │ │ └── venus_logo_black_2x.png │ ├── logo_white │ │ ├── preview.png │ │ ├── venus_logo_white.png │ │ ├── venus_logo_white.svg │ │ └── venus_logo_white_2x.png │ ├── sign │ │ ├── preview.png │ │ ├── venus_sign.png │ │ ├── venus_sign.svg │ │ └── venus_sign_2x.png │ ├── sign_Prime │ │ ├── preview.png │ │ ├── venus_sign_Prime.png │ │ ├── venus_sign_Prime.svg │ │ └── venus_sign_Prime_2x.png │ └── vTokens │ │ ├── preview.png │ │ └── vTokens_set.zip │ ├── capped-oracle.svg │ ├── deposit.png │ ├── diamond-facets.svg │ ├── diamond-hierarchy.svg │ ├── diamond-previous.svg │ ├── fd111ec8-a057-490c-bb3d-d1a8c026bb12.png │ ├── gasless-zksync-features.png │ ├── gasless-zksync-metamask.png │ ├── gasless-zksync-network-selection.png │ ├── gasless-zksync-rabby.png │ ├── governance.png │ ├── image (1) (1).png │ ├── image (1).png │ ├── image (2) (1).png │ ├── image (2).png │ ├── image (3) (1).png │ ├── image (3).png │ ├── image (4) (1).png │ ├── image (4).png │ ├── image (5) (1).png │ ├── image (5) (2).png │ ├── image (5).png │ ├── image (6).png │ ├── image (7).png │ ├── image.png │ ├── isolated-pools.png │ ├── omnichain_governance_contracts.svg │ ├── omnichain_governance_vip_states.svg │ ├── oracles.png │ ├── overview.svg │ ├── photo_5823567984126443307_y.jpg │ ├── photo_5823567984126443308_y.jpg │ ├── photo_5823567984126443309_y.jpg │ ├── photo_5823567984126443310_y.jpg │ ├── prime_funds.svg │ ├── prime_token_converter.svg │ ├── private_conversions_sequence.svg │ ├── protocol-share-reserve.png │ ├── psm.png │ ├── redeem.png │ ├── repay-borrow.png │ ├── risk-management.png │ ├── swagger.json │ ├── token-converters.svg │ ├── token_converter_funds.svg │ ├── token_converters_sequence.svg │ ├── tokenomics.svg │ ├── two_kinks_ir.svg │ ├── unwrap_eth_uniswap.png │ └── wrap_eth_uniswap.png ├── .gitignore ├── .yarnrc.yml ├── CODEOWNERS ├── README.md ├── SUMMARY.md ├── deployed-contracts ├── deployed-contracts.md ├── funds.md ├── governance.md ├── markets.md ├── oracles.md ├── token-converters.md └── xvs-omnichain.md ├── getting-started └── faq.md ├── governance ├── decentralization.md └── tokenomics.md ├── guides ├── borrowing-vai.md ├── gasless-transactions-zksync.md ├── governance-guide │ ├── delegating.md │ └── vip.md ├── governance │ └── README.md ├── market-interaction │ ├── interface.md │ ├── liquidation.md │ └── supply-borrow.md ├── protocol-math.md ├── vaults.md └── xvs-bridge.md ├── links ├── brand-kit.md └── community-resources.md ├── package.json ├── resources.md ├── risk ├── interest-rate-model.md ├── resilient-price-oracle.md ├── risk-fund-and-shortfall-handling.md └── risk-management.md ├── security-and-audits.md ├── services ├── api.md └── subgraphs.md ├── technical-reference ├── contracts-overview.md ├── reference-core-pool │ ├── README.md │ ├── comptroller │ │ ├── README.md │ │ ├── comptroller-lens.md │ │ └── diamond │ │ │ ├── README.md │ │ │ ├── diamond-consolidated.md │ │ │ ├── diamond.md │ │ │ └── facets │ │ │ ├── README.md │ │ │ ├── facet-base.md │ │ │ ├── market-facet.md │ │ │ ├── policy-facet.md │ │ │ ├── reward-facet.md │ │ │ └── setter-facet.md │ ├── interestratemodels │ │ ├── README.md │ │ ├── interestratemodellens.md │ │ ├── jumpmodel.md │ │ ├── twokinksinterestratemodel.md │ │ └── whitepapermodel.md │ ├── liquidator.md │ ├── prime │ │ ├── README.md │ │ ├── prime-liquidity-provider.md │ │ ├── prime-storage.md │ │ └── prime.md │ ├── psm │ │ └── peg-stability.md │ ├── vaults │ │ ├── README.md │ │ ├── vai │ │ │ ├── README.md │ │ │ ├── vai-vault-proxy.md │ │ │ └── vai-vault.md │ │ └── xvs │ │ │ ├── README.md │ │ │ ├── xvs-store.md │ │ │ ├── xvs-vault-proxy.md │ │ │ ├── xvs-vault-treasury.md │ │ │ └── xvs-vault.md │ ├── vbnbadmin.md │ ├── venus-lens.md │ ├── vtoken.md │ └── vtreasury.md ├── reference-governance │ ├── README.md │ ├── access-control-manager.md │ ├── access-controlled-v5.md │ ├── access-controlled-v8.md │ ├── base-omnichain-controller-dest.md │ ├── base-omnichain-controller-src.md │ ├── governor-bravo-delegate.md │ ├── governor-bravo-delegator.md │ ├── governor-bravo-interfaces.md │ ├── omnichain-executor-owner.md │ ├── omnichain-governance-executor.md │ ├── omnichain-proposal-sender.md │ └── timelock.md ├── reference-isolated-pools │ ├── README.md │ ├── comptroller │ │ ├── README.md │ │ ├── comptroller-storage.md │ │ └── comptroller.md │ ├── interest-rate-models │ │ ├── README.md │ │ ├── base-jump-rate-model-v2.md │ │ ├── interest-rate-model.md │ │ ├── jump-rate-model-v2.md │ │ ├── two-kinks-interest-rate-model.md │ │ └── white-paper-interest-rate-model.md │ ├── lens │ │ └── pool-lens.md │ ├── native-token-gateway │ │ └── native-token-gateway.md │ ├── pool-registry │ │ ├── README.md │ │ ├── pool-registry-interface.md │ │ └── pool-registry.md │ ├── rewards │ │ └── rewards-distributor.md │ ├── risk-fund-and-shortfall │ │ ├── README.md │ │ ├── protocol-share-reserve.md │ │ ├── risk-fund-storage.md │ │ ├── risk-fund-v2.md │ │ └── shortfall.md │ ├── utility │ │ ├── README.md │ │ ├── error-reporter.md │ │ ├── exponential-no-error.md │ │ └── max-loops-limit-helper.md │ └── vtoken │ │ ├── README.md │ │ ├── vtoken-interfaces.md │ │ └── vtoken.md ├── reference-oracle │ ├── README.md │ ├── correlated-token-oracles │ │ ├── README.md │ │ ├── ankr-bnb-oracle.md │ │ ├── as-bnb-oracle.md │ │ ├── bnbx-oracle.md │ │ ├── common │ │ │ └── correlated-token-oracle.md │ │ ├── one-jump-oracle.md │ │ ├── pendle-oracle.md │ │ ├── sfrax-oracle.md │ │ ├── sfrx-ethoracle.md │ │ ├── slis-bnb-oracle.md │ │ ├── stk-bnb-oracle.md │ │ ├── wbeth-oracle.md │ │ ├── we-ETH-accountant-oracle.md │ │ ├── we-ETH-oracle.md │ │ └── wst-ETH-oracle.md │ ├── oracles │ │ ├── PythOracle.md │ │ ├── README.md │ │ ├── binance-oracle.md │ │ ├── bound-validator.md │ │ ├── chainlink-oracle.md │ │ └── sequencer-chainlink-oracle.md │ └── resilient-oracle.md ├── reference-technical-articles │ ├── README.md │ ├── automatic-income-allocation.md │ ├── capped-oracles.md │ ├── contributing.md │ ├── diamond-comptroller.md │ ├── native-token-gateway.md │ ├── omnichain-governance.md │ ├── prime.md │ ├── shortfall-and-auctions.md │ ├── token-converters.md │ ├── two-kinks-interest-rate-curve.md │ └── xvs-bridge.md ├── reference-token-converter │ ├── AbstractTokenConverter.md │ ├── ConverterNetwork.md │ ├── README.md │ ├── RiskFundConverter.md │ └── SingleTokenConverter.md └── reference-xvs-bridge │ ├── BaseXVSProxyOFT.md │ ├── README.md │ ├── TokenController.md │ ├── XVS.md │ ├── XVSBridgeAdmin.md │ ├── XVSProxyOFTDest.md │ └── XVSProxyOFTSrc.md ├── tokens ├── vai-controller.md ├── vai-unitroller.md ├── vai.md └── xvs.md ├── whats-new ├── automatic-income-allocation.md ├── isolated-pools.md ├── prime-yield.md ├── psm.md ├── reward-distributor.md ├── stable-rate-borrowing.md └── token-converter.md ├── whitepapers ├── Venus-whitepaper-v1.pdf └── Venus-whitepaper-v4.pdf └── yarn.lock /.gitbook/assets/0ba42e0a-87cc-4694-9a73-52334a5fd28e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/0ba42e0a-87cc-4694-9a73-52334a5fd28e.png -------------------------------------------------------------------------------- /.gitbook/assets/17b75928-d6a2-4207-9a0b-89d1d41690d4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/17b75928-d6a2-4207-9a0b-89d1d41690d4.png -------------------------------------------------------------------------------- /.gitbook/assets/2024-03-07 13.23.50.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/2024-03-07 13.23.50.jpg -------------------------------------------------------------------------------- /.gitbook/assets/2024-03-07 13.24.17.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/2024-03-07 13.24.17.jpg -------------------------------------------------------------------------------- /.gitbook/assets/2024-03-07 13.24.30.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/2024-03-07 13.24.30.jpg -------------------------------------------------------------------------------- /.gitbook/assets/64b08edf-1ddc-4a51-b38f-6fdabc45df28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/64b08edf-1ddc-4a51-b38f-6fdabc45df28.png -------------------------------------------------------------------------------- /.gitbook/assets/6e01c33d-ac9e-41d6-9542-fc2f3b0ecb90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/6e01c33d-ac9e-41d6-9542-fc2f3b0ecb90.png -------------------------------------------------------------------------------- /.gitbook/assets/Group 55047.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Group 55047.png -------------------------------------------------------------------------------- /.gitbook/assets/Group 55072 (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Group 55072 (1).png -------------------------------------------------------------------------------- /.gitbook/assets/Group 55072.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Group 55072.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2023-08-02 at 10.01.29 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2023-08-02 at 10.01.29 AM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2023-08-02 at 9.30.23 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2023-08-02 at 9.30.23 AM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2023-08-02 at 9.33.46 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2023-08-02 at 9.33.46 AM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2023-08-02 at 9.33.54 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2023-08-02 at 9.33.54 AM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2023-08-02 at 9.35.46 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2023-08-02 at 9.35.46 AM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2023-08-02 at 9.38.18 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2023-08-02 at 9.38.18 AM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2023-08-02 at 9.38.32 AM (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2023-08-02 at 9.38.32 AM (1).png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2023-08-02 at 9.38.32 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2023-08-02 at 9.38.32 AM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2023-08-02 at 9.38.48 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2023-08-02 at 9.38.48 AM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2023-08-02 at 9.39.02 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2023-08-02 at 9.39.02 AM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2023-08-02 at 9.39.11 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2023-08-02 at 9.39.11 AM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2024-01-22 at 1.15.11 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2024-01-22 at 1.15.11 PM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2024-01-22 at 1.25.29 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2024-01-22 at 1.25.29 PM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2024-01-22 at 1.31.35 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2024-01-22 at 1.31.35 PM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2024-03-08 at 2.48.53 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2024-03-08 at 2.48.53 PM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2024-03-08 at 2.51.30 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2024-03-08 at 2.51.30 PM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2024-03-12 at 8.50.41 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2024-03-12 at 8.50.41 AM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2024-03-12 at 8.51.21 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Screenshot 2024-03-12 at 8.51.21 AM.png -------------------------------------------------------------------------------- /.gitbook/assets/VIP_actions_5-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/VIP_actions_5-4.jpg -------------------------------------------------------------------------------- /.gitbook/assets/VIP_confirm_5-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/VIP_confirm_5-5.jpg -------------------------------------------------------------------------------- /.gitbook/assets/VIP_create_modal_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/VIP_create_modal_3.png -------------------------------------------------------------------------------- /.gitbook/assets/VIP_create_proposal_3 (1).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/VIP_create_proposal_3 (1).jpg -------------------------------------------------------------------------------- /.gitbook/assets/VIP_create_proposal_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/VIP_create_proposal_3.jpg -------------------------------------------------------------------------------- /.gitbook/assets/VIP_import_confirm_4-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/VIP_import_confirm_4-2.png -------------------------------------------------------------------------------- /.gitbook/assets/VIP_proposal_info_5-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/VIP_proposal_info_5-2.jpg -------------------------------------------------------------------------------- /.gitbook/assets/VIP_select_type_5-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/VIP_select_type_5-1.jpg -------------------------------------------------------------------------------- /.gitbook/assets/VIP_voting_options_5-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/VIP_voting_options_5-3.jpg -------------------------------------------------------------------------------- /.gitbook/assets/Venus_account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/Venus_account.png -------------------------------------------------------------------------------- /.gitbook/assets/apy_graph_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/apy_graph_transparent.png -------------------------------------------------------------------------------- /.gitbook/assets/apy_graph_transparent_2500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/apy_graph_transparent_2500.png -------------------------------------------------------------------------------- /.gitbook/assets/apy_graph_transparent_2500_aligned.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/apy_graph_transparent_2500_aligned.png -------------------------------------------------------------------------------- /.gitbook/assets/apy_graph_transparent_2500_corrected_labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/apy_graph_transparent_2500_corrected_labels.png -------------------------------------------------------------------------------- /.gitbook/assets/apy_graph_transparent_2500_spaced (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/apy_graph_transparent_2500_spaced (1).png -------------------------------------------------------------------------------- /.gitbook/assets/apy_graph_transparent_2500_spaced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/apy_graph_transparent_2500_spaced.png -------------------------------------------------------------------------------- /.gitbook/assets/auctions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/auctions.png -------------------------------------------------------------------------------- /.gitbook/assets/b79b9065-5c69-4a0e-bd3f-7e3199086527.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/b79b9065-5c69-4a0e-bd3f-7e3199086527.png -------------------------------------------------------------------------------- /.gitbook/assets/borrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/borrow.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/VAI/VAI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/VAI/VAI.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/VAI/VAI.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/VAI/VAI_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/VAI/VAI_2x.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/VAI/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/VAI/preview.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/XVS/XVS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/XVS/XVS.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/XVS/XVS.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/XVS/XVS_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/XVS/XVS_2x.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/XVS/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/XVS/preview.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/logo_black/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/logo_black/preview.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/logo_black/venus_logo_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/logo_black/venus_logo_black.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/logo_black/venus_logo_black_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/logo_black/venus_logo_black_2x.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/logo_white/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/logo_white/preview.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/logo_white/venus_logo_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/logo_white/venus_logo_white.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/logo_white/venus_logo_white_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/logo_white/venus_logo_white_2x.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/sign/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/sign/preview.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/sign/venus_sign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/sign/venus_sign.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/sign/venus_sign.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/sign/venus_sign_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/sign/venus_sign_2x.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/sign_Prime/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/sign_Prime/preview.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/sign_Prime/venus_sign_Prime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/sign_Prime/venus_sign_Prime.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/sign_Prime/venus_sign_Prime.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/sign_Prime/venus_sign_Prime_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/sign_Prime/venus_sign_Prime_2x.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/vTokens/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/vTokens/preview.png -------------------------------------------------------------------------------- /.gitbook/assets/brand_kit/vTokens/vTokens_set.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/brand_kit/vTokens/vTokens_set.zip -------------------------------------------------------------------------------- /.gitbook/assets/deposit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/deposit.png -------------------------------------------------------------------------------- /.gitbook/assets/fd111ec8-a057-490c-bb3d-d1a8c026bb12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/fd111ec8-a057-490c-bb3d-d1a8c026bb12.png -------------------------------------------------------------------------------- /.gitbook/assets/gasless-zksync-features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/gasless-zksync-features.png -------------------------------------------------------------------------------- /.gitbook/assets/gasless-zksync-metamask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/gasless-zksync-metamask.png -------------------------------------------------------------------------------- /.gitbook/assets/gasless-zksync-network-selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/gasless-zksync-network-selection.png -------------------------------------------------------------------------------- /.gitbook/assets/gasless-zksync-rabby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/gasless-zksync-rabby.png -------------------------------------------------------------------------------- /.gitbook/assets/governance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/governance.png -------------------------------------------------------------------------------- /.gitbook/assets/image (1) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/image (1) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/image (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (2) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/image (2) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/image (2).png -------------------------------------------------------------------------------- /.gitbook/assets/image (3) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/image (3) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (3).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/image (3).png -------------------------------------------------------------------------------- /.gitbook/assets/image (4) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/image (4) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (4).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/image (4).png -------------------------------------------------------------------------------- /.gitbook/assets/image (5) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/image (5) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (5) (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/image (5) (2).png -------------------------------------------------------------------------------- /.gitbook/assets/image (5).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/image (5).png -------------------------------------------------------------------------------- /.gitbook/assets/image (6).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/image (6).png -------------------------------------------------------------------------------- /.gitbook/assets/image (7).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/image (7).png -------------------------------------------------------------------------------- /.gitbook/assets/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/image.png -------------------------------------------------------------------------------- /.gitbook/assets/isolated-pools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/isolated-pools.png -------------------------------------------------------------------------------- /.gitbook/assets/oracles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/oracles.png -------------------------------------------------------------------------------- /.gitbook/assets/photo_5823567984126443307_y.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/photo_5823567984126443307_y.jpg -------------------------------------------------------------------------------- /.gitbook/assets/photo_5823567984126443308_y.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/photo_5823567984126443308_y.jpg -------------------------------------------------------------------------------- /.gitbook/assets/photo_5823567984126443309_y.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/photo_5823567984126443309_y.jpg -------------------------------------------------------------------------------- /.gitbook/assets/photo_5823567984126443310_y.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/photo_5823567984126443310_y.jpg -------------------------------------------------------------------------------- /.gitbook/assets/protocol-share-reserve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/protocol-share-reserve.png -------------------------------------------------------------------------------- /.gitbook/assets/psm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/psm.png -------------------------------------------------------------------------------- /.gitbook/assets/redeem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/redeem.png -------------------------------------------------------------------------------- /.gitbook/assets/repay-borrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/repay-borrow.png -------------------------------------------------------------------------------- /.gitbook/assets/risk-management.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/risk-management.png -------------------------------------------------------------------------------- /.gitbook/assets/unwrap_eth_uniswap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/unwrap_eth_uniswap.png -------------------------------------------------------------------------------- /.gitbook/assets/wrap_eth_uniswap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/.gitbook/assets/wrap_eth_uniswap.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .yarn/* 3 | !.yarn/patches 4 | !.yarn/plugins 5 | !.yarn/releases 6 | !.yarn/sdks 7 | !.yarn/versions 8 | 9 | .DS_Store 10 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @coreyar @kkirka 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | Launched in 2020, Venus Protocol (a.k.a. “Venus”) pushed the edges of decentralized finance through its composition of two pre-existing solutions and deployment on BNB chain, lowering the barrier to entry for millions of new users around the globe. By combining the stablecoin minting facility introduced by Maker and algorithmic money markets developed by Compound, Venus simplified the user experience and provided core capabilities that enabled decentralized finance to flourish in a single application. As a result, Venus found remarkable success and quickly rose to be one of the most widely used decentralized applications in web3. 4 | 5 | The latest iteration of Venus Protocol, the most trusted and battle-tested lending and borrowing protocol on the BNB Chain, builds on prior successes and lessons learned to improve in 3 key areas: 6 | 7 | 1. Risk management 8 | 2. Decentralization 9 | 3. User experience 10 | 11 | In doing so, Venus continues to push the boundaries of what's possible within the realm of decentralized finance. 12 | 13 |
14 | -------------------------------------------------------------------------------- /deployed-contracts/deployed-contracts.md: -------------------------------------------------------------------------------- 1 | # Deployed Contracts 2 | -------------------------------------------------------------------------------- /getting-started/faq.md: -------------------------------------------------------------------------------- 1 | # FAQ 2 | 3 | ### **What is Venus Protocol?** 4 | 5 | Venus Protocol is a trusted decentralized finance lending and borrowing protocol that's deployed on the BNB Chain. Initially launched in 2020, it combines the stablecoin minting facility of Maker and the algorithmic money markets developed by Compound, providing a simplified user experience and core capabilities in a single application. 6 | 7 | ### How do I interact with Venus Protocol? 8 | 9 | Interacting with Venus V4 is straightforward. Supply your chosen asset and the amount to start earning interest. Additionally, once you supply assets, you can also borrow against them. Any interest earned from supplying assets can help offset the interest you accrue when borrowing. 10 | 11 | ### Where are my supplied funds stored? 12 | 13 | Your supplied funds are stored in a smart contract on the BNB Chain. The contract's code is public, open-source, and has been formally verified and audited by external auditors. You can withdraw your funds on demand or receive Venus Tokens (vTokens) representing your stake. vTokens are as freely tradable as any other cryptographic asset on BNB Chain. 14 | 15 | ### **What is the cost of interacting with Venus Protocol?** 16 | 17 | Transactions on the Venus V4 protocol require BNB Chain fees, which depend on network congestion and the complexity of the transaction. 18 | 19 | ### **Is there any risk?** 20 | 21 | No platform can be considered entirely risk-free. Risks associated with Venus V4 include smart contract risk and liquidation risk. However, every possible step has been taken to minimize these risks, including making the protocol code public and conducting thorough audits. 22 | 23 | ### **What are the key areas Venus Protocol V4 aims to improve?** 24 | 25 | Venus Protocol focuses on improving three main areas: 26 | 27 | * **Risk Management:** Prioritizing the risk management , Venus introduces new features like Isolated Pools and more sophisticated risk parameters. 28 | * **Decentralization:** The governance model has been enhanced by introducing fast-track VIPs, role-based access control, and a fine-grained pause mechanism. 29 | * **User Experience:** The latest version offers an enhanced user interface, a more effective reward system, and isolated lending. Future releases for V4 will feature stable rate borrowing and the Venus Prime Soulbound Token, all aimed at providing a smooth user experience. 30 | 31 | ### **What is the Resilient Price Oracle?** 32 | 33 | The Resilient Price Oracle introduced in Venus V4 fetches prices from multiple sources and validates them, providing a more reliable price indicator and protecting against price manipulations. It supports the integration of new price oracles and allows enabling and disabling price oracles per token. 34 | 35 | ### **What are Isolated Pools?** 36 | 37 | Isolated Pools are a new feature in Venus V4, designed to overcome the limitations of a single core pool. Each Isolated Pool is an independent collection of assets with custom risk management configurations. This setup allows users to better manage their risk and earn yield, while also preventing failures in one market from impacting others. 38 | 39 | ### **What is the Risk Fund?** 40 | 41 | In Venus V4, a risk fund is maintained for each pool. A percentage of the protocol's revenue is deposited into this fund, aiming to counterbalance bad debt and prevent potential market insolvencies. 42 | 43 | ### **What changes were made to the governance model in Venus V4?** 44 | 45 | Venus V4 features a new governance model that introduces fast-track Venus Improvement Proposals (VIPs), role-based access control, and a fine-grained pause mechanism. This new model allows for more agile and accurate decision-making, ensuring the protocol remains competitive and secure. 46 | -------------------------------------------------------------------------------- /governance/decentralization.md: -------------------------------------------------------------------------------- 1 | # VIPs 2 | 3 | ### Overview 4 | 5 | Venus Protocol's governance relies on participants locking XVS tokens into a vault to acquire voting power for Venus Improvement Proposals (VIPs). A 48-hour timelock period after voting ensures transparency and protection against malicious proposals. However, the initial model's rigidity prompted the introduction of a new governance structure in Venus V4. This upgraded model incorporates fast-track VIPs, role-based access control, and a fine-grained pause mechanism for enhanced flexibility and timely adjustments. 6 | 7 | ### Governance Upgrade 8 | 9 | Venus V4 introduces an improved governance structure with the following components: 10 | 11 | * Fast-track and Critical VIPs 12 | * Role-based access control 13 | * Fine-grained pause 14 | 15 | **Fast-track and Critical Improvement Proposals** 16 | 17 | Venus Governance has now categorized VIPs into three types: Normal, Fast-track, and Critical. 18 | 19 | * **Normal VIPs** encompass significant updates like contract upgrades or changes in access controls. 20 | * **Fast-track VIPs** deal with risk parameter adjustments such as interest rates or collateral factors. 21 | * **Critical VIPs** are utilized during emergencies demanding an immediate reaction. 22 | 23 | Each VIP type has its unique proposal threshold, timelock, and voting periods, reflecting the potential risk and impact of the proposed changes. 24 | 25 | The initial voting and delay periods for these types are as follows: 26 | 27 | * Normal VIP: 24 hour voting period + 48 hour delay (+ 48 hour delay to execute commands on networks other than BNB Chain) 28 | * Fast-track VIP: 24 hour voting period + 6 hour delay (+ 6 hour delay to execute commands on networks other than BNB Chain) 29 | * Critical VIP: 6 hour voting period + 1 hour delay (+ 1 hour delay to execute commands on networks other than BNB Chain) 30 | 31 | **Role-based Access Control** 32 | 33 | Venus V4 employs a separate Access Control Manager contract that validates access permissions rather than merely verifying the caller as an "admin". This allows certain actions to bypass voting, enabling them to take the fast-track or critical route, or even to be executed directly through a multisig by guardians. It can be particularly useful for implementing borrowing and supply caps, pausing specific market actions, or responding to rapid market fluctuations. 34 | 35 | **Fine-grained Pause** 36 | 37 | A fine-grained pause mechanism allows the pause guardian to individually halt any action on any market. Unlike previous versions, where the entire protocol was paused for damage control or protection against attacks, the updated model enables guardians to pause individual market actions like supply, borrow, and enabling collateral, offering greater control and flexibility. 38 | 39 |

Governance Process

40 | -------------------------------------------------------------------------------- /governance/tokenomics.md: -------------------------------------------------------------------------------- 1 | # Tokenomics 2 | 3 | ### Overview 4 | 5 | The Venus Protocol tokenomics have been reevaluated to optimize income distribution and cater to the protocol's present and future needs. [Version 4.0](https://snapshot.org/#/venus-xvs.eth/proposal/0x21c89f6b5d7c9e453b3bac64b23c1d81fe52ff4f23ba0b64674c34217c3f9245) of the Venus Protocol revenue distribution model addresses the need and optimizes the allocation between rewards and treasury reserves. 6 | 7 | ### XVS Vault Base Rewards 8 | 9 | The XVS Staking Vault is an integral component of the Venus ecosystem. It enables governance voting participation and is a prerequisite for Venus Prime eligibility. To incentivize XVS staking, additional rewards will be offered in the form of Base Rewards (previously referred to as Legacy Rewards). 10 | 11 | These rewards will be transferred every six months from the [XVS Distributor](https://bscscan.com/address/0xfd36e2c2a6789db23113685031d7f16329158384) to the [XVS Vault Store](https://www.bscscan.com/address/0x1e25cf968f12850003db17e0dba32108509c4359), where they will be emitted at a rate of 308.7 XVS per day. 12 | 13 | ### Revenue Distribution from Protocol Reserves 14 | 15 | Protocol reserves are mainly composed of accumulated borrow fees. The model for revenue allocation from these reserves divides income into three main segments: 16 | 17 | * **Treasury Reserve (60%)**: The treasury reserve is used to fund community-driven initiatives and essential protocol expenses for its ongoing operations. 18 | * **XVS Vault Rewards (20%)**: This allocation is designated for the buyback of XVS, which is then distributed via vault rewards. 19 | * **Venus Prime Token Program (20%)**: Used to boost select market APYs with organic rewards for users that qualify. 20 | 21 | ### Allocation for Additional Revenue Streams 22 | 23 | Other revenue streams include liquidation penalties and potential income generated from future product releases. The revenue distribution for these streams is as follows: 24 | 25 | * **Treasury Reserves (80%)** 26 | * **XVS Vault Rewards (20%)** 27 | 28 | The methodology behind these adjustments includes an assessment of the existing tokenomics, past changes, their impact on the ecosystem, and analysis of market dynamics and trends. 29 | 30 | This dual allocation model accounts for the diverse revenue sources within the Venus Protocol ecosystem, ensuring robust and responsive financial management. As the protocol evolves and introduces new products, these models may further be adjusted to optimally serve the Venus community. 31 | 32 |
33 | -------------------------------------------------------------------------------- /guides/borrowing-vai.md: -------------------------------------------------------------------------------- 1 | # Borrowing VAI 2 | 3 | ### Introduction 4 | 5 | This guide provides step-by-step instructions on how to borrow VAI, the stablecoin of Venus Protocol, **available exclusively for prime users.** Borrowing involves using your account's **total core pool** **collateral** to secure the loan, and this tutorial will walk you through the VAI UI to accomplish this. 6 | 7 | ### Steps for Borrowing VAI 8 | 9 | #### Step 1: Access VAI Borrowing UI 10 | 11 | Navigate to the Venus Protocol website and select the "VAI" option from the sidebar menu. This will take you to the VAI dashboard, where you can manage your borrowings and repayments. 12 | 13 | #### Step 2: Connect Your Wallet 14 | 15 | Click on the "Connect wallet" button in the top right corner of the VAI dashboard to connect your wallet. This is necessary to interact with the Venus Protocol and manage your VAI borrowings. 16 | 17 |
18 | 19 | #### Step 3: Enter Borrow Amount 20 | 21 | In the "Borrow" tab, enter the amount of VAI you wish to borrow in the provided field. You can also see your maximum borrow limit based on your account's total collateral. Ensure that the amount you wish to borrow does not exceed this limit. 22 | 23 |
24 | 25 | #### Step 4: Review and Confirm Borrowing 26 | 27 | After entering the desired amount, review the details of your borrowing transaction, including the collateral used and the borrow limit. Once you've confirmed that everything is correct, click on the "Borrow" button to initiate the transaction. 28 | 29 | A wallet pop-up will appear, asking for your confirmation to proceed with the transaction. Confirm to finalize the borrowing process. 30 | 31 | ### Repaying VAI Debt 32 | 33 | #### Step 1: Navigate to Repay Tab 34 | 35 | To repay your VAI debt, access the VAI dashboard again and select the "Repay" tab. This interface allows you to make repayments towards your borrowed VAI. 36 | 37 |
38 | 39 | #### Step 2: Enter Repayment Amount 40 | 41 | In the "Repay" tab, enter the amount of VAI you wish to repay. You can choose to repay part of your debt or the entire amount. 42 | 43 | #### Step 3: Review and Confirm Repayment 44 | 45 | Review your repayment details carefully. Once you are ready, click on the "Repay VAI" button to proceed. Confirm the transaction in your wallet pop-up to complete the repayment process. 46 | 47 | ### Conclusion 48 | 49 | Borrowing and repaying VAI on Venus Protocol is straightforward with the VAI UI. By following these steps and ensuring you have enough collateral, you can manage your stablecoin needs effectively. Always be mindful of your borrow limits and repayment responsibilities to maintain a healthy financial position within the protocol. 50 | -------------------------------------------------------------------------------- /guides/gasless-transactions-zksync.md: -------------------------------------------------------------------------------- 1 | This guide will walk you through the steps to interact with Venus Protocol on ZKsync without needing ETH to cover gas fees, thanks to the integration of [Zyfi Paymaster](https://www.zyfi.org/). All transactions will be sponsored, so you can focus on using the protocol without worrying about gas expenses. 2 | 3 | ## Step-by-Step Guide 4 | 5 | ### Step 1: Connect to ZKsync on Venus 6 | 7 | 1. Open the [Venus app](https://app.venus.io) and connect your wallet. 8 | 2. Make sure you are connected to the ZKsync network. If you are not, switch your wallet’s network to ZKsync. 9 | 10 |
Selection of ZKsync network
Selection of ZKsync network
11 | 12 | ### Step 2: Interact with the Venus Protocol 13 | 14 | In this example, we will approve the use of the ZK market as collateral. 15 | 16 | 1. Navigate to the ZK market on Venus. 17 | 2. Click on "Collateral" to enable the use of this market as collateral. 18 | 19 |
Interaction with any feature on ZKsync
Interaction with any feature on ZKsync
20 | 21 | ### Step 3: Sign the Transaction 22 | 23 | 1. Instead of sending a typical transaction, you will be prompted to **sign a message**. This step authorizes Zyfi to pay for the gas fee of the transaction on your behalf. 24 | 2. Sign the message in your wallet. The gas for the transaction will be covered by Zyfi Paymaster, so you **don’t need ETH** in your wallet. 25 | 3. Once signed, Zyfi processes the transaction, and it is sent to the ZKsync blockchain with gas paid through their vault. 26 | 27 |
Sign a message with Rabby, instead of sending a transaction
Sign a message with Rabby, instead of sending a transaction
28 | 29 |
Sign a message with Metamask, instead of sending a transaction
Sign a message with Metamask, instead of sending a transaction
30 | 31 | ### Viewing the Transaction 32 | 33 | You can verify the transaction on the [ZKsync Explorer](https://explorer.zksync.io/). The transaction will display Zyfi as the Paymaster, covering the gas fees. -------------------------------------------------------------------------------- /guides/governance/README.md: -------------------------------------------------------------------------------- 1 | # Governance 2 | -------------------------------------------------------------------------------- /guides/market-interaction/interface.md: -------------------------------------------------------------------------------- 1 | # Venus interface 2 | 3 | Let's take a quick look at the Venus interface and the features available in each menu of the navigation bar. 4 | 5 | ### Dashboard 6 | 7 | In the center of the Dashboard interface, you will find the Supply and Borrow markets. You'll also notice a new column called 'Pool' which identifies the pool to which each market belongs. The Supply market allows you to lend your cryptocurrency assets and earn interest on them. You can choose which assets to supply and specify the amount you want to lend. On the other hand, the Borrow market allows you to borrow cryptocurrency assets by using your supplied assets as collateral. You can select the assets you want to borrow and specify the amount you need. 8 | 9 |
10 | 11 | ### Account 12 | 13 | The Account interface provides an overview of your supplied and borrowed assets. Here, you can keep track of your balances and monitor the status of your transactions. 14 | 15 |
16 | 17 | ### Core Pool 18 | 19 | The Core Pool interface is your hub for exploring all primary markets available. It allows you to click on each market to examine essential metrics such as 'Supply APY', 'Borrow APY', and 'Total Liquidity', among others. This interface centralizes all your lending and borrowing activities within the main markets. 20 | 21 |
22 | 23 | ### Pools 24 | 25 | The Pools interface allows you to explore all isolated pools available. You can click on each pool to view all the markets within it. In the markets, you can see various metrics such as 'Supply APY', 'Borrow APY', 'Total Liquidity', and more. 26 | 27 |
28 | 29 | ### Vaults 30 | 31 | The Vaults interface allows you to access and manage the vaults associated with Venus Protocol. Vaults are designed to provide users with automated strategies for optimizing their yields and managing their assets more efficiently. 32 | 33 |
34 | 35 | ### Swap 36 | 37 | The Swap interface enables you to swap one cryptocurrency for another within the Venus Protocol. You can exchange your assets conveniently and quickly. 38 | 39 |
40 | 41 | ### History 42 | 43 | In the History interface, you can review transaction history and track your previous activities on the Protocol. 44 | 45 |
46 | 47 | ### Governance 48 | 49 | The Governance interface provides access to Venus Protocol's governance features. Here, users can participate in voting and contribute to decision-making processes that shape the future of the protocol. 50 | 51 |
52 | 53 | ### XVS 54 | 55 | The XVS interface displays the current daily reward distribution rate for each of the protocol markets. 56 | 57 |
58 | 59 | ### VAI 60 | 61 | The VAI interface is where you can mint and manage the VAI stablecoin. VAI is created on Venus Protocol and is pegged to the value of one USD. 62 | 63 |
64 | -------------------------------------------------------------------------------- /guides/vaults.md: -------------------------------------------------------------------------------- 1 | # Vaults 2 | 3 | Vaults within Venus Protocol provide a secure and efficient mechanism for users to stake their tokens, whether XVS or VAI, and earn passive income. This staking process allows users to actively participate in and contribute to the stability and security of the Venus ecosystem, while maximizing returns on their holdings. 4 | 5 | **Staking in XVS Vault** 6 | 7 | 1. Navigate to the Venus app (app.venus.io) and connect your BNB Chain Wallet or other supported wallet apps. 8 | 2. On the left side of the screen, click on the 'Vault' tab. 9 | 3. A new screen will display two options: XVS and VAI vaults. Select the 'XVS' vault. 10 | 4. Once you select the XVS vault, a new interface will show. Click the 'Stake' button. 11 | 5. A pop-up will appear asking for the amount of XVS you want to stake. Input the desired amount and confirm. 12 | 6. After entering the amount, a prompt will ask for the transaction's confirmation in your wallet. Confirm this. 13 | 7. Once you've staked your XVS tokens, the interface will show the staked amount, your potential rewards, and other vault statistics. 14 | 15 | **Staking in VAI Vault** 16 | 17 | 1. Follow the same steps as above to access the 'Vault' tab in the Venus app. 18 | 2. This time, select the 'VAI' vault. 19 | 3. Upon clicking on the 'VAI' vault, you'll see the option to 'Stake'. 20 | 4. Enter the amount of VAI you'd like to stake and confirm the staking action. 21 | 5. Just like with the XVS vault, you'll need to confirm the transaction in your wallet. 22 | 6. After staking, the interface will show the staked amount, potential rewards, and other relevant statistics related to the VAI vault. 23 | -------------------------------------------------------------------------------- /guides/xvs-bridge.md: -------------------------------------------------------------------------------- 1 | # XVS Bridge 2 | 3 | ### Introduction 4 | 5 | This guide provides step-by-step instructions on how to bridge XVS tokens from the BNB Chain to the Ethereum network. 6 | 7 | ### Steps for Bridging XVS from BNB Chain to Ethereum 8 | 9 | #### Step 1: Access the Venus Bridge 10 | 11 | * Navigate to the Venus Protocol and select the "Bridge" option from the sidebar menu. [XVS Bridge](https://app.venus.io/#/bridge) 12 | 13 | #### Step 2: Connect Your Wallet 14 | 15 | * Click on the "Connect wallet" button in the top right corner of the Venus Bridge interface to connect your wallet. 16 | 17 |
18 | 19 | #### Step 3: Configure the Bridge Transaction 20 | 21 | * **From**: Ensure "BNB mainnet" is selected in the "From" dropdown menu. 22 | * **To**: Select "Ethereum" in the "To" dropdown menu to set the destination network. 23 | 24 |
25 | 26 | #### Step 4: Enter the Amount to Bridge 27 | 28 | * Enter the amount of XVS you wish to transfer in the "Amount" field. You can also use the "MAX" button to transfer the total available balance. 29 | * Check your "Wallet balance" to confirm you have sufficient XVS and BNB for gas fees. 30 | 31 | #### Step 5: Approve XVS Token 32 | 33 | * Before initiating the transfer, you must give the bridge contract permission to access your XVS tokens. Click on the "Approve XVS" button to do this. 34 | * A wallet pop-up will request your confirmation for the approval. Confirm to proceed. 35 | 36 |
37 | 38 | #### Step 6: Initiate the Transfer 39 | 40 | * After approving XVS token usage, the interface will update to reflect the next step. Click the "Transfer" button (which replaces the "Approve XVS" button after approval) to initiate the bridging process. 41 | * A confirmation pop-up will appear in your wallet for you to approve the transaction. 42 | 43 | #### Step 7: Confirm and Wait 44 | 45 | * Confirm the transaction in your wallet. The Venus Bridge interface will show the transaction as pending, indicating that it is being processed. This may take a few minutes. 46 | 47 | #### Step 8: Transaction Completion 48 | 49 | * Once the transaction is complete, the XVS tokens will be available in your Ethereum wallet. 50 | 51 | ### Conclusion 52 | 53 | Bridging XVS tokens from BNB Chain to Ethereum is made simple with the Venus Protocol. Remember to approve your tokens for use by the bridge and to check transaction details carefully before confirming to ensure a smooth bridging experience. 54 | -------------------------------------------------------------------------------- /links/brand-kit.md: -------------------------------------------------------------------------------- 1 | # Brand kit 2 | 3 | ## Venus logo (dark) 4 | 5 |
Venus logo dark
6 | 7 | [[SVG](../.gitbook/assets/brand_kit/logo_black/venus_logo_black.svg)] [[PNG](../.gitbook/assets/brand_kit/logo_black/venus_logo_black.png)] [[PNG 2x](../.gitbook/assets/brand_kit/logo_black/venus_logo_black_2x.png)] 8 | 9 | ## Venus logo (light) 10 | 11 |
Venus logo light
12 | 13 | [[SVG](../.gitbook/assets/brand_kit/logo_white/venus_logo_white.svg)] [[PNG](../.gitbook/assets/brand_kit/logo_white/venus_logo_white.png)] [[PNG 2x](../.gitbook/assets/brand_kit/logo_white/venus_logo_white_2x.png)] 14 | 15 | ## Venus sign 16 | 17 |
Venus sign
18 | 19 | [[SVG](../.gitbook/assets/brand_kit/sign/venus_sign.svg)] [[PNG](../.gitbook/assets/brand_kit/sign/venus_sign.png)] [[PNG 2x](../.gitbook/assets/brand_kit/sign/venus_sign_2x.png)] 20 | 21 | ## Venus Prime sign 22 | 23 |
Venus Prime sign
24 | 25 | [[SVG](../.gitbook/assets/brand_kit/sign_Prime/venus_sign_Prime.svg)] [[PNG](../.gitbook/assets/brand_kit/sign_Prime/venus_sign_Prime.png)] [[PNG 2x](../.gitbook/assets/brand_kit/sign_Prime/venus_sign_Prime_2x.png)] 26 | 27 | ## XVS logo 28 | 29 |
XVS logo
30 | 31 | [[SVG](../.gitbook/assets/brand_kit/XVS/XVS.svg)] [[PNG](../.gitbook/assets/brand_kit/XVS/XVS.png)] [[PNG 2x](../.gitbook/assets/brand_kit/XVS/XVS_2x.png)] 32 | 33 | ## VAI logo 34 | 35 |
VAI logo
36 | 37 | [[SVG](../.gitbook/assets/brand_kit/VAI/VAI.svg)] [[PNG](../.gitbook/assets/brand_kit/VAI/VAI.png)] [[PNG 2x](../.gitbook/assets/brand_kit/VAI/VAI_2x.png)] 38 | 39 | ## VTokens logo 40 | 41 |
VAI logo
42 | 43 | [[ZIP](../.gitbook/assets/brand_kit/vTokens/vTokens_set.zip)] -------------------------------------------------------------------------------- /links/community-resources.md: -------------------------------------------------------------------------------- 1 | # Community Resources 2 | 3 | ## Monitoring 4 | 5 | * [Dune dashboard](https://dune.com/xvslove\_team/venus-protocol-dashboard) 6 | * [Chaos labs analytics](https://community.chaoslabs.xyz/venus/risk/overview) 7 | * [Messari dashboard](https://messari.io/project/venus/protocols/venus) 8 | 9 | ## Telegram Groups 10 | 11 | * [Venus Discussion Group](https://t.me/venusprotocol) 12 | * [Venus Announcement Channel](https://t.me/VenusNewsBroadcast) 13 | 14 | ### Telegram Bots 15 | 16 | * [Venus Stats](https://t.me/venusstats). Total supply, total borrow, total reserves, XVS Vault stats, Prime holders, etc. 17 | * [Venus Whales](https://t.me/venuswhaleswatch). Watching for significant sum movement (> $1M) on Venus Protocol 18 | * [Venus Liquidations](https://t.me/venusliqwatch). Watching on liquidation events of Venus Protocol 19 | * [Venus Governance](https://t.me/venusgovwatch). Watching governance proposals (VIP) of Venus Protocol 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "venus-protocol-documentation", 3 | "version": "0.0.0", 4 | "description": "Venus Protocol Documentation", 5 | "repository": "git@github.com:VenusProtocol/venus-protocol-documentation.git", 6 | "author": "Venus", 7 | "license": "ISC", 8 | "scripts": { 9 | "format": "remark . --output", 10 | "format:check": "remark . -f" 11 | }, 12 | "devDependencies": { 13 | "remark-cli": "^11.0.0", 14 | "remark-preset-lint-consistent": "^5.1.2", 15 | "remark-preset-lint-recommended": "^6.1.3", 16 | "remark-toc": "^8.0.1" 17 | }, 18 | "remarkConfig": { 19 | "settings": { 20 | "bullet": "*", 21 | "listItemIndent": "one", 22 | "strong": "*", 23 | "emphasis": "*", 24 | "rule": "-" 25 | }, 26 | "plugins": [ 27 | "remark-preset-lint-consistent", 28 | "remark-preset-lint-recommended", 29 | [ 30 | "remark-lint-list-item-indent", 31 | "space" 32 | ], 33 | [ 34 | "remark-lint-code-block-style", 35 | "fenced" 36 | ], 37 | [ 38 | "remark-lint-no-consecutive-blank-lines", 39 | false 40 | ], 41 | [ 42 | "remark-toc", 43 | { 44 | "heading": "contents" 45 | } 46 | ] 47 | ] 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /resources.md: -------------------------------------------------------------------------------- 1 | # Resources 2 | 3 | We have compiled a list of helpful resources to provide you with the necessary information. Whether you are a new user or an experienced one, this page is designed to address the most frequently asked questions and concerns about our protocol. We understand that sometimes you may need additional support beyond this page, so we encourage you to visit our [community forum](https://community.venus.io/). There, you can engage with our community and ask any additional questions. We hope you find this resource helpful and informative 4 | 5 | * [How to Use Venus Protocol Mini Program on Binance App?](https://medium.com/venusprotocol/how-to-use-venus-protocol-mini-program-on-binance-app-226b76a85312) 6 | * [How To Use Venus Guide?](https://medium.com/venusprotocol/how-to-use-venus-protocol-71cb09703fbf) 7 | * [How to setup BNB Chain on MetaMask?](https://medium.com/venusprotocol/venus-protocol-main-network-launched-52ea9929091f) 8 | * [How to use XVS Vault? How to stake XVS?](https://medium.com/@Venus_protocol/venus-vault-user-guide-cd1042b18401) 9 | * [How do liquidations work?](https://community.venus.io/t/liquidation-guide-for-venus-protocol/2930) 10 | * [Venus All Social Media Links](https://linktr.ee/venusprotocol) 11 | -------------------------------------------------------------------------------- /risk/interest-rate-model.md: -------------------------------------------------------------------------------- 1 | # Interest Rate Model 2 | 3 | ### Overview 4 | 5 | Venus Protocol offers variable interest rates for markets using two different models: the Jump Rate Model and the Whitepaper Rate Model. Each market operates under one of these models with specifically set risk parameters at the market's inception. Notably, the community can update these parameters through the Governance process. Moreover, some markets feature a stable rate, introduced in Venus V4. 6 | 7 | #### **Jump Rate Model** 8 | 9 | The Jump Rate Model uses the following formulas to calculate the interest: 10 | 11 | For Borrow rate: 12 | 13 | $$ 14 | borrow\_rate (u) = b + a_1 \cdot kink + a_1 \cdot \min(0, u-kink) + a_2 \cdot \max(0,u-kink) 15 | $$ 16 | 17 | And, for Supply rate: 18 | 19 | $$ 20 | supply\_rate(u) = borrow\_rate(u) \cdot us \cdot (1 - reserve\_factor) 21 | $$ 22 | 23 | Where, 24 | 25 | $$ 26 | us = \frac{borrows}{cash + borrows - reserves + badDebt} 27 | $$ 28 | 29 | The borrow rate employs different formulas when the utilization rate falls into two distinct ranges: 30 | 31 | If `u < kink`: 32 | 33 | $$ 34 | borrow\_rate(u) = a_1 \cdot u + b 35 | $$ 36 | 37 | If `u > kink`: 38 | 39 | $$ 40 | borrow\_rate(u) = a_1 \cdot kink + a_2 \cdot (u-kink) + b 41 | $$ 42 | 43 | **Model Parameters** 44 | 45 | * `a1`: Variable interest rate slope1. 46 | * `a2`: Variable interest rate slope2. 47 | * `b`: Base rate per block (`baseRatePerYear / blocksPerYear`). 48 | * `kink`: Optimal utilization rate, at which the variable interest rate slope shifts from slope1 to slope2. 49 | * `reserve_factor`: Part of interest income withdrawn from the protocol, i.e., not distributed to suppliers. 50 | 51 | The utilization rate (`u`) is defined as: 52 | 53 | $$ 54 | utilization\_rate = \frac{(borrows + bad\_debt)}{(cash + borrows + bad\_debt - reserves)} 55 | $$ 56 | 57 | Where: 58 | 59 | * `borrows`: Amount of borrows in the market, in terms of the underlying asset, excluding bad debt. 60 | * `cash`: Total amount of the underlying asset owned by the market at a specific time. 61 | * `reserves`: Amount of the underlying asset owned by the market but unavailable for borrowers or suppliers, reserved for various uses defined by the protocol's tokenomics. 62 | * `bad_debt`: After liquidators repay as much debt as possible, reducing collateral to a minimal amount, the remaining debt is tagged as bad debt. Bad debt doesn’t accrue interest. 63 | 64 | #### Whitepaper Rate Model 65 | 66 | The Whitepaper Rate Model is simpler, where the borrow rate depends linearly on the utilization: 67 | 68 | For Borrow rate: 69 | 70 | $$ 71 | borrow\_rate (u) = a \cdot u + b 72 | $$ 73 | 74 | For Supply rate: 75 | 76 | $$ 77 | supply\_rate(u) = borrow\_rate(u) \cdot us \cdot (1 - reserve\_factor) 78 | $$ 79 | 80 | Where, 81 | 82 | $$ 83 | us = \frac{borrows}{cash + borrows - reserves + badDebt} 84 | $$ 85 | -------------------------------------------------------------------------------- /risk/risk-management.md: -------------------------------------------------------------------------------- 1 | # Risk Management 2 | 3 | ### Introduction 4 | 5 | Venus Protocol is deeply committed to ensuring the highest level of security and risk management for our users. This section of the documentation outlines our comprehensive approach to risk management, emphasizing our continuous monitoring practices, partnerships for enhanced security, real-time alert systems, and ongoing risk assessments. 6 | 7 | ### Multiple Audits Before Deployment 8 | 9 | * Prior to deployment, Venus Protocol undergoes extensive audits conducted by industry-leading security firms. The results of these audits are publicly accessible and have been fully implemented, ensuring a robust and secure framework. 10 | * Access our detailed audit reports here: [Security and Audits.](https://docs-v4.venus.io/links/security-and-audits) 11 | 12 | ### Continuous On-Chain Monitoring 13 | 14 | * Venus Protocol has partnered with Chaos Labs, a leader in blockchain security and monitoring. This partnership equips us with sophisticated tools for continuous on-chain monitoring, significantly enhancing our risk control and mitigation strategies. 15 | * Explore our monitoring dashboard for real-time insights: [Chaos Labs Risk Overview](https://community.chaoslabs.xyz/venus/risk/overview). 16 | 17 | ### Real-Time Alert System 18 | 19 | * To further enhance our risk management, we have implemented a real-time alert system via Telegram. This system provides immediate notifications for critical events such as market high utilization, significant whale movements, and borrow/supply cap utilization. 20 | * Join our alert channel to stay updated: [Chaos Labs Telegram Alerts](https://community.chaoslabs.xyz/venus/risk/alerts). 21 | 22 | ### Dynamic Risk Management 23 | 24 | * In collaboration with Chaos Labs, we continuously analyze market conditions and adjust risk parameters across all pools regularly or anytime there is need for adjustment to mitigate risks due to market conditions. These adjustments are based on comprehensive data analysis and are integral to maintaining the stability and security of the protocol. 25 | 26 | ### Frontend 27 | 28 | Several security measures have been implemented to mitigate the security risks associated with the frontend app deployed at [https://app.venus.io](https://app.venus.io). 29 | 30 | * The Venus Protocol UI is deployed on AWS infrastructure. Additionally, Cloudflare is employed to distribute the web app. The relevant security services in both AWS and Cloudflare are properly configured to detect and mitigate security risks. 31 | 32 | * SPF and DKIM are configured to protect every email sent from a @venus.io account. 33 | 34 | * Web certificates, generated by AWS, are set to auto-renew. 35 | 36 | * Venus nameservers are hosted on Cloudflare, serving as our DNS provider. 37 | 38 | * The Venus Protocol UI utilizes [Chainalysis](https://www.chainalysis.com) to assess the risk profile associated with web3 addresses. If the risk is deemed high, the connection is disallowed, preventing any interactions with contracts from the UI involving that risky address. 39 | 40 | * Only privileged users have the authority to deploy the open-source code, accessible on Github (https://github.com/VenusProtocol/venus-protocol-interface), to the domain app.venus.io. Additionally, only privileged users are authorized to merge pull requests in the Github repository. 41 | 42 | ### Conclusion 43 | 44 | The risk management practices at Venus Protocol are designed to provide a secure and stable environment for our users. Our commitment to continuous monitoring, real-time alerts, and dynamic risk adjustments ensure that we are always at the forefront of blockchain security. We encourage our community to explore the provided resources for a deeper understanding of our risk management protocols. 45 | -------------------------------------------------------------------------------- /services/api.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: The Venus Protocol API providing access to indexed protocol data. 3 | --- 4 | 5 | # API 6 | 7 | Venus Protocol API provides two groups of endpoints 8 | 9 | **Market Data -** Endpoints relating to lending markets 10 | 11 | **Activity -** Endpoints relating to user interactions with markets 12 | 13 | **Governance -** Endpoints providing information about proposals and voter activity 14 | 15 | ## Base URL 16 | 17 | The API is available without authentication for testnet and mainnet. 18 | 19 | mainnet: [https://api.venus.io](https://api.venus.io/api/governance/venus)\ 20 | testnet: [https://testnetapi.venus.io](https://testnetapi.venus.io/api/transactions/) 21 | 22 | ## Versioning 23 | 24 | Endpoints are versioned using the `accept-version` header. The values for this header can be `stable` or `next`. By default the `stable` version is returned. When a `next` version is available, a `Warning - 299` header will be added to the `stable` version with a message of breaking changes. To receive this new version the `accept-version` header can be set to `next`. 25 | 26 | When the latest `next` version is made stable and the previous stable version is deprecated, both values for `accept-version` will return the latest version. Using the `next` header at this point will add a `Warning - 299` header alerting the client to remove `accept-version: next` to avoid receiving unexpected changes in the future. 27 | 28 | #### Versioning Choreography 29 | 30 | These steps describe the process of upgrading endpoints to new versions as they are released 31 | 32 | 1. A `next` version is made available, accessible with the `accept-version: next` header. A `Warning - 299` header is added to the stable version with details about breaking changes. 33 | 2. Clients will be given adequate time to upgrade to use the next version. 34 | 3. The previous stable version will be deprecated, the next version becomes stable and using the `accept-version: next` header will add a warning to remove the header or use the stable version. 35 | 4. Clients remove the `accept-version: next` header to avoid receiving unexpected changes. 36 | 5. The endpoint is now ready to release another version. 37 | 38 | ### Pool Endpoints 39 | 40 | {% swagger src="../.gitbook/assets/swagger.json" path="/pools" method="get" %} 41 | [swagger.json](../.gitbook/assets/swagger.json) 42 | {% endswagger %} 43 | 44 | 45 | 46 | 47 | 48 | ### Market Endpoints 49 | 50 | {% swagger src="../.gitbook/assets/swagger.json" path="/markets" method="get" %} 51 | [swagger.json](../.gitbook/assets/swagger.json) 52 | {% endswagger %} 53 | 54 | {% swagger src="../.gitbook/assets/swagger.json" path="/markets/history" method="get" %} 55 | [swagger.json](../.gitbook/assets/swagger.json) 56 | {% endswagger %} 57 | 58 | 59 | 60 | ### Governance Endpoints 61 | 62 | {% swagger src="../.gitbook/assets/swagger.json" path="/governance/proposals/{proposalId}/voteSummary" method="get" %} 63 | [swagger.json](../.gitbook/assets/swagger.json) 64 | {% endswagger %} 65 | 66 | {% swagger src="../.gitbook/assets/swagger.json" path="/governance/voters/{address}/summary" method="get" %} 67 | [swagger.json](../.gitbook/assets/swagger.json) 68 | {% endswagger %} 69 | 70 | {% swagger src="../.gitbook/assets/swagger.json" path="/governance/voters/{address}/history" method="get" %} 71 | [swagger.json](../.gitbook/assets/swagger.json) 72 | {% endswagger %} 73 | 74 | {% swagger src="../.gitbook/assets/swagger.json" path="/governance/voters" method="get" %} 75 | [swagger.json](../.gitbook/assets/swagger.json) 76 | {% endswagger %} 77 | 78 | {% swagger src="../.gitbook/assets/swagger.json" path="/governance/proposals" method="get" %} 79 | [swagger.json](../.gitbook/assets/swagger.json) 80 | {% endswagger %} 81 | 82 | {% swagger src="../.gitbook/assets/swagger.json" path="/governance/proposals/votes" method="get" %} 83 | [swagger.json](../.gitbook/assets/swagger.json) 84 | {% endswagger %} 85 | 86 | {% swagger src="../.gitbook/assets/swagger.json" path="/governance/proposals/{proposalId}" method="get" %} 87 | [swagger.json](../.gitbook/assets/swagger.json) 88 | {% endswagger %} 89 | 90 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/README.md: -------------------------------------------------------------------------------- 1 | # Core Pool 2 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/comptroller/README.md: -------------------------------------------------------------------------------- 1 | # Comptroller 2 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/comptroller/comptroller-lens.md: -------------------------------------------------------------------------------- 1 | # ComptrollerLens Contract 2 | 3 | Lens for querying information relating to liquidations 4 | 5 | # Solidity API 6 | 7 | ```solidity 8 | struct AccountLiquidityLocalVars { 9 | uint256 sumCollateral; 10 | uint256 sumBorrowPlusEffects; 11 | uint256 vTokenBalance; 12 | uint256 borrowBalance; 13 | uint256 exchangeRateMantissa; 14 | uint256 oraclePriceMantissa; 15 | struct ExponentialNoError.Exp collateralFactor; 16 | struct ExponentialNoError.Exp exchangeRate; 17 | struct ExponentialNoError.Exp oraclePrice; 18 | struct ExponentialNoError.Exp tokensToDenom; 19 | } 20 | ``` 21 | 22 | ### liquidateCalculateSeizeTokens 23 | 24 | Computes the number of collateral tokens to be seized in a liquidation event 25 | 26 | ```solidity 27 | function liquidateCalculateSeizeTokens(address comptroller, address vTokenBorrowed, address vTokenCollateral, uint256 actualRepayAmount) external view returns (uint256, uint256) 28 | ``` 29 | 30 | #### Parameters 31 | 32 | | Name | Type | Description | 33 | | ---- | ---- | ----------- | 34 | | comptroller | address | Address of comptroller | 35 | | vTokenBorrowed | address | Address of the borrowed vToken | 36 | | vTokenCollateral | address | Address of collateral for the borrow | 37 | | actualRepayAmount | uint256 | Repayment amount i.e amount to be repaid of total borrowed amount | 38 | 39 | #### Return Values 40 | 41 | | Name | Type | Description | 42 | | ---- | ---- | ----------- | 43 | | \[0] | uint256 | A tuple of error code, and tokens to seize | 44 | | \[1] | uint256 | | 45 | 46 | --- 47 | 48 | ### liquidateVAICalculateSeizeTokens 49 | 50 | Computes the number of VAI tokens to be seized in a liquidation event 51 | 52 | ```solidity 53 | function liquidateVAICalculateSeizeTokens(address comptroller, address vTokenCollateral, uint256 actualRepayAmount) external view returns (uint256, uint256) 54 | ``` 55 | 56 | #### Parameters 57 | 58 | | Name | Type | Description | 59 | | ---- | ---- | ----------- | 60 | | comptroller | address | Address of comptroller | 61 | | vTokenCollateral | address | Address of collateral for vToken | 62 | | actualRepayAmount | uint256 | Repayment amount i.e amount to be repaid of the total borrowed amount | 63 | 64 | #### Return Values 65 | 66 | | Name | Type | Description | 67 | | ---- | ---- | ----------- | 68 | | \[0] | uint256 | A tuple of error code, and tokens to seize | 69 | | \[1] | uint256 | | 70 | 71 | --- 72 | 73 | ### getHypotheticalAccountLiquidity 74 | 75 | Computes the hypothetical liquidity and shortfall of an account given a hypothetical borrow 76 | A snapshot of the account is taken and the total borrow amount of the account is calculated 77 | 78 | ```solidity 79 | function getHypotheticalAccountLiquidity(address comptroller, address account, contract VToken vTokenModify, uint256 redeemTokens, uint256 borrowAmount) external view returns (uint256, uint256, uint256) 80 | ``` 81 | 82 | #### Parameters 83 | 84 | | Name | Type | Description | 85 | | ---- | ---- | ----------- | 86 | | comptroller | address | Address of comptroller | 87 | | account | address | Address of the borrowed vToken | 88 | | vTokenModify | contract VToken | Address of collateral for vToken | 89 | | redeemTokens | uint256 | Number of vTokens being redeemed | 90 | | borrowAmount | uint256 | Amount borrowed | 91 | 92 | #### Return Values 93 | 94 | | Name | Type | Description | 95 | | ---- | ---- | ----------- | 96 | | \[0] | uint256 | Returns a tuple of error code, liquidity, and shortfall | 97 | | \[1] | uint256 | | 98 | | \[2] | uint256 | | 99 | 100 | --- 101 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/comptroller/diamond/README.md: -------------------------------------------------------------------------------- 1 | # Diamond 2 | 3 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/comptroller/diamond/diamond-consolidated.md: -------------------------------------------------------------------------------- 1 | # DiamondConsolidated 2 | 3 | This contract contains the functions defined in the different facets of the Diamond, plus the getters to the public variables. 4 | This contract cannot be deployed, due to its size. Its main purpose is to allow the easy generation of an ABI and the typechain to interact with the 5 | Unitroller contract in a simple way 6 | 7 | # Solidity API 8 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/comptroller/diamond/facets/README.md: -------------------------------------------------------------------------------- 1 | # Facets 2 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/comptroller/diamond/facets/facet-base.md: -------------------------------------------------------------------------------- 1 | # FacetBase 2 | This facet contract contains functions related to access and checks 3 | 4 | # Solidity API 5 | 6 | ### actionPaused 7 | 8 | Checks if a certain action is paused on a market 9 | 10 | ```solidity 11 | function actionPaused(address market, enum ComptrollerV9Storage.Action action) public view returns (bool) 12 | ``` 13 | 14 | #### Parameters 15 | | Name | Type | Description | 16 | | ---- | ---- | ----------- | 17 | | market | address | vToken address | 18 | | action | enum ComptrollerV9Storage.Action | Action id | 19 | 20 | - - - 21 | 22 | ### getBlockNumber 23 | 24 | Get the latest block number 25 | 26 | ```solidity 27 | function getBlockNumber() public view returns (uint256) 28 | ``` 29 | 30 | - - - 31 | 32 | ### releaseToVault 33 | 34 | Transfer XVS to VAI Vault 35 | 36 | ```solidity 37 | function releaseToVault() public 38 | ``` 39 | 40 | - - - 41 | 42 | ### getXVSAddress 43 | 44 | Return the address of the XVS token 45 | 46 | ```solidity 47 | function getXVSAddress() public pure returns (address) 48 | ``` 49 | 50 | #### Return Values 51 | | Name | Type | Description | 52 | | ---- | ---- | ----------- | 53 | | [0] | address | The address of XVS | 54 | 55 | - - - 56 | 57 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/comptroller/diamond/facets/reward-facet.md: -------------------------------------------------------------------------------- 1 | # RewardFacet 2 | This facet contract provides the external functions related to all claims and rewards of the protocol 3 | 4 | # Solidity API 5 | 6 | ### claimVenus 7 | 8 | Claim all the xvs accrued by holder in all markets and VAI 9 | 10 | ```solidity 11 | function claimVenus(address holder) public 12 | ``` 13 | 14 | #### Parameters 15 | | Name | Type | Description | 16 | | ---- | ---- | ----------- | 17 | | holder | address | The address to claim XVS for | 18 | 19 | - - - 20 | 21 | ### claimVenus 22 | 23 | Claim all the xvs accrued by holder in the specified markets 24 | 25 | ```solidity 26 | function claimVenus(address holder, contract VToken[] vTokens) public 27 | ``` 28 | 29 | #### Parameters 30 | | Name | Type | Description | 31 | | ---- | ---- | ----------- | 32 | | holder | address | The address to claim XVS for | 33 | | vTokens | contract VToken[] | The list of markets to claim XVS in | 34 | 35 | - - - 36 | 37 | ### claimVenus 38 | 39 | Claim all xvs accrued by the holders 40 | 41 | ```solidity 42 | function claimVenus(address[] holders, contract VToken[] vTokens, bool borrowers, bool suppliers) public 43 | ``` 44 | 45 | #### Parameters 46 | | Name | Type | Description | 47 | | ---- | ---- | ----------- | 48 | | holders | address[] | The addresses to claim XVS for | 49 | | vTokens | contract VToken[] | The list of markets to claim XVS in | 50 | | borrowers | bool | Whether or not to claim XVS earned by borrowing | 51 | | suppliers | bool | Whether or not to claim XVS earned by supplying | 52 | 53 | - - - 54 | 55 | ### claimVenusAsCollateral 56 | 57 | Claim all the xvs accrued by holder in all markets, a shorthand for `claimVenus` with collateral set to `true` 58 | 59 | ```solidity 60 | function claimVenusAsCollateral(address holder) external 61 | ``` 62 | 63 | #### Parameters 64 | | Name | Type | Description | 65 | | ---- | ---- | ----------- | 66 | | holder | address | The address to claim XVS for | 67 | 68 | - - - 69 | 70 | ### _grantXVS 71 | 72 | Transfer XVS to the recipient 73 | 74 | ```solidity 75 | function _grantXVS(address recipient, uint256 amount) external 76 | ``` 77 | 78 | #### Parameters 79 | | Name | Type | Description | 80 | | ---- | ---- | ----------- | 81 | | recipient | address | The address of the recipient to transfer XVS to | 82 | | amount | uint256 | The amount of XVS to (possibly) transfer | 83 | 84 | - - - 85 | 86 | ### getXVSVTokenAddress 87 | 88 | Return the address of the XVS vToken 89 | 90 | ```solidity 91 | function getXVSVTokenAddress() public pure returns (address) 92 | ``` 93 | 94 | #### Return Values 95 | | Name | Type | Description | 96 | | ---- | ---- | ----------- | 97 | | [0] | address | The address of XVS vToken | 98 | 99 | - - - 100 | 101 | ### claimVenus 102 | 103 | Claim all xvs accrued by the holders 104 | 105 | ```solidity 106 | function claimVenus(address[] holders, contract VToken[] vTokens, bool borrowers, bool suppliers, bool collateral) public 107 | ``` 108 | 109 | #### Parameters 110 | | Name | Type | Description | 111 | | ---- | ---- | ----------- | 112 | | holders | address[] | The addresses to claim XVS for | 113 | | vTokens | contract VToken[] | The list of markets to claim XVS in | 114 | | borrowers | bool | Whether or not to claim XVS earned by borrowing | 115 | | suppliers | bool | Whether or not to claim XVS earned by supplying | 116 | | collateral | bool | Whether or not to use XVS earned as collateral, only takes effect when the holder has a shortfall | 117 | 118 | - - - 119 | 120 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/interestratemodels/README.md: -------------------------------------------------------------------------------- 1 | # InterestRateModels 2 | 3 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/interestratemodels/interestratemodellens.md: -------------------------------------------------------------------------------- 1 | # InterestRateModelLens 2 | 3 | Lens for querying interest rate model simulations 4 | 5 | # Solidity API 6 | 7 | ```solidity 8 | struct SimulationResponse { 9 | uint256[] borrowSimulation; 10 | uint256[] supplySimulation; 11 | } 12 | ``` 13 | 14 | ### getSimulationResponse 15 | 16 | Simulate interest rate curve fo a specific interest rate model given a reference borrow amount and reserve factor 17 | 18 | ```solidity 19 | function getSimulationResponse(uint256 referenceAmountInWei, address interestRateModel, uint256 reserveFactorMantissa) external view returns (struct InterestRateModelLens.SimulationResponse) 20 | ``` 21 | 22 | #### Parameters 23 | 24 | | Name | Type | Description | 25 | | ---- | ---- | ----------- | 26 | | referenceAmountInWei | uint256 | Borrow amount to use in simulation | 27 | | interestRateModel | address | Address for interest rate model to simulate | 28 | | reserveFactorMantissa | uint256 | Reserve Factor to use in simulation | 29 | 30 | #### Return Values 31 | 32 | | Name | Type | Description | 33 | | ---- | ---- | ----------- | 34 | | \[0] | struct InterestRateModelLens.SimulationResponse | | 35 | 36 | --- 37 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/interestratemodels/jumpmodel.md: -------------------------------------------------------------------------------- 1 | # JumpRateModel 2 | 3 | # Solidity API 4 | 5 | ### constructor 6 | 7 | Construct an interest rate model 8 | 9 | ```solidity 10 | constructor(uint256 baseRatePerYear, uint256 multiplierPerYear, uint256 jumpMultiplierPerYear, uint256 kink_) public 11 | ``` 12 | 13 | #### Parameters 14 | 15 | | Name | Type | Description | 16 | | ---- | ---- | ----------- | 17 | | baseRatePerYear | uint256 | The approximate target base APR, as a mantissa (scaled by 1e18) | 18 | | multiplierPerYear | uint256 | The rate of increase in interest rate wrt utilization (scaled by 1e18) | 19 | | jumpMultiplierPerYear | uint256 | The multiplierPerBlock after hitting a specified utilization point | 20 | | kink\_ | uint256 | The utilization point at which the jump multiplier is applied | 21 | 22 | --- 23 | 24 | ### utilizationRate 25 | 26 | Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)` 27 | 28 | ```solidity 29 | function utilizationRate(uint256 cash, uint256 borrows, uint256 reserves) public pure returns (uint256) 30 | ``` 31 | 32 | #### Parameters 33 | 34 | | Name | Type | Description | 35 | | ---- | ---- | ----------- | 36 | | cash | uint256 | The amount of cash in the market | 37 | | borrows | uint256 | The amount of borrows in the market | 38 | | reserves | uint256 | The amount of reserves in the market (currently unused) | 39 | 40 | #### Return Values 41 | 42 | | Name | Type | Description | 43 | | ---- | ---- | ----------- | 44 | | \[0] | uint256 | The utilization rate as a mantissa between \[0, 1e18] | 45 | 46 | --- 47 | 48 | ### getBorrowRate 49 | 50 | Calculates the current borrow rate per block, with the error code expected by the market 51 | 52 | ```solidity 53 | function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) public view returns (uint256) 54 | ``` 55 | 56 | #### Parameters 57 | 58 | | Name | Type | Description | 59 | | ---- | ---- | ----------- | 60 | | cash | uint256 | The amount of cash in the market | 61 | | borrows | uint256 | The amount of borrows in the market | 62 | | reserves | uint256 | The amount of reserves in the market | 63 | 64 | #### Return Values 65 | 66 | | Name | Type | Description | 67 | | ---- | ---- | ----------- | 68 | | \[0] | uint256 | The borrow rate percentage per block as a mantissa (scaled by 1e18) | 69 | 70 | --- 71 | 72 | ### getSupplyRate 73 | 74 | Calculates the current supply rate per block 75 | 76 | ```solidity 77 | function getSupplyRate(uint256 cash, uint256 borrows, uint256 reserves, uint256 reserveFactorMantissa) public view returns (uint256) 78 | ``` 79 | 80 | #### Parameters 81 | 82 | | Name | Type | Description | 83 | | ---- | ---- | ----------- | 84 | | cash | uint256 | The amount of cash in the market | 85 | | borrows | uint256 | The amount of borrows in the market | 86 | | reserves | uint256 | The amount of reserves in the market | 87 | | reserveFactorMantissa | uint256 | The current reserve factor for the market | 88 | 89 | #### Return Values 90 | 91 | | Name | Type | Description | 92 | | ---- | ---- | ----------- | 93 | | \[0] | uint256 | The supply rate percentage per block as a mantissa (scaled by 1e18) | 94 | 95 | --- 96 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/interestratemodels/whitepapermodel.md: -------------------------------------------------------------------------------- 1 | # WhitePaperInterestRateModel 2 | 3 | The parameterized model described in section 2.4 of the original Venus Protocol whitepaper 4 | 5 | # Solidity API 6 | 7 | ### constructor 8 | 9 | Construct an interest rate model 10 | 11 | ```solidity 12 | constructor(uint256 baseRatePerYear, uint256 multiplierPerYear) public 13 | ``` 14 | 15 | #### Parameters 16 | 17 | | Name | Type | Description | 18 | | ---- | ---- | ----------- | 19 | | baseRatePerYear | uint256 | The approximate target base APR, as a mantissa (scaled by 1e18) | 20 | | multiplierPerYear | uint256 | The rate of increase in interest rate wrt utilization (scaled by 1e18) | 21 | 22 | --- 23 | 24 | ### utilizationRate 25 | 26 | Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)` 27 | 28 | ```solidity 29 | function utilizationRate(uint256 cash, uint256 borrows, uint256 reserves) public pure returns (uint256) 30 | ``` 31 | 32 | #### Parameters 33 | 34 | | Name | Type | Description | 35 | | ---- | ---- | ----------- | 36 | | cash | uint256 | The amount of cash in the market | 37 | | borrows | uint256 | The amount of borrows in the market | 38 | | reserves | uint256 | The amount of reserves in the market (currently unused) | 39 | 40 | #### Return Values 41 | 42 | | Name | Type | Description | 43 | | ---- | ---- | ----------- | 44 | | \[0] | uint256 | The utilization rate as a mantissa between \[0, 1e18] | 45 | 46 | --- 47 | 48 | ### getBorrowRate 49 | 50 | Calculates the current borrow rate per block, with the error code expected by the market 51 | 52 | ```solidity 53 | function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) public view returns (uint256) 54 | ``` 55 | 56 | #### Parameters 57 | 58 | | Name | Type | Description | 59 | | ---- | ---- | ----------- | 60 | | cash | uint256 | The amount of cash in the market | 61 | | borrows | uint256 | The amount of borrows in the market | 62 | | reserves | uint256 | The amount of reserves in the market | 63 | 64 | #### Return Values 65 | 66 | | Name | Type | Description | 67 | | ---- | ---- | ----------- | 68 | | \[0] | uint256 | The borrow rate percentage per block as a mantissa (scaled by 1e18) | 69 | 70 | --- 71 | 72 | ### getSupplyRate 73 | 74 | Calculates the current supply rate per block 75 | 76 | ```solidity 77 | function getSupplyRate(uint256 cash, uint256 borrows, uint256 reserves, uint256 reserveFactorMantissa) public view returns (uint256) 78 | ``` 79 | 80 | #### Parameters 81 | 82 | | Name | Type | Description | 83 | | ---- | ---- | ----------- | 84 | | cash | uint256 | The amount of cash in the market | 85 | | borrows | uint256 | The amount of borrows in the market | 86 | | reserves | uint256 | The amount of reserves in the market | 87 | | reserveFactorMantissa | uint256 | The current reserve factor for the market | 88 | 89 | #### Return Values 90 | 91 | | Name | Type | Description | 92 | | ---- | ---- | ----------- | 93 | | \[0] | uint256 | The supply rate percentage per block as a mantissa (scaled by 1e18) | 94 | 95 | --- 96 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/prime/README.md: -------------------------------------------------------------------------------- 1 | # Prime -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/vaults/README.md: -------------------------------------------------------------------------------- 1 | # Vaults 2 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/vaults/vai/README.md: -------------------------------------------------------------------------------- 1 | # VAI Vault 2 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/vaults/vai/vai-vault-proxy.md: -------------------------------------------------------------------------------- 1 | # VAI Vault Proxy 2 | Proxy contract for the VAI Vault 3 | 4 | # Solidity API 5 | 6 | ### _setPendingImplementation 7 | 8 | * Admin Functions ** 9 | 10 | ```solidity 11 | function _setPendingImplementation(address newPendingImplementation) public returns (uint256) 12 | ``` 13 | 14 | - - - 15 | 16 | ### _acceptImplementation 17 | 18 | Accepts new implementation of VAI Vault. msg.sender must be pendingImplementation 19 | 20 | ```solidity 21 | function _acceptImplementation() public returns (uint256) 22 | ``` 23 | 24 | #### Return Values 25 | | Name | Type | Description | 26 | | ---- | ---- | ----------- | 27 | | [0] | uint256 | uint 0=success, otherwise a failure (see ErrorReporter.sol for details) | 28 | 29 | - - - 30 | 31 | ### _setPendingAdmin 32 | 33 | Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer. 34 | 35 | ```solidity 36 | function _setPendingAdmin(address newPendingAdmin) public returns (uint256) 37 | ``` 38 | 39 | #### Parameters 40 | | Name | Type | Description | 41 | | ---- | ---- | ----------- | 42 | | newPendingAdmin | address | New pending admin. | 43 | 44 | #### Return Values 45 | | Name | Type | Description | 46 | | ---- | ---- | ----------- | 47 | | [0] | uint256 | uint 0=success, otherwise a failure (see ErrorReporter.sol for details) | 48 | 49 | - - - 50 | 51 | ### _acceptAdmin 52 | 53 | Accepts transfer of admin rights. msg.sender must be pendingAdmin 54 | 55 | ```solidity 56 | function _acceptAdmin() public returns (uint256) 57 | ``` 58 | 59 | #### Return Values 60 | | Name | Type | Description | 61 | | ---- | ---- | ----------- | 62 | | [0] | uint256 | uint 0=success, otherwise a failure (see ErrorReporter.sol for details) | 63 | 64 | - - - 65 | 66 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/vaults/vai/vai-vault.md: -------------------------------------------------------------------------------- 1 | # VAI Vault 2 | The VAI Vault is configured for users to stake VAI And receive XVS as a reward. 3 | 4 | # Solidity API 5 | 6 | ### pause 7 | 8 | Pause vault 9 | 10 | ```solidity 11 | function pause() external 12 | ``` 13 | 14 | - - - 15 | 16 | ### resume 17 | 18 | Resume vault 19 | 20 | ```solidity 21 | function resume() external 22 | ``` 23 | 24 | - - - 25 | 26 | ### deposit 27 | 28 | Deposit VAI to VAIVault for XVS allocation 29 | 30 | ```solidity 31 | function deposit(uint256 _amount) external 32 | ``` 33 | 34 | #### Parameters 35 | | Name | Type | Description | 36 | | ---- | ---- | ----------- | 37 | | _amount | uint256 | The amount to deposit to vault | 38 | 39 | - - - 40 | 41 | ### withdraw 42 | 43 | Withdraw VAI from VAIVault 44 | 45 | ```solidity 46 | function withdraw(uint256 _amount) external 47 | ``` 48 | 49 | #### Parameters 50 | | Name | Type | Description | 51 | | ---- | ---- | ----------- | 52 | | _amount | uint256 | The amount to withdraw from vault | 53 | 54 | - - - 55 | 56 | ### claim 57 | 58 | Claim XVS from VAIVault 59 | 60 | ```solidity 61 | function claim() external 62 | ``` 63 | 64 | - - - 65 | 66 | ### claim 67 | 68 | Claim XVS from VAIVault 69 | 70 | ```solidity 71 | function claim(address account) external 72 | ``` 73 | 74 | #### Parameters 75 | | Name | Type | Description | 76 | | ---- | ---- | ----------- | 77 | | account | address | The account for which to claim XVS | 78 | 79 | - - - 80 | 81 | ### pendingXVS 82 | 83 | View function to see pending XVS on frontend 84 | 85 | ```solidity 86 | function pendingXVS(address _user) public view returns (uint256) 87 | ``` 88 | 89 | #### Parameters 90 | | Name | Type | Description | 91 | | ---- | ---- | ----------- | 92 | | _user | address | The user to see pending XVS | 93 | 94 | #### Return Values 95 | | Name | Type | Description | 96 | | ---- | ---- | ----------- | 97 | | [0] | uint256 | Amount of XVS the user can claim | 98 | 99 | - - - 100 | 101 | ### updatePendingRewards 102 | 103 | Function that updates pending rewards 104 | 105 | ```solidity 106 | function updatePendingRewards() public 107 | ``` 108 | 109 | - - - 110 | 111 | ### _become 112 | 113 | * Admin Functions ** 114 | 115 | ```solidity 116 | function _become(contract VAIVaultProxy vaiVaultProxy) external 117 | ``` 118 | 119 | - - - 120 | 121 | ### setAccessControl 122 | 123 | Sets the address of the access control of this contract 124 | 125 | ```solidity 126 | function setAccessControl(address newAccessControlAddress) external 127 | ``` 128 | 129 | #### Parameters 130 | | Name | Type | Description | 131 | | ---- | ---- | ----------- | 132 | | newAccessControlAddress | address | New address for the access control | 133 | 134 | - - - 135 | 136 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/vaults/xvs/README.md: -------------------------------------------------------------------------------- 1 | # XVS Vault 2 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/vaults/xvs/xvs-store.md: -------------------------------------------------------------------------------- 1 | # XVS Store 2 | XVS Store responsible for distributing XVS rewards 3 | 4 | # Solidity API 5 | 6 | ### safeRewardTransfer 7 | 8 | Safely transfer rewards. Only active reward tokens can be sent using this function. 9 | Only callable by owner 10 | 11 | ```solidity 12 | function safeRewardTransfer(address token, address _to, uint256 _amount) external 13 | ``` 14 | 15 | #### Parameters 16 | | Name | Type | Description | 17 | | ---- | ---- | ----------- | 18 | | token | address | Reward token to transfer | 19 | | _to | address | Destination address of the reward | 20 | | _amount | uint256 | Amount to transfer | 21 | 22 | - - - 23 | 24 | ### setPendingAdmin 25 | 26 | Allows the admin to propose a new admin 27 | Only callable admin 28 | 29 | ```solidity 30 | function setPendingAdmin(address _admin) external 31 | ``` 32 | 33 | #### Parameters 34 | | Name | Type | Description | 35 | | ---- | ---- | ----------- | 36 | | _admin | address | Propose an account as admin of the XVS store | 37 | 38 | - - - 39 | 40 | ### acceptAdmin 41 | 42 | Allows an account that is pending as admin to accept the role 43 | nly calllable by the pending admin 44 | 45 | ```solidity 46 | function acceptAdmin() external 47 | ``` 48 | 49 | - - - 50 | 51 | ### setNewOwner 52 | 53 | Set the contract owner 54 | 55 | ```solidity 56 | function setNewOwner(address _owner) external 57 | ``` 58 | 59 | #### Parameters 60 | | Name | Type | Description | 61 | | ---- | ---- | ----------- | 62 | | _owner | address | The address of the owner to set Only callable admin | 63 | 64 | - - - 65 | 66 | ### setRewardToken 67 | 68 | Set or disable a reward token 69 | 70 | ```solidity 71 | function setRewardToken(address _tokenAddress, bool status) external 72 | ``` 73 | 74 | #### Parameters 75 | | Name | Type | Description | 76 | | ---- | ---- | ----------- | 77 | | _tokenAddress | address | The address of a token to set as active or inactive | 78 | | status | bool | Set whether a reward token is active or not | 79 | 80 | - - - 81 | 82 | ### emergencyRewardWithdraw 83 | 84 | Security function to allow the owner of the contract to withdraw from the contract 85 | 86 | ```solidity 87 | function emergencyRewardWithdraw(address _tokenAddress, uint256 _amount) external 88 | ``` 89 | 90 | #### Parameters 91 | | Name | Type | Description | 92 | | ---- | ---- | ----------- | 93 | | _tokenAddress | address | Reward token address to withdraw | 94 | | _amount | uint256 | Amount of token to withdraw | 95 | 96 | - - - 97 | 98 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/vaults/xvs/xvs-vault-proxy.md: -------------------------------------------------------------------------------- 1 | # XVS Vault Proxy 2 | XVS Vault Proxy contract 3 | 4 | # Solidity API 5 | 6 | ### _setPendingImplementation 7 | 8 | * Admin Functions ** 9 | 10 | ```solidity 11 | function _setPendingImplementation(address newPendingImplementation) public returns (uint256) 12 | ``` 13 | 14 | - - - 15 | 16 | ### _acceptImplementation 17 | 18 | Accepts new implementation of XVS Vault. msg.sender must be pendingImplementation 19 | 20 | ```solidity 21 | function _acceptImplementation() public returns (uint256) 22 | ``` 23 | 24 | #### Return Values 25 | | Name | Type | Description | 26 | | ---- | ---- | ----------- | 27 | | [0] | uint256 | uint 0=success, otherwise a failure (see ErrorReporter.sol for details) | 28 | 29 | - - - 30 | 31 | ### _setPendingAdmin 32 | 33 | Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer. 34 | 35 | ```solidity 36 | function _setPendingAdmin(address newPendingAdmin) public returns (uint256) 37 | ``` 38 | 39 | #### Parameters 40 | | Name | Type | Description | 41 | | ---- | ---- | ----------- | 42 | | newPendingAdmin | address | New pending admin. | 43 | 44 | #### Return Values 45 | | Name | Type | Description | 46 | | ---- | ---- | ----------- | 47 | | [0] | uint256 | uint 0=success, otherwise a failure (see ErrorReporter.sol for details) | 48 | 49 | - - - 50 | 51 | ### _acceptAdmin 52 | 53 | Accepts transfer of admin rights. msg.sender must be pendingAdmin 54 | 55 | ```solidity 56 | function _acceptAdmin() public returns (uint256) 57 | ``` 58 | 59 | #### Return Values 60 | | Name | Type | Description | 61 | | ---- | ---- | ----------- | 62 | | [0] | uint256 | uint 0=success, otherwise a failure (see ErrorReporter.sol for details) | 63 | 64 | - - - 65 | 66 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/vaults/xvs/xvs-vault-treasury.md: -------------------------------------------------------------------------------- 1 | # XVSVaultTreasury 2 | 3 | This contract stores `XVS` received from XVSVaultConverter and funds XVSVault 4 | 5 | # Solidity API 6 | 7 | ### XVS_ADDRESS 8 | 9 | The xvs token address 10 | 11 | ```solidity 12 | address XVS_ADDRESS 13 | ``` 14 | 15 | - - - 16 | 17 | ### xvsVault 18 | 19 | The xvsvault address 20 | 21 | ```solidity 22 | address xvsVault 23 | ``` 24 | 25 | - - - 26 | 27 | ### fundXVSVault 28 | 29 | This function transfers funds to the XVS vault 30 | 31 | ```solidity 32 | function fundXVSVault(uint256 amountMantissa) external 33 | ``` 34 | 35 | #### Parameters 36 | | Name | Type | Description | 37 | | ---- | ---- | ----------- | 38 | | amountMantissa | uint256 | Amount to be sent to XVS vault | 39 | 40 | #### 📅 Events 41 | * FundsTransferredToXVSStore emits on success 42 | 43 | #### ⛔️ Access Requirements 44 | * Restricted by ACM 45 | 46 | #### ❌ Errors 47 | * InsufficientBalance is thrown when amount entered is greater than balance 48 | 49 | ### sweepToken 50 | 51 | This function sweep tokens from the contract 52 | 53 | ```solidity 54 | function sweepToken(address tokenAddress, address to, uint256 amount) external 55 | ``` 56 | 57 | #### Parameters 58 | | Name | Type | Description | 59 | | ---- | ---- | ----------- | 60 | | tokenAddress | address | Address of the asset(token) | 61 | | to | address | Address to which assets will be transferred | 62 | | amount | uint256 | Amount need to sweep from the contract | 63 | 64 | #### 📅 Events 65 | * SweepToken emits on success 66 | 67 | #### ⛔️ Access Requirements 68 | * Restricted by ACM 69 | - - - 70 | 71 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/vbnbadmin.md: -------------------------------------------------------------------------------- 1 | # VBNBAdmin 2 | This contract is the "admin" of the vBNB market, reducing the reserves of the market, sending them to the `ProtocolShareReserve` contract, 3 | and allowing the executions of the rest of the privileged functions in the vBNB contract (after checking if the sender has the required permissions). 4 | 5 | # Solidity API 6 | 7 | ### vBNB 8 | 9 | address of vBNB 10 | 11 | ```solidity 12 | contract VTokenInterface vBNB 13 | ``` 14 | 15 | - - - 16 | 17 | ### WBNB 18 | 19 | address of WBNB contract 20 | 21 | ```solidity 22 | contract IWBNB WBNB 23 | ``` 24 | 25 | - - - 26 | 27 | ### initialize 28 | 29 | Used to initialize non-immutable variables 30 | 31 | ```solidity 32 | function initialize(contract IProtocolShareReserve _protocolShareReserve, address accessControlManager) external 33 | ``` 34 | 35 | - - - 36 | 37 | ### setProtocolShareReserve 38 | 39 | PSR setter. 40 | 41 | ```solidity 42 | function setProtocolShareReserve(contract IProtocolShareReserve protocolShareReserve_) external 43 | ``` 44 | 45 | #### Parameters 46 | | Name | Type | Description | 47 | | ---- | ---- | ----------- | 48 | | protocolShareReserve_ | contract IProtocolShareReserve | Address of the PSR contract | 49 | 50 | #### 📅 Events 51 | * Emits ProtocolShareReserveUpdated event. 52 | 53 | #### ⛔️ Access Requirements 54 | * Only owner (Governance) 55 | 56 | - - - 57 | 58 | ### reduceReserves 59 | 60 | Reduce reserves of vBNB, wrap them and send them to the PSR contract 61 | 62 | ```solidity 63 | function reduceReserves(uint256 reduceAmount) external 64 | ``` 65 | 66 | #### Parameters 67 | | Name | Type | Description | 68 | | ---- | ---- | ----------- | 69 | | reduceAmount | uint256 | amount of reserves to reduce | 70 | 71 | #### 📅 Events 72 | * Emits ReservesReduced event. 73 | 74 | - - - 75 | 76 | ### setInterestRateModel 77 | 78 | Sets the interest rate model of the vBNB contract 79 | 80 | ```solidity 81 | function setInterestRateModel(address newInterestRateModel) public returns (uint256) 82 | ``` 83 | 84 | #### Parameters 85 | | Name | Type | Description | 86 | | ---- | ---- | ----------- | 87 | | newInterestRateModel | address | Address of the new interest rate model | 88 | 89 | #### ⛔️ Access Requirements 90 | * Controlled by ACM 91 | 92 | - - - 93 | 94 | ### receive 95 | 96 | Invoked when BNB is sent to this contract 97 | 98 | ```solidity 99 | receive() external payable 100 | ``` 101 | 102 | #### ⛔️ Access Requirements 103 | * Only vBNB is considered a valid sender 104 | 105 | - - - 106 | 107 | ### fallback 108 | 109 | Invoked when called function does not exist in the contract. The function will be executed in the vBNB contract. 110 | 111 | ```solidity 112 | fallback(bytes data) external payable returns (bytes) 113 | ``` 114 | 115 | #### ⛔️ Access Requirements 116 | * Only owner (Governance) 117 | 118 | - - - 119 | 120 | -------------------------------------------------------------------------------- /technical-reference/reference-core-pool/vtreasury.md: -------------------------------------------------------------------------------- 1 | # VTreasury 2 | 3 | Contract for treasury all tokens as fee and transfer to governance 4 | 5 | # Solidity API 6 | 7 | ### fallback 8 | 9 | To receive BNB 10 | 11 | ```solidity 12 | fallback() external payable 13 | ``` 14 | 15 | --- 16 | 17 | ### withdrawTreasuryBEP20 18 | 19 | Withdraw Treasury BEP20 Tokens, Only owner call it 20 | 21 | ```solidity 22 | function withdrawTreasuryBEP20(address tokenAddress, uint256 withdrawAmount, address withdrawAddress) external 23 | ``` 24 | 25 | #### Parameters 26 | 27 | | Name | Type | Description | 28 | | ---- | ---- | ----------- | 29 | | tokenAddress | address | The address of treasury token | 30 | | withdrawAmount | uint256 | The withdraw amount to owner | 31 | | withdrawAddress | address | The withdraw address | 32 | 33 | --- 34 | 35 | ### withdrawTreasuryBNB 36 | 37 | Withdraw Treasury BNB, Only owner call it 38 | 39 | ```solidity 40 | function withdrawTreasuryBNB(uint256 withdrawAmount, address payable withdrawAddress) external payable 41 | ``` 42 | 43 | #### Parameters 44 | 45 | | Name | Type | Description | 46 | | ---- | ---- | ----------- | 47 | | withdrawAmount | uint256 | The withdraw amount to owner | 48 | | withdrawAddress | address payable | The withdraw address | 49 | 50 | --- 51 | -------------------------------------------------------------------------------- /technical-reference/reference-governance/README.md: -------------------------------------------------------------------------------- 1 | # Governance 2 | -------------------------------------------------------------------------------- /technical-reference/reference-governance/access-controlled-v5.md: -------------------------------------------------------------------------------- 1 | # AccessControlledV5 2 | 3 | This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.5.16) 4 | to integrate access controlled mechanism. It provides initialise methods and verifying access methods. 5 | 6 | # Solidity API 7 | 8 | ### accessControlManager 9 | 10 | Returns the address of the access control manager contract 11 | 12 | ```solidity 13 | function accessControlManager() external view returns (contract IAccessControlManagerV5) 14 | ``` 15 | 16 | --- 17 | -------------------------------------------------------------------------------- /technical-reference/reference-governance/access-controlled-v8.md: -------------------------------------------------------------------------------- 1 | # AccessControlledV8 2 | 3 | This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13) 4 | to integrate access controlled mechanism. It provides initialise methods and verifying access methods. 5 | 6 | # Solidity API 7 | 8 | ### setAccessControlManager 9 | 10 | Sets the address of AccessControlManager 11 | 12 | ```solidity 13 | function setAccessControlManager(address accessControlManager_) external 14 | ``` 15 | 16 | #### Parameters 17 | 18 | | Name | Type | Description | 19 | | ---------------------- | ------- | ------------------------------------------- | 20 | | accessControlManager\_ | address | The new address of the AccessControlManager | 21 | 22 | #### 📅 Events 23 | 24 | * Emits NewAccessControlManager event 25 | 26 | #### ⛔️ Access Requirements 27 | 28 | * Only Governance 29 | 30 | --- 31 | 32 | ### accessControlManager 33 | 34 | Returns the address of the access control manager contract 35 | 36 | ```solidity 37 | function accessControlManager() external view returns (contract IAccessControlManagerV8) 38 | ``` 39 | 40 | --- 41 | -------------------------------------------------------------------------------- /technical-reference/reference-governance/base-omnichain-controller-dest.md: -------------------------------------------------------------------------------- 1 | # BaseOmnichainControllerDest 2 | 3 | # Solidity API 4 | 5 | ### maxDailyReceiveLimit 6 | 7 | Maximum daily limit for receiving commands from Binance chain 8 | 9 | ```solidity 10 | uint256 maxDailyReceiveLimit 11 | ``` 12 | 13 | --- 14 | 15 | ### last24HourCommandsReceived 16 | 17 | Total received commands within the last 24-hour window from Binance chain 18 | 19 | ```solidity 20 | uint256 last24HourCommandsReceived 21 | ``` 22 | 23 | --- 24 | 25 | ### last24HourReceiveWindowStart 26 | 27 | Timestamp when the last 24-hour window started from Binance chain 28 | 29 | ```solidity 30 | uint256 last24HourReceiveWindowStart 31 | ``` 32 | 33 | --- 34 | 35 | ### setMaxDailyReceiveLimit 36 | 37 | Sets the maximum daily limit for receiving commands 38 | 39 | ```solidity 40 | function setMaxDailyReceiveLimit(uint256 limit_) external 41 | ``` 42 | 43 | #### Parameters 44 | 45 | | Name | Type | Description | 46 | | ------- | ------- | ------------------ | 47 | | limit\_ | uint256 | Number of commands | 48 | 49 | #### 📅 Events 50 | 51 | - Emits SetMaxDailyReceiveLimit with old and new limit 52 | 53 | #### ⛔️ Access Requirements 54 | 55 | - Only Owner 56 | 57 | --- 58 | 59 | ### pause 60 | 61 | Triggers the paused state of the controller 62 | 63 | ```solidity 64 | function pause() external 65 | ``` 66 | 67 | #### ⛔️ Access Requirements 68 | 69 | - Only owner 70 | 71 | --- 72 | 73 | ### unpause 74 | 75 | Triggers the resume state of the controller 76 | 77 | ```solidity 78 | function unpause() external 79 | ``` 80 | 81 | #### ⛔️ Access Requirements 82 | 83 | - Only owner 84 | 85 | --- 86 | 87 | ### renounceOwnership 88 | 89 | Empty implementation of renounce ownership to avoid any mishappening 90 | 91 | ```solidity 92 | function renounceOwnership() public 93 | ``` 94 | 95 | --- 96 | -------------------------------------------------------------------------------- /technical-reference/reference-governance/base-omnichain-controller-src.md: -------------------------------------------------------------------------------- 1 | # BaseOmnichainControllerSrc 2 | 3 | # Solidity API 4 | 5 | ### accessControlManager 6 | 7 | ACM (Access Control Manager) contract address 8 | 9 | ```solidity 10 | address accessControlManager 11 | ``` 12 | 13 | --- 14 | 15 | ### chainIdToMaxDailyLimit 16 | 17 | Maximum daily limit for commands from the local chain 18 | 19 | ```solidity 20 | mapping(uint16 => uint256) chainIdToMaxDailyLimit 21 | ``` 22 | 23 | --- 24 | 25 | ### chainIdToLast24HourCommandsSent 26 | 27 | Total commands transferred within the last 24-hour window from the local chain 28 | 29 | ```solidity 30 | mapping(uint16 => uint256) chainIdToLast24HourCommandsSent 31 | ``` 32 | 33 | --- 34 | 35 | ### chainIdToLast24HourWindowStart 36 | 37 | Timestamp when the last 24-hour window started from the local chain 38 | 39 | ```solidity 40 | mapping(uint16 => uint256) chainIdToLast24HourWindowStart 41 | ``` 42 | 43 | --- 44 | 45 | ### chainIdToLastProposalSentTimestamp 46 | 47 | Timestamp when the last proposal sent from the local chain to dest chain 48 | 49 | ```solidity 50 | mapping(uint16 => uint256) chainIdToLastProposalSentTimestamp 51 | ``` 52 | 53 | --- 54 | 55 | ### setMaxDailyLimit 56 | 57 | Sets the limit of daily (24 Hour) command amount 58 | 59 | ```solidity 60 | function setMaxDailyLimit(uint16 chainId_, uint256 limit_) external 61 | ``` 62 | 63 | #### Parameters 64 | 65 | | Name | Type | Description | 66 | | --------- | ------- | -------------------- | 67 | | chainId\_ | uint16 | Destination chain id | 68 | | limit\_ | uint256 | Number of commands | 69 | 70 | #### 📅 Events 71 | 72 | - Emits SetMaxDailyLimit with old and new limit and its corresponding chain id 73 | 74 | #### ⛔️ Access Requirements 75 | 76 | - Controlled by AccessControlManager 77 | 78 | --- 79 | 80 | ### pause 81 | 82 | Triggers the paused state of the controller 83 | 84 | ```solidity 85 | function pause() external 86 | ``` 87 | 88 | #### ⛔️ Access Requirements 89 | 90 | - Controlled by AccessControlManager 91 | 92 | --- 93 | 94 | ### unpause 95 | 96 | Triggers the resume state of the controller 97 | 98 | ```solidity 99 | function unpause() external 100 | ``` 101 | 102 | #### ⛔️ Access Requirements 103 | 104 | - Controlled by AccessControlManager 105 | 106 | --- 107 | 108 | ### setAccessControlManager 109 | 110 | Sets the address of Access Control Manager (ACM) 111 | 112 | ```solidity 113 | function setAccessControlManager(address accessControlManager_) external 114 | ``` 115 | 116 | #### Parameters 117 | 118 | | Name | Type | Description | 119 | | ---------------------- | ------- | --------------------------------------------- | 120 | | accessControlManager\_ | address | The new address of the Access Control Manager | 121 | 122 | #### 📅 Events 123 | 124 | - Emits NewAccessControlManager with old and new access control manager addresses 125 | 126 | #### ⛔️ Access Requirements 127 | 128 | - Only owner 129 | 130 | --- 131 | 132 | ### renounceOwnership 133 | 134 | Empty implementation of renounce ownership to avoid any mishap 135 | 136 | ```solidity 137 | function renounceOwnership() public 138 | ``` 139 | 140 | --- 141 | -------------------------------------------------------------------------------- /technical-reference/reference-governance/governor-bravo-delegator.md: -------------------------------------------------------------------------------- 1 | # GovernorBravoDelegator 2 | 3 | The `GovernorBravoDelegator` contract. 4 | 5 | # Solidity API 6 | 7 | ### \_setImplementation 8 | 9 | Called by the admin to update the implementation of the delegator 10 | 11 | ```solidity 12 | function _setImplementation(address implementation_) public 13 | ``` 14 | 15 | #### Parameters 16 | 17 | | Name | Type | Description | 18 | | ---------------- | ------- | ---------------------------------------------------- | 19 | | implementation\_ | address | The address of the new implementation for delegation | 20 | 21 | --- 22 | -------------------------------------------------------------------------------- /technical-reference/reference-governance/governor-bravo-interfaces.md: -------------------------------------------------------------------------------- 1 | # GovernorBravoEvents 2 | 3 | Set of events emitted by the GovernorBravo contracts. 4 | 5 | # Solidity API 6 | 7 | ```solidity 8 | struct Proposal { 9 | uint256 id; 10 | address proposer; 11 | uint256 eta; 12 | address[] targets; 13 | uint256[] values; 14 | string[] signatures; 15 | bytes[] calldatas; 16 | uint256 startBlock; 17 | uint256 endBlock; 18 | uint256 forVotes; 19 | uint256 againstVotes; 20 | uint256 abstainVotes; 21 | bool canceled; 22 | bool executed; 23 | mapping(address => struct GovernorBravoDelegateStorageV1.Receipt) receipts; 24 | uint8 proposalType; 25 | } 26 | ``` 27 | 28 | ```solidity 29 | struct Receipt { 30 | bool hasVoted; 31 | uint8 support; 32 | uint96 votes; 33 | } 34 | ``` 35 | 36 | ```solidity 37 | enum ProposalState { 38 | Pending, 39 | Active, 40 | Canceled, 41 | Defeated, 42 | Succeeded, 43 | Queued, 44 | Expired, 45 | Executed 46 | } 47 | ``` 48 | 49 | ```solidity 50 | enum ProposalType { 51 | NORMAL, 52 | FASTTRACK, 53 | CRITICAL 54 | } 55 | ``` 56 | 57 | ```solidity 58 | struct ProposalConfig { 59 | uint256 votingDelay; 60 | uint256 votingPeriod; 61 | uint256 proposalThreshold; 62 | } 63 | ``` 64 | 65 | ### proposalCount 66 | 67 | The total number of proposals 68 | 69 | ```solidity 70 | function proposalCount() external returns (uint256) 71 | ``` 72 | 73 | --- 74 | -------------------------------------------------------------------------------- /technical-reference/reference-governance/timelock.md: -------------------------------------------------------------------------------- 1 | # Timelock 2 | The Timelock contract. 3 | 4 | # Solidity API 5 | 6 | ### setDelay 7 | 8 | Setter for the transaction queue delay 9 | 10 | ```solidity 11 | function setDelay(uint256 delay_) public 12 | ``` 13 | 14 | #### Parameters 15 | | Name | Type | Description | 16 | | ---- | ---- | ----------- | 17 | | delay_ | uint256 | The new delay period for the transaction queue | 18 | 19 | - - - 20 | 21 | ### acceptAdmin 22 | 23 | Method for accepting a proposed admin 24 | 25 | ```solidity 26 | function acceptAdmin() public 27 | ``` 28 | 29 | - - - 30 | 31 | ### setPendingAdmin 32 | 33 | Method to propose a new admin authorized to call timelock functions. This should be the Governor Contract 34 | 35 | ```solidity 36 | function setPendingAdmin(address pendingAdmin_) public 37 | ``` 38 | 39 | #### Parameters 40 | | Name | Type | Description | 41 | | ---- | ---- | ----------- | 42 | | pendingAdmin_ | address | Address of the proposed admin | 43 | 44 | - - - 45 | 46 | ### queueTransaction 47 | 48 | Called for each action when queuing a proposal 49 | 50 | ```solidity 51 | function queueTransaction(address target, uint256 value, string signature, bytes data, uint256 eta) public returns (bytes32) 52 | ``` 53 | 54 | #### Parameters 55 | | Name | Type | Description | 56 | | ---- | ---- | ----------- | 57 | | target | address | Address of the contract with the method to be called | 58 | | value | uint256 | Native token amount sent with the transaction | 59 | | signature | string | Ssignature of the function to be called | 60 | | data | bytes | Arguments to be passed to the function when called | 61 | | eta | uint256 | Timestamp after which the transaction can be executed | 62 | 63 | #### Return Values 64 | | Name | Type | Description | 65 | | ---- | ---- | ----------- | 66 | | [0] | bytes32 | Hash of the queued transaction | 67 | 68 | - - - 69 | 70 | ### cancelTransaction 71 | 72 | Called to cancel a queued transaction 73 | 74 | ```solidity 75 | function cancelTransaction(address target, uint256 value, string signature, bytes data, uint256 eta) public 76 | ``` 77 | 78 | #### Parameters 79 | | Name | Type | Description | 80 | | ---- | ---- | ----------- | 81 | | target | address | Address of the contract with the method to be called | 82 | | value | uint256 | Native token amount sent with the transaction | 83 | | signature | string | Ssignature of the function to be called | 84 | | data | bytes | Arguments to be passed to the function when called | 85 | | eta | uint256 | Timestamp after which the transaction can be executed | 86 | 87 | - - - 88 | 89 | ### executeTransaction 90 | 91 | Called to execute a queued transaction 92 | 93 | ```solidity 94 | function executeTransaction(address target, uint256 value, string signature, bytes data, uint256 eta) public payable returns (bytes) 95 | ``` 96 | 97 | #### Parameters 98 | | Name | Type | Description | 99 | | ---- | ---- | ----------- | 100 | | target | address | Address of the contract with the method to be called | 101 | | value | uint256 | Native token amount sent with the transaction | 102 | | signature | string | Ssignature of the function to be called | 103 | | data | bytes | Arguments to be passed to the function when called | 104 | | eta | uint256 | Timestamp after which the transaction can be executed | 105 | 106 | - - - 107 | 108 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/README.md: -------------------------------------------------------------------------------- 1 | # Isolated Pools 2 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/comptroller/README.md: -------------------------------------------------------------------------------- 1 | # Comptroller 2 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/comptroller/comptroller-storage.md: -------------------------------------------------------------------------------- 1 | # ComptrollerStorage 2 | 3 | Storage layout for the `Comptroller` contract. 4 | 5 | # Solidity API 6 | 7 | ```solidity 8 | struct LiquidationOrder { 9 | contract VToken vTokenCollateral; 10 | contract VToken vTokenBorrowed; 11 | uint256 repayAmount; 12 | } 13 | ``` 14 | 15 | ```solidity 16 | struct AccountLiquiditySnapshot { 17 | uint256 totalCollateral; 18 | uint256 weightedCollateral; 19 | uint256 borrows; 20 | uint256 effects; 21 | uint256 liquidity; 22 | uint256 shortfall; 23 | } 24 | ``` 25 | 26 | ```solidity 27 | struct RewardSpeeds { 28 | address rewardToken; 29 | uint256 supplySpeed; 30 | uint256 borrowSpeed; 31 | } 32 | ``` 33 | 34 | ```solidity 35 | struct Market { 36 | bool isListed; 37 | uint256 collateralFactorMantissa; 38 | uint256 liquidationThresholdMantissa; 39 | mapping(address => bool) accountMembership; 40 | } 41 | ``` 42 | 43 | ```solidity 44 | enum Action { 45 | MINT, 46 | REDEEM, 47 | BORROW, 48 | REPAY, 49 | SEIZE, 50 | LIQUIDATE, 51 | TRANSFER, 52 | ENTER_MARKET, 53 | EXIT_MARKET 54 | } 55 | ``` 56 | 57 | ### oracle 58 | 59 | Oracle which gives the price of any given asset 60 | 61 | ```solidity 62 | contract ResilientOracleInterface oracle 63 | ``` 64 | 65 | - - - 66 | 67 | ### closeFactorMantissa 68 | 69 | Multiplier used to calculate the maximum repayAmount when liquidating a borrow 70 | 71 | ```solidity 72 | uint256 closeFactorMantissa 73 | ``` 74 | 75 | - - - 76 | 77 | ### liquidationIncentiveMantissa 78 | 79 | Multiplier representing the discount on collateral that a liquidator receives 80 | 81 | ```solidity 82 | uint256 liquidationIncentiveMantissa 83 | ``` 84 | 85 | - - - 86 | 87 | ### accountAssets 88 | 89 | Per-account mapping of "assets you are in" 90 | 91 | ```solidity 92 | mapping(address => contract VToken[]) accountAssets 93 | ``` 94 | 95 | - - - 96 | 97 | ### markets 98 | 99 | Official mapping of vTokens -> Market metadata 100 | 101 | ```solidity 102 | mapping(address => struct ComptrollerStorage.Market) markets 103 | ``` 104 | 105 | - - - 106 | 107 | ### allMarkets 108 | 109 | A list of all markets 110 | 111 | ```solidity 112 | contract VToken[] allMarkets 113 | ``` 114 | 115 | - - - 116 | 117 | ### borrowCaps 118 | 119 | Borrow caps enforced by borrowAllowed for each vToken address. Defaults to zero which restricts borrowing. 120 | 121 | ```solidity 122 | mapping(address => uint256) borrowCaps 123 | ``` 124 | 125 | - - - 126 | 127 | ### minLiquidatableCollateral 128 | 129 | Minimal collateral required for regular (non-batch) liquidations 130 | 131 | ```solidity 132 | uint256 minLiquidatableCollateral 133 | ``` 134 | 135 | - - - 136 | 137 | ### supplyCaps 138 | 139 | Supply caps enforced by mintAllowed for each vToken address. Defaults to zero which corresponds to minting not allowed 140 | 141 | ```solidity 142 | mapping(address => uint256) supplyCaps 143 | ``` 144 | 145 | - - - 146 | 147 | ### isForcedLiquidationEnabled 148 | 149 | Flag indicating whether forced liquidation enabled for a market 150 | 151 | ```solidity 152 | mapping(address => bool) isForcedLiquidationEnabled 153 | ``` 154 | 155 | - - - 156 | 157 | ### prime 158 | 159 | Prime token address 160 | 161 | ```solidity 162 | contract IPrime prime 163 | ``` 164 | 165 | - - - 166 | 167 | ### approvedDelegates 168 | 169 | Whether the delegate is allowed to borrow or redeem on behalf of the user 170 | 171 | ```solidity 172 | mapping(address => mapping(address => bool)) approvedDelegates 173 | ``` 174 | 175 | - - - 176 | 177 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/interest-rate-models/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/technical-reference/reference-isolated-pools/interest-rate-models/README.md -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/interest-rate-models/interest-rate-model.md: -------------------------------------------------------------------------------- 1 | # Compound's InterestRateModel Interface 2 | 3 | # Solidity API 4 | 5 | ### getBorrowRate 6 | 7 | Calculates the current borrow interest rate per block 8 | 9 | ```solidity 10 | function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves, uint256 badDebt) external view virtual returns (uint256) 11 | ``` 12 | 13 | #### Parameters 14 | 15 | | Name | Type | Description | 16 | | -------- | ------- | ------------------------------------------------------ | 17 | | cash | uint256 | The total amount of cash the market has | 18 | | borrows | uint256 | The total amount of borrows the market has outstanding | 19 | | reserves | uint256 | The total amount of reserves the market has | 20 | | badDebt | uint256 | The amount of badDebt in the market | 21 | 22 | #### Return Values 23 | 24 | | Name | Type | Description | 25 | | ---- | ------- | --------------------------------------------------------------- | 26 | | \[0] | uint256 | The borrow rate per block (as a percentage, and scaled by 1e18) | 27 | 28 | --- 29 | 30 | ### getSupplyRate 31 | 32 | Calculates the current supply interest rate per block 33 | 34 | ```solidity 35 | function getSupplyRate(uint256 cash, uint256 borrows, uint256 reserves, uint256 reserveFactorMantissa, uint256 badDebt) external view virtual returns (uint256) 36 | ``` 37 | 38 | #### Parameters 39 | 40 | | Name | Type | Description | 41 | | --------------------- | ------- | ------------------------------------------------------ | 42 | | cash | uint256 | The total amount of cash the market has | 43 | | borrows | uint256 | The total amount of borrows the market has outstanding | 44 | | reserves | uint256 | The total amount of reserves the market has | 45 | | reserveFactorMantissa | uint256 | The current reserve factor the market has | 46 | | badDebt | uint256 | The amount of badDebt in the market | 47 | 48 | #### Return Values 49 | 50 | | Name | Type | Description | 51 | | ---- | ------- | --------------------------------------------------------------- | 52 | | \[0] | uint256 | The supply rate per block (as a percentage, and scaled by 1e18) | 53 | 54 | --- 55 | 56 | ### isInterestRateModel 57 | 58 | Indicator that this is an InterestRateModel contract (for inspection) 59 | 60 | ```solidity 61 | function isInterestRateModel() external pure virtual returns (bool) 62 | ``` 63 | 64 | #### Return Values 65 | 66 | | Name | Type | Description | 67 | | ---- | ---- | ----------- | 68 | | \[0] | bool | Always true | 69 | 70 | --- 71 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/interest-rate-models/jump-rate-model-v2.md: -------------------------------------------------------------------------------- 1 | # Compound's JumpRateModel Contract V2 for V2 vTokens 2 | 3 | Supports only for V2 vTokens 4 | 5 | # Solidity API 6 | 7 | ### getBorrowRate 8 | 9 | Calculates the current borrow rate per block 10 | 11 | ```solidity 12 | function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves, uint256 badDebt) external view returns (uint256) 13 | ``` 14 | 15 | #### Parameters 16 | 17 | | Name | Type | Description | 18 | | -------- | ------- | ------------------------------------ | 19 | | cash | uint256 | The amount of cash in the market | 20 | | borrows | uint256 | The amount of borrows in the market | 21 | | reserves | uint256 | The amount of reserves in the market | 22 | | badDebt | uint256 | The amount of badDebt in the market | 23 | 24 | #### Return Values 25 | 26 | | Name | Type | Description | 27 | | ---- | ------- | ------------------------------------------------------------------- | 28 | | \[0] | uint256 | The borrow rate percentage per block as a mantissa (scaled by 1e18) | 29 | 30 | --- 31 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/pool-registry/README.md: -------------------------------------------------------------------------------- 1 | # Pool Registry 2 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/pool-registry/pool-registry-interface.md: -------------------------------------------------------------------------------- 1 | # PoolRegistryInterface 2 | 3 | Interface implemented by `PoolRegistry`. 4 | 5 | # Solidity API 6 | 7 | ```solidity 8 | struct VenusPool { 9 | string name; 10 | address creator; 11 | address comptroller; 12 | uint256 blockPosted; 13 | uint256 timestampPosted; 14 | } 15 | 16 | ``` 17 | 18 | ```solidity 19 | struct VenusPoolMetaData { 20 | string category; 21 | string logoURL; 22 | string description; 23 | } 24 | 25 | ``` 26 | 27 | ### getAllPools 28 | 29 | Get all pools in PoolRegistry 30 | 31 | ```solidity 32 | function getAllPools() external view returns (struct PoolRegistryInterface.VenusPool[]) 33 | ``` 34 | 35 | --- 36 | 37 | ### getPoolByComptroller 38 | 39 | Get a pool by comptroller address 40 | 41 | ```solidity 42 | function getPoolByComptroller(address comptroller) external view returns (struct PoolRegistryInterface.VenusPool) 43 | ``` 44 | 45 | --- 46 | 47 | ### getVTokenForAsset 48 | 49 | Get the address of the VToken contract in the Pool where the underlying token is the provided asset 50 | 51 | ```solidity 52 | function getVTokenForAsset(address comptroller, address asset) external view returns (address) 53 | ``` 54 | 55 | --- 56 | 57 | ### getPoolsSupportedByAsset 58 | 59 | Get the addresss of the Pools supported that include a market for the provided asset 60 | 61 | ```solidity 62 | function getPoolsSupportedByAsset(address asset) external view returns (address[]) 63 | ``` 64 | 65 | --- 66 | 67 | ### getVenusPoolMetadata 68 | 69 | Get the metadata of a Pool by comptroller address 70 | 71 | ```solidity 72 | function getVenusPoolMetadata(address comptroller) external view returns (struct PoolRegistryInterface.VenusPoolMetaData) 73 | ``` 74 | 75 | --- 76 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/risk-fund-and-shortfall/README.md: -------------------------------------------------------------------------------- 1 | # Risk Fund and Shortfall 2 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/risk-fund-and-shortfall/protocol-share-reserve.md: -------------------------------------------------------------------------------- 1 | # ProtocolShareReserve 2 | 3 | Contract used to store and distribute the reserves generated in the markets. 4 | 5 | # Solidity API 6 | 7 | ```solidity 8 | enum Schema { 9 | PROTOCOL_RESERVES, 10 | ADDITIONAL_REVENUE 11 | } 12 | ``` 13 | 14 | ```solidity 15 | struct DistributionConfig { 16 | enum ProtocolShareReserve.Schema schema; 17 | uint16 percentage; 18 | address destination; 19 | } 20 | ``` 21 | 22 | ### CORE_POOL_COMPTROLLER 23 | 24 | address of core pool comptroller contract 25 | 26 | ```solidity 27 | address CORE_POOL_COMPTROLLER 28 | ``` 29 | 30 | - - - 31 | 32 | ### WBNB 33 | 34 | address of WBNB contract 35 | 36 | ```solidity 37 | address WBNB 38 | ``` 39 | 40 | - - - 41 | 42 | ### vBNB 43 | 44 | address of vBNB contract 45 | 46 | ```solidity 47 | address vBNB 48 | ``` 49 | 50 | - - - 51 | 52 | ### poolRegistry 53 | 54 | address of pool registry contract 55 | 56 | ```solidity 57 | address poolRegistry 58 | ``` 59 | 60 | - - - 61 | 62 | ### assetsReserves 63 | 64 | comptroller => asset => schema => balance 65 | 66 | ```solidity 67 | mapping(address => mapping(address => mapping(enum ProtocolShareReserve.Schema => uint256))) assetsReserves 68 | ``` 69 | 70 | - - - 71 | 72 | ### totalAssetReserve 73 | 74 | asset => balance 75 | 76 | ```solidity 77 | mapping(address => uint256) totalAssetReserve 78 | ``` 79 | 80 | - - - 81 | 82 | ### distributionTargets 83 | 84 | configuration for different income distribution targets 85 | 86 | ```solidity 87 | struct ProtocolShareReserve.DistributionConfig[] distributionTargets 88 | ``` 89 | 90 | - - - 91 | 92 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/risk-fund-and-shortfall/risk-fund-storage.md: -------------------------------------------------------------------------------- 1 | # RiskFundStorage 2 | 3 | Storage layout for the `RiskFundV2` contract. 4 | 5 | # Solidity API 6 | 7 | ### poolAssetsFunds 8 | 9 | Available asset's fund per pool in RiskFund 10 | Comptroller(pool) -> Asset -> amount 11 | 12 | ```solidity 13 | mapping(address => mapping(address => uint256)) poolAssetsFunds 14 | ``` 15 | 16 | - - - 17 | 18 | ### maxLoopsLimit 19 | 20 | Limit for the loops to avoid the DOS 21 | This state is deprecated, using it to prevent storage collision 22 | 23 | ```solidity 24 | uint256 maxLoopsLimit 25 | ``` 26 | 27 | - - - 28 | 29 | ### convertibleBaseAsset 30 | 31 | Address of base asset 32 | 33 | ```solidity 34 | address convertibleBaseAsset 35 | ``` 36 | 37 | - - - 38 | 39 | ### shortfall 40 | 41 | Address of shortfall contract 42 | 43 | ```solidity 44 | address shortfall 45 | ``` 46 | 47 | - - - 48 | 49 | ### riskFundConverter 50 | 51 | Risk fund converter address 52 | 53 | ```solidity 54 | address riskFundConverter 55 | ``` 56 | 57 | - - - 58 | 59 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/risk-fund-and-shortfall/risk-fund-v2.md: -------------------------------------------------------------------------------- 1 | # RiskFundV2 2 | 3 | Contract with basic features to track/hold different assets for different Comptrollers. 4 | 5 | # Solidity API 6 | 7 | ### sweepToken 8 | 9 | Function to sweep baseAsset for pool; Tokens are sent to address(to) 10 | 11 | ```solidity 12 | function sweepToken(address tokenAddress, address to, uint256 amount) external 13 | ``` 14 | 15 | #### Parameters 16 | | Name | Type | Description | 17 | | ---- | ---- | ----------- | 18 | | tokenAddress | address | Address of the asset(token) | 19 | | to | address | Address to which assets will be transferred | 20 | | amount | uint256 | Amount need to sweep for the pool | 21 | 22 | #### 📅 Events 23 | * Emits SweepToken event on success 24 | 25 | #### ⛔️ Access Requirements 26 | * Only Governance 27 | 28 | #### ❌ Errors 29 | * ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero 30 | * ZeroValueNotAllowed is thrown when amount is zero 31 | 32 | - - - 33 | 34 | ### sweepTokenFromPool 35 | 36 | Function to sweep token from pool 37 | 38 | ```solidity 39 | function sweepTokenFromPool(address tokenAddress, address comptroller, uint256 amount) external 40 | ``` 41 | 42 | #### Parameters 43 | | Name | Type | Description | 44 | | ---- | ---- | ----------- | 45 | | tokenAddress | address | Address of the asset(token) | 46 | | comptroller | address | Pool address to which assets will be transferred | 47 | | amount | uint256 | Amount need to sweep from the pool | 48 | 49 | #### 📅 Events 50 | * Emits sweepTokenFromPool event on success 51 | 52 | #### ⛔️ Access Requirements 53 | * Only Governance 54 | 55 | #### ❌ Errors 56 | * ZeroAddressNotAllowed is thrown when tokenAddress/comptroller address is zero 57 | * ZeroValueNotAllowed is thrown when amount is zero 58 | 59 | - - - 60 | 61 | ### getPoolsBaseAssetReserves 62 | 63 | Get the Amount of the Base asset in the risk fund for the specific pool. 64 | 65 | ```solidity 66 | function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256) 67 | ``` 68 | 69 | #### Parameters 70 | | Name | Type | Description | 71 | | ---- | ---- | ----------- | 72 | | comptroller | address | Comptroller address(pool). | 73 | 74 | #### Return Values 75 | | Name | Type | Description | 76 | | ---- | ---- | ----------- | 77 | | [0] | uint256 | Base Asset's reserve in risk fund. | 78 | 79 | - - - 80 | 81 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/utility/README.md: -------------------------------------------------------------------------------- 1 | # Utility 2 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/utility/error-reporter.md: -------------------------------------------------------------------------------- 1 | # TokenErrorReporter 2 | 3 | Errors that can be thrown by the `VToken` contract. 4 | 5 | # Solidity API 6 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/utility/exponential-no-error.md: -------------------------------------------------------------------------------- 1 | # Exponential module for storing fixed-precision decimals 2 | 3 | Exp is a struct which stores decimals with a fixed precision of 18 decimal places. 4 | Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is: 5 | `Exp({mantissa: 5100000000000000000})`. 6 | 7 | # Solidity API 8 | 9 | ```solidity 10 | struct Exp { 11 | uint256 mantissa; 12 | } 13 | ``` 14 | 15 | ```solidity 16 | struct Double { 17 | uint256 mantissa; 18 | } 19 | ``` 20 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/utility/max-loops-limit-helper.md: -------------------------------------------------------------------------------- 1 | # MaxLoopsLimitHelper 2 | 3 | ## MaxLoopsLimitHelper 4 | 5 | Abstract contract used to avoid collection with too many items that would generate gas errors and DoS. 6 | -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/vtoken/README.md: -------------------------------------------------------------------------------- 1 | # vToken -------------------------------------------------------------------------------- /technical-reference/reference-isolated-pools/vtoken/vtoken-interfaces.md: -------------------------------------------------------------------------------- 1 | # VTokenStorage 2 | 3 | Storage layout used by the `VToken` contract 4 | 5 | # Solidity API 6 | 7 | ```solidity 8 | struct BorrowSnapshot { 9 | uint256 principal; 10 | uint256 interestIndex; 11 | } 12 | ``` 13 | 14 | ### underlying 15 | 16 | Underlying asset for this VToken 17 | 18 | ```solidity 19 | address underlying 20 | ``` 21 | 22 | --- 23 | 24 | ### name 25 | 26 | EIP-20 token name for this token 27 | 28 | ```solidity 29 | string name 30 | ``` 31 | 32 | --- 33 | 34 | ### symbol 35 | 36 | EIP-20 token symbol for this token 37 | 38 | ```solidity 39 | string symbol 40 | ``` 41 | 42 | --- 43 | 44 | ### decimals 45 | 46 | EIP-20 token decimals for this token 47 | 48 | ```solidity 49 | uint8 decimals 50 | ``` 51 | 52 | --- 53 | 54 | ### protocolShareReserve 55 | 56 | Protocol share Reserve contract address 57 | 58 | ```solidity 59 | address payable protocolShareReserve 60 | ``` 61 | 62 | --- 63 | 64 | ### comptroller 65 | 66 | Contract which oversees inter-vToken operations 67 | 68 | ```solidity 69 | contract ComptrollerInterface comptroller 70 | ``` 71 | 72 | --- 73 | 74 | ### interestRateModel 75 | 76 | Model which tells what the current interest rate should be 77 | 78 | ```solidity 79 | contract InterestRateModel interestRateModel 80 | ``` 81 | 82 | --- 83 | 84 | ### reserveFactorMantissa 85 | 86 | Fraction of interest currently set aside for reserves 87 | 88 | ```solidity 89 | uint256 reserveFactorMantissa 90 | ``` 91 | 92 | --- 93 | 94 | ### accrualBlockNumber 95 | 96 | Block number that interest was last accrued at 97 | 98 | ```solidity 99 | uint256 accrualBlockNumber 100 | ``` 101 | 102 | --- 103 | 104 | ### borrowIndex 105 | 106 | Accumulator of the total earned interest rate since the opening of the market 107 | 108 | ```solidity 109 | uint256 borrowIndex 110 | ``` 111 | 112 | --- 113 | 114 | ### totalBorrows 115 | 116 | Total amount of outstanding borrows of the underlying in this market 117 | 118 | ```solidity 119 | uint256 totalBorrows 120 | ``` 121 | 122 | --- 123 | 124 | ### totalReserves 125 | 126 | Total amount of reserves of the underlying held in this market 127 | 128 | ```solidity 129 | uint256 totalReserves 130 | ``` 131 | 132 | --- 133 | 134 | ### totalSupply 135 | 136 | Total number of tokens in circulation 137 | 138 | ```solidity 139 | uint256 totalSupply 140 | ``` 141 | 142 | --- 143 | 144 | ### badDebt 145 | 146 | Total bad debt of the market 147 | 148 | ```solidity 149 | uint256 badDebt 150 | ``` 151 | 152 | --- 153 | 154 | ### protocolSeizeShareMantissa 155 | 156 | Share of seized collateral that is added to reserves 157 | 158 | ```solidity 159 | uint256 protocolSeizeShareMantissa 160 | ``` 161 | 162 | --- 163 | 164 | ### shortfall 165 | 166 | Storage of Shortfall contract address 167 | 168 | ```solidity 169 | address shortfall 170 | ``` 171 | 172 | --- 173 | 174 | ### reduceReservesBlockDelta 175 | 176 | delta block after which reserves will be reduced 177 | 178 | ```solidity 179 | uint256 reduceReservesBlockDelta 180 | ``` 181 | 182 | --- 183 | 184 | ### reduceReservesBlockNumber 185 | 186 | last block number at which reserves were reduced 187 | 188 | ```solidity 189 | uint256 reduceReservesBlockNumber 190 | ``` 191 | 192 | --- 193 | 194 | ```solidity 195 | struct RiskManagementInit { 196 | address shortfall; 197 | address payable protocolShareReserve; 198 | } 199 | ``` 200 | 201 | ### isVToken 202 | 203 | Indicator that this is a VToken contract (for inspection) 204 | 205 | ```solidity 206 | function isVToken() external pure virtual returns (bool) 207 | ``` 208 | 209 | #### Return Values 210 | 211 | | Name | Type | Description | 212 | | ---- | ---- | ----------- | 213 | | [0] | bool | Always true | 214 | 215 | --- 216 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/README.md: -------------------------------------------------------------------------------- 1 | # Oracle 2 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/README.md: -------------------------------------------------------------------------------- 1 | # Correlated Token Oracles 2 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/ankr-bnb-oracle.md: -------------------------------------------------------------------------------- 1 | # AnkrBNBOracle 2 | This oracle fetches the price of ankrBNB asset 3 | 4 | # Solidity API 5 | 6 | ### NATIVE_TOKEN_ADDR 7 | 8 | This is used as token address of BNB on BSC 9 | 10 | ```solidity 11 | address NATIVE_TOKEN_ADDR 12 | ``` 13 | 14 | - - - 15 | 16 | ### constructor 17 | 18 | Constructor for the implementation contract. 19 | 20 | ```solidity 21 | constructor(address ankrBNB, address resilientOracle) public 22 | ``` 23 | 24 | - - - 25 | 26 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/as-bnb-oracle.md: -------------------------------------------------------------------------------- 1 | # SlisBNBOracle 2 | This oracle fetches the price of asBNB asset 3 | 4 | # Solidity API 5 | 6 | - - - 7 | 8 | ### constructor 9 | 10 | Constructor for the implementation contract. 11 | 12 | ```solidity 13 | constructor(address asBNB, address slisBNB, address resilientOracle) public 14 | ``` 15 | 16 | - - - 17 | 18 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/bnbx-oracle.md: -------------------------------------------------------------------------------- 1 | # BNBxOracle 2 | This oracle fetches the price of BNBx asset 3 | 4 | # Solidity API 5 | 6 | ### NATIVE_TOKEN_ADDR 7 | 8 | This is used as token address of BNB on BSC 9 | 10 | ```solidity 11 | address NATIVE_TOKEN_ADDR 12 | ``` 13 | 14 | - - - 15 | 16 | ### STAKE_MANAGER 17 | 18 | Address of StakeManager 19 | 20 | ```solidity 21 | contract IStaderStakeManager STAKE_MANAGER 22 | ``` 23 | 24 | - - - 25 | 26 | ### constructor 27 | 28 | Constructor for the implementation contract. 29 | 30 | ```solidity 31 | constructor(address stakeManager, address bnbx, address resilientOracle) public 32 | ``` 33 | 34 | - - - 35 | 36 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/common/correlated-token-oracle.md: -------------------------------------------------------------------------------- 1 | # CorrelatedTokenOracle 2 | This oracle fetches the price of a token that is correlated to another token. 3 | 4 | # Solidity API 5 | 6 | ### CORRELATED_TOKEN 7 | 8 | Address of the correlated token 9 | 10 | ```solidity 11 | address CORRELATED_TOKEN 12 | ``` 13 | 14 | - - - 15 | 16 | ### UNDERLYING_TOKEN 17 | 18 | Address of the underlying token 19 | 20 | ```solidity 21 | address UNDERLYING_TOKEN 22 | ``` 23 | 24 | - - - 25 | 26 | ### RESILIENT_ORACLE 27 | 28 | Address of Resilient Oracle 29 | 30 | ```solidity 31 | contract OracleInterface RESILIENT_ORACLE 32 | ``` 33 | 34 | - - - 35 | 36 | ### getPrice 37 | 38 | Fetches the price of the correlated token 39 | 40 | ```solidity 41 | function getPrice(address asset) external view returns (uint256) 42 | ``` 43 | 44 | #### Parameters 45 | | Name | Type | Description | 46 | | ---- | ---- | ----------- | 47 | | asset | address | Address of the correlated token | 48 | 49 | #### Return Values 50 | | Name | Type | Description | 51 | | ---- | ---- | ----------- | 52 | | [0] | uint256 | price The price of the correlated token in scaled decimal places | 53 | 54 | - - - 55 | 56 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/one-jump-oracle.md: -------------------------------------------------------------------------------- 1 | # OneJumpOracle 2 | This oracle fetches the price of an asset in through an intermediate asset 3 | 4 | # Solidity API 5 | 6 | ### INTERMEDIATE_ORACLE 7 | 8 | Address of the intermediate oracle 9 | 10 | ```solidity 11 | contract OracleInterface INTERMEDIATE_ORACLE 12 | ``` 13 | 14 | - - - 15 | 16 | ### constructor 17 | 18 | Constructor for the implementation contract. 19 | 20 | ```solidity 21 | constructor(address correlatedToken, address underlyingToken, address resilientOracle, address intermediateOracle) public 22 | ``` 23 | 24 | - - - 25 | 26 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/pendle-oracle.md: -------------------------------------------------------------------------------- 1 | # PendleOracle 2 | This oracle fetches the price of a pendle token 3 | 4 | # Solidity API 5 | 6 | ### PT_ORACLE 7 | 8 | Address of the PT oracle 9 | 10 | ```solidity 11 | contract IPendlePtOracle PT_ORACLE 12 | ``` 13 | 14 | - - - 15 | 16 | ### MARKET 17 | 18 | Address of the market 19 | 20 | ```solidity 21 | address MARKET 22 | ``` 23 | 24 | - - - 25 | 26 | ### TWAP_DURATION 27 | 28 | Twap duration for the oracle 29 | 30 | ```solidity 31 | uint32 TWAP_DURATION 32 | ``` 33 | 34 | - - - 35 | 36 | ### constructor 37 | 38 | Constructor for the implementation contract. 39 | 40 | ```solidity 41 | constructor(address market, address ptOracle, address ptToken, address underlyingToken, address resilientOracle, uint32 twapDuration) public 42 | ``` 43 | 44 | - - - 45 | 46 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/sfrax-oracle.md: -------------------------------------------------------------------------------- 1 | # SFraxOracle 2 | This oracle fetches the price of sFrax 3 | 4 | # Solidity API 5 | 6 | ### constructor 7 | 8 | Constructor for the implementation contract. 9 | 10 | ```solidity 11 | constructor(address sFrax, address frax, address resilientOracle) public 12 | ``` 13 | 14 | - - - 15 | 16 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/sfrx-ethoracle.md: -------------------------------------------------------------------------------- 1 | # SFrxETHOracle 2 | This oracle fetches the price of sfrxETH 3 | 4 | # Solidity API 5 | 6 | ### SFRXETH_FRAX_ORACLE 7 | 8 | Address of SfrxEthFraxOracle 9 | 10 | ```solidity 11 | contract ISfrxEthFraxOracle SFRXETH_FRAX_ORACLE 12 | ``` 13 | 14 | - - - 15 | 16 | ### SFRXETH 17 | 18 | Address of sfrxETH 19 | 20 | ```solidity 21 | address SFRXETH 22 | ``` 23 | 24 | - - - 25 | 26 | ### maxAllowedPriceDifference 27 | 28 | Maximum allowed price difference 29 | 30 | ```solidity 31 | uint256 maxAllowedPriceDifference 32 | ``` 33 | 34 | - - - 35 | 36 | ### constructor 37 | 38 | Constructor for the implementation contract. 39 | 40 | ```solidity 41 | constructor(address _sfrxEthFraxOracle, address _sfrxETH) public 42 | ``` 43 | 44 | #### ❌ Errors 45 | * ZeroAddressNotAllowed is thrown when `_sfrxEthFraxOracle` or `_sfrxETH` are the zero address 46 | 47 | - - - 48 | 49 | ### initialize 50 | 51 | Sets the contracts required to fetch prices 52 | 53 | ```solidity 54 | function initialize(address _accessControlManager, uint256 _maxAllowedPriceDifference) external 55 | ``` 56 | 57 | #### Parameters 58 | | Name | Type | Description | 59 | | ---- | ---- | ----------- | 60 | | _accessControlManager | address | Address of the access control manager contract | 61 | | _maxAllowedPriceDifference | uint256 | Maximum allowed price difference | 62 | 63 | #### ❌ Errors 64 | * ZeroValueNotAllowed is thrown if `_maxAllowedPriceDifference` is zero 65 | 66 | - - - 67 | 68 | ### setMaxAllowedPriceDifference 69 | 70 | Sets the maximum allowed price difference 71 | 72 | ```solidity 73 | function setMaxAllowedPriceDifference(uint256 _maxAllowedPriceDifference) external 74 | ``` 75 | 76 | #### Parameters 77 | | Name | Type | Description | 78 | | ---- | ---- | ----------- | 79 | | _maxAllowedPriceDifference | uint256 | Maximum allowed price difference | 80 | 81 | #### ❌ Errors 82 | * ZeroValueNotAllowed is thrown if `_maxAllowedPriceDifference` is zero 83 | 84 | - - - 85 | 86 | ### getPrice 87 | 88 | Fetches the USD price of sfrxETH 89 | 90 | ```solidity 91 | function getPrice(address asset) external view returns (uint256) 92 | ``` 93 | 94 | #### Parameters 95 | | Name | Type | Description | 96 | | ---- | ---- | ----------- | 97 | | asset | address | Address of the sfrxETH token | 98 | 99 | #### Return Values 100 | | Name | Type | Description | 101 | | ---- | ---- | ----------- | 102 | | [0] | uint256 | price The price scaled by 1e18 | 103 | 104 | #### ❌ Errors 105 | * InvalidTokenAddress is thrown when the `asset` is not the sfrxETH token (`SFRXETH`) 106 | * BadPriceData is thrown if the `SFRXETH_FRAX_ORACLE` oracle informs it has bad data 107 | * ZeroValueNotAllowed is thrown if the prices (low or high, in USD) are zero 108 | * PriceDifferenceExceeded is thrown if priceHigh/priceLow is greater than `maxAllowedPriceDifference` 109 | 110 | - - - 111 | 112 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/slis-bnb-oracle.md: -------------------------------------------------------------------------------- 1 | # SlisBNBOracle 2 | This oracle fetches the price of slisBNB asset 3 | 4 | # Solidity API 5 | 6 | ### NATIVE_TOKEN_ADDR 7 | 8 | This is used as token address of BNB on BSC 9 | 10 | ```solidity 11 | address NATIVE_TOKEN_ADDR 12 | ``` 13 | 14 | - - - 15 | 16 | ### STAKE_MANAGER 17 | 18 | Address of StakeManager 19 | 20 | ```solidity 21 | contract ISynclubStakeManager STAKE_MANAGER 22 | ``` 23 | 24 | - - - 25 | 26 | ### constructor 27 | 28 | Constructor for the implementation contract. 29 | 30 | ```solidity 31 | constructor(address stakeManager, address slisBNB, address resilientOracle) public 32 | ``` 33 | 34 | - - - 35 | 36 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/stk-bnb-oracle.md: -------------------------------------------------------------------------------- 1 | # StkBNBOracle 2 | This oracle fetches the price of stkBNB asset 3 | 4 | # Solidity API 5 | 6 | ### NATIVE_TOKEN_ADDR 7 | 8 | This is used as token address of BNB on BSC 9 | 10 | ```solidity 11 | address NATIVE_TOKEN_ADDR 12 | ``` 13 | 14 | - - - 15 | 16 | ### STAKE_POOL 17 | 18 | Address of StakePool 19 | 20 | ```solidity 21 | contract IPStakePool STAKE_POOL 22 | ``` 23 | 24 | - - - 25 | 26 | ### constructor 27 | 28 | Constructor for the implementation contract. 29 | 30 | ```solidity 31 | constructor(address stakePool, address stkBNB, address resilientOracle) public 32 | ``` 33 | 34 | - - - 35 | 36 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/wbeth-oracle.md: -------------------------------------------------------------------------------- 1 | # WBETHOracle 2 | This oracle fetches the price of wBETH asset 3 | 4 | # Solidity API 5 | 6 | ### constructor 7 | 8 | Constructor for the implementation contract. 9 | 10 | ```solidity 11 | constructor(address wbeth, address eth, address resilientOracle) public 12 | ``` 13 | 14 | - - - 15 | 16 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/we-ETH-accountant-oracle.md: -------------------------------------------------------------------------------- 1 | # WeETHAccountantOracle 2 | This oracle fetches the price of Ether.fi tokens based on an `Accountant` contract (i.e. weETHs and weETHk) 3 | 4 | # Solidity API 5 | 6 | ### ACCOUNTANT 7 | 8 | Address of Accountant 9 | 10 | ```solidity 11 | contract IAccountant ACCOUNTANT 12 | ``` 13 | 14 | - - - 15 | 16 | ### constructor 17 | 18 | Constructor for the implementation contract. 19 | 20 | ```solidity 21 | constructor(address accountant, address weethLRT, address weth, address resilientOracle) public 22 | ``` 23 | 24 | - - - 25 | 26 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/we-ETH-oracle.md: -------------------------------------------------------------------------------- 1 | # WeETHOracle 2 | This oracle fetches the price of weETH 3 | 4 | # Solidity API 5 | 6 | ### LIQUIDITY_POOL 7 | 8 | Address of Liqiudity pool 9 | 10 | ```solidity 11 | contract IEtherFiLiquidityPool LIQUIDITY_POOL 12 | ``` 13 | 14 | - - - 15 | 16 | ### constructor 17 | 18 | Constructor for the implementation contract. 19 | 20 | ```solidity 21 | constructor(address liquidityPool, address weETH, address eETH, address resilientOracle) public 22 | ``` 23 | 24 | - - - 25 | 26 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/correlated-token-oracles/wst-ETH-oracle.md: -------------------------------------------------------------------------------- 1 | # WstETHOracle 2 | Depending on the equivalence flag price is either based on assumption that 1 stETH = 1 ETH 3 | or the price of stETH/USD (secondary market price) is obtained from the oracle. 4 | 5 | # Solidity API 6 | 7 | ### ASSUME_STETH_ETH_EQUIVALENCE 8 | 9 | A flag assuming 1:1 price equivalence between stETH/ETH 10 | 11 | ```solidity 12 | bool ASSUME_STETH_ETH_EQUIVALENCE 13 | ``` 14 | 15 | - - - 16 | 17 | ### STETH 18 | 19 | Address of stETH 20 | 21 | ```solidity 22 | contract IStETH STETH 23 | ``` 24 | 25 | - - - 26 | 27 | ### WSTETH_ADDRESS 28 | 29 | Address of wstETH 30 | 31 | ```solidity 32 | address WSTETH_ADDRESS 33 | ``` 34 | 35 | - - - 36 | 37 | ### WETH_ADDRESS 38 | 39 | Address of WETH 40 | 41 | ```solidity 42 | address WETH_ADDRESS 43 | ``` 44 | 45 | - - - 46 | 47 | ### RESILIENT_ORACLE 48 | 49 | Address of Resilient Oracle 50 | 51 | ```solidity 52 | contract OracleInterface RESILIENT_ORACLE 53 | ``` 54 | 55 | - - - 56 | 57 | ### constructor 58 | 59 | Constructor for the implementation contract. 60 | 61 | ```solidity 62 | constructor(address wstETHAddress, address wETHAddress, address stETHAddress, address resilientOracleAddress, bool assumeEquivalence) public 63 | ``` 64 | 65 | - - - 66 | 67 | ### getPrice 68 | 69 | Gets the USD price of wstETH asset 70 | 71 | ```solidity 72 | function getPrice(address asset) public view returns (uint256) 73 | ``` 74 | 75 | #### Parameters 76 | | Name | Type | Description | 77 | | ---- | ---- | ----------- | 78 | | asset | address | Address of wstETH | 79 | 80 | #### Return Values 81 | | Name | Type | Description | 82 | | ---- | ---- | ----------- | 83 | | [0] | uint256 | wstETH Price in USD scaled by 1e18 | 84 | 85 | - - - 86 | 87 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/oracles/PythOracle.md: -------------------------------------------------------------------------------- 1 | # PythOracle 2 | PythOracle contract reads prices from actual Pyth oracle contract which accepts, verifies and stores 3 | the updated prices from external sources 4 | 5 | # Solidity API 6 | 7 | ```solidity 8 | struct TokenConfig { 9 | bytes32 pythId; 10 | address asset; 11 | uint64 maxStalePeriod; 12 | } 13 | ``` 14 | 15 | ### EXP_SCALE 16 | 17 | Exponent scale (decimal precision) of prices 18 | 19 | ```solidity 20 | uint256 EXP_SCALE 21 | ``` 22 | 23 | - - - 24 | 25 | ### BNB_ADDR 26 | 27 | Set this as asset address for BNB. This is the underlying for vBNB 28 | 29 | ```solidity 30 | address BNB_ADDR 31 | ``` 32 | 33 | - - - 34 | 35 | ### underlyingPythOracle 36 | 37 | The actual pyth oracle address fetch & store the prices 38 | 39 | ```solidity 40 | contract IPyth underlyingPythOracle 41 | ``` 42 | 43 | - - - 44 | 45 | ### tokenConfigs 46 | 47 | Token configs by asset address 48 | 49 | ```solidity 50 | mapping(address => struct PythOracle.TokenConfig) tokenConfigs 51 | ``` 52 | 53 | - - - 54 | 55 | ### constructor 56 | 57 | Constructor for the implementation contract. 58 | 59 | ```solidity 60 | constructor() public 61 | ``` 62 | 63 | - - - 64 | 65 | ### initialize 66 | 67 | Initializes the owner of the contract and sets required contracts 68 | 69 | ```solidity 70 | function initialize(address underlyingPythOracle_, address accessControlManager_) external 71 | ``` 72 | 73 | #### Parameters 74 | | Name | Type | Description | 75 | | ---- | ---- | ----------- | 76 | | underlyingPythOracle_ | address | Address of the Pyth oracle | 77 | | accessControlManager_ | address | Address of the access control manager contract | 78 | 79 | - - - 80 | 81 | ### setTokenConfigs 82 | 83 | Batch set token configs 84 | 85 | ```solidity 86 | function setTokenConfigs(struct PythOracle.TokenConfig[] tokenConfigs_) external 87 | ``` 88 | 89 | #### Parameters 90 | | Name | Type | Description | 91 | | ---- | ---- | ----------- | 92 | | tokenConfigs_ | struct PythOracle.TokenConfig[] | Token config array | 93 | 94 | #### ⛔️ Access Requirements 95 | * Only Governance 96 | 97 | #### ❌ Errors 98 | * Zero length error is thrown if length of the array in parameter is 0 99 | 100 | - - - 101 | 102 | ### setUnderlyingPythOracle 103 | 104 | Set the underlying Pyth oracle contract address 105 | 106 | ```solidity 107 | function setUnderlyingPythOracle(contract IPyth underlyingPythOracle_) external 108 | ``` 109 | 110 | #### Parameters 111 | | Name | Type | Description | 112 | | ---- | ---- | ----------- | 113 | | underlyingPythOracle_ | contract IPyth | Pyth oracle contract address | 114 | 115 | #### 📅 Events 116 | * Emits PythOracleSet event with address of Pyth oracle. 117 | 118 | #### ⛔️ Access Requirements 119 | * Only Governance 120 | 121 | #### ❌ Errors 122 | * NotNullAddress error thrown if underlyingPythOracle_ address is zero 123 | 124 | - - - 125 | 126 | ### setTokenConfig 127 | 128 | Set single token config. `maxStalePeriod` cannot be 0 and `asset` cannot be a null address 129 | 130 | ```solidity 131 | function setTokenConfig(struct PythOracle.TokenConfig tokenConfig) public 132 | ``` 133 | 134 | #### Parameters 135 | | Name | Type | Description | 136 | | ---- | ---- | ----------- | 137 | | tokenConfig | struct PythOracle.TokenConfig | Token config struct | 138 | 139 | #### ⛔️ Access Requirements 140 | * Only Governance 141 | 142 | #### ❌ Errors 143 | * Range error is thrown if max stale period is zero 144 | * NotNullAddress error is thrown if asset address is null 145 | 146 | - - - 147 | 148 | ### getPrice 149 | 150 | Gets the price of a asset from the pyth oracle 151 | 152 | ```solidity 153 | function getPrice(address asset) public view returns (uint256) 154 | ``` 155 | 156 | #### Parameters 157 | | Name | Type | Description | 158 | | ---- | ---- | ----------- | 159 | | asset | address | Address of the asset | 160 | 161 | #### Return Values 162 | | Name | Type | Description | 163 | | ---- | ---- | ----------- | 164 | | [0] | uint256 | Price in USD | 165 | 166 | - - - 167 | 168 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/oracles/README.md: -------------------------------------------------------------------------------- 1 | # Sources 2 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/oracles/binance-oracle.md: -------------------------------------------------------------------------------- 1 | # BinanceOracle 2 | This oracle fetches price of assets from Binance. 3 | 4 | # Solidity API 5 | 6 | ### sidRegistryAddress 7 | 8 | Used to fetch feed registry address. 9 | 10 | ```solidity 11 | address sidRegistryAddress 12 | ``` 13 | 14 | - - - 15 | 16 | ### BNB_ADDR 17 | 18 | Set this as asset address for BNB. This is the underlying address for vBNB 19 | 20 | ```solidity 21 | address BNB_ADDR 22 | ``` 23 | 24 | - - - 25 | 26 | ### maxStalePeriod 27 | 28 | Max stale period configuration for assets 29 | 30 | ```solidity 31 | mapping(string => uint256) maxStalePeriod 32 | ``` 33 | 34 | - - - 35 | 36 | ### symbols 37 | 38 | Override symbols to be compatible with Binance feed registry 39 | 40 | ```solidity 41 | mapping(string => string) symbols 42 | ``` 43 | 44 | - - - 45 | 46 | ### feedRegistryAddress 47 | 48 | Used to fetch price of assets used directly when space ID is not supported by current chain. 49 | 50 | ```solidity 51 | address feedRegistryAddress 52 | ``` 53 | 54 | - - - 55 | 56 | ### constructor 57 | 58 | Constructor for the implementation contract. 59 | 60 | ```solidity 61 | constructor() public 62 | ``` 63 | 64 | - - - 65 | 66 | ### initialize 67 | 68 | Sets the contracts required to fetch prices 69 | 70 | ```solidity 71 | function initialize(address _sidRegistryAddress, address _accessControlManager) external 72 | ``` 73 | 74 | #### Parameters 75 | | Name | Type | Description | 76 | | ---- | ---- | ----------- | 77 | | _sidRegistryAddress | address | Address of SID registry | 78 | | _accessControlManager | address | Address of the access control manager contract | 79 | 80 | - - - 81 | 82 | ### setMaxStalePeriod 83 | 84 | Used to set the max stale period of an asset 85 | 86 | ```solidity 87 | function setMaxStalePeriod(string symbol, uint256 _maxStalePeriod) external 88 | ``` 89 | 90 | #### Parameters 91 | | Name | Type | Description | 92 | | ---- | ---- | ----------- | 93 | | symbol | string | The symbol of the asset | 94 | | _maxStalePeriod | uint256 | The max stake period | 95 | 96 | - - - 97 | 98 | ### setSymbolOverride 99 | 100 | Used to override a symbol when fetching price 101 | 102 | ```solidity 103 | function setSymbolOverride(string symbol, string overrideSymbol) external 104 | ``` 105 | 106 | #### Parameters 107 | | Name | Type | Description | 108 | | ---- | ---- | ----------- | 109 | | symbol | string | The symbol to override | 110 | | overrideSymbol | string | The symbol after override | 111 | 112 | - - - 113 | 114 | ### setFeedRegistryAddress 115 | 116 | Used to set feed registry address when current chain does not support space ID. 117 | 118 | ```solidity 119 | function setFeedRegistryAddress(address newfeedRegistryAddress) external 120 | ``` 121 | 122 | #### Parameters 123 | | Name | Type | Description | 124 | | ---- | ---- | ----------- | 125 | | newfeedRegistryAddress | address | Address of new feed registry. | 126 | 127 | - - - 128 | 129 | ### getFeedRegistryAddress 130 | 131 | Uses Space ID to fetch the feed registry address 132 | 133 | ```solidity 134 | function getFeedRegistryAddress() public view returns (address) 135 | ``` 136 | 137 | #### Return Values 138 | | Name | Type | Description | 139 | | ---- | ---- | ----------- | 140 | | [0] | address | feedRegistryAddress Address of binance oracle feed registry. | 141 | 142 | - - - 143 | 144 | ### getPrice 145 | 146 | Gets the price of a asset from the binance oracle 147 | 148 | ```solidity 149 | function getPrice(address asset) public view returns (uint256) 150 | ``` 151 | 152 | #### Parameters 153 | | Name | Type | Description | 154 | | ---- | ---- | ----------- | 155 | | asset | address | Address of the asset | 156 | 157 | #### Return Values 158 | | Name | Type | Description | 159 | | ---- | ---- | ----------- | 160 | | [0] | uint256 | Price in USD | 161 | 162 | - - - 163 | 164 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/oracles/bound-validator.md: -------------------------------------------------------------------------------- 1 | # BoundValidator 2 | The BoundValidator contract is used to validate prices fetched from two different sources. 3 | Each asset has an upper and lower bound ratio set in the config. In order for a price to be valid 4 | it must fall within this range of the validator price. 5 | 6 | # Solidity API 7 | 8 | ```solidity 9 | struct ValidateConfig { 10 | address asset; 11 | uint256 upperBoundRatio; 12 | uint256 lowerBoundRatio; 13 | } 14 | ``` 15 | 16 | ### validateConfigs 17 | 18 | validation configs by asset 19 | 20 | ```solidity 21 | mapping(address => struct BoundValidator.ValidateConfig) validateConfigs 22 | ``` 23 | 24 | - - - 25 | 26 | ### constructor 27 | 28 | Constructor for the implementation contract. Sets immutable variables. 29 | 30 | ```solidity 31 | constructor() public 32 | ``` 33 | 34 | - - - 35 | 36 | ### initialize 37 | 38 | Initializes the owner of the contract 39 | 40 | ```solidity 41 | function initialize(address accessControlManager_) external 42 | ``` 43 | 44 | #### Parameters 45 | | Name | Type | Description | 46 | | ---- | ---- | ----------- | 47 | | accessControlManager_ | address | Address of the access control manager contract | 48 | 49 | - - - 50 | 51 | ### setValidateConfigs 52 | 53 | Add multiple validation configs at the same time 54 | 55 | ```solidity 56 | function setValidateConfigs(struct BoundValidator.ValidateConfig[] configs) external 57 | ``` 58 | 59 | #### Parameters 60 | | Name | Type | Description | 61 | | ---- | ---- | ----------- | 62 | | configs | struct BoundValidator.ValidateConfig[] | Array of validation configs | 63 | 64 | #### 📅 Events 65 | * Emits ValidateConfigAdded for each validation config that is successfully set 66 | 67 | #### ⛔️ Access Requirements 68 | * Only Governance 69 | 70 | #### ❌ Errors 71 | * Zero length error is thrown if length of the config array is 0 72 | 73 | - - - 74 | 75 | ### setValidateConfig 76 | 77 | Add a single validation config 78 | 79 | ```solidity 80 | function setValidateConfig(struct BoundValidator.ValidateConfig config) public 81 | ``` 82 | 83 | #### Parameters 84 | | Name | Type | Description | 85 | | ---- | ---- | ----------- | 86 | | config | struct BoundValidator.ValidateConfig | Validation config struct | 87 | 88 | #### 📅 Events 89 | * Emits ValidateConfigAdded when a validation config is successfully set 90 | 91 | #### ⛔️ Access Requirements 92 | * Only Governance 93 | 94 | #### ❌ Errors 95 | * Null address error is thrown if asset address is null 96 | * Range error thrown if bound ratio is not positive 97 | * Range error thrown if lower bound is greater than or equal to upper bound 98 | 99 | - - - 100 | 101 | ### validatePriceWithAnchorPrice 102 | 103 | Test reported asset price against anchor price 104 | 105 | ```solidity 106 | function validatePriceWithAnchorPrice(address asset, uint256 reportedPrice, uint256 anchorPrice) public view virtual returns (bool) 107 | ``` 108 | 109 | #### Parameters 110 | | Name | Type | Description | 111 | | ---- | ---- | ----------- | 112 | | asset | address | asset address | 113 | | reportedPrice | uint256 | The price to be tested | 114 | | anchorPrice | uint256 | | 115 | 116 | #### ❌ Errors 117 | * Missing error thrown if asset config is not set 118 | * Price error thrown if anchor price is not valid 119 | 120 | - - - 121 | 122 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/oracles/chainlink-oracle.md: -------------------------------------------------------------------------------- 1 | # ChainlinkOracle 2 | This oracle fetches prices of assets from the Chainlink oracle. 3 | 4 | # Solidity API 5 | 6 | ```solidity 7 | struct TokenConfig { 8 | address asset; 9 | address feed; 10 | uint256 maxStalePeriod; 11 | } 12 | ``` 13 | 14 | ### NATIVE_TOKEN_ADDR 15 | 16 | Set this as asset address for native token on each chain. 17 | This is the underlying address for vBNB on BNB chain or an underlying asset for a native market on any chain. 18 | 19 | ```solidity 20 | address NATIVE_TOKEN_ADDR 21 | ``` 22 | 23 | - - - 24 | 25 | ### prices 26 | 27 | Manually set an override price, useful under extenuating conditions such as price feed failure 28 | 29 | ```solidity 30 | mapping(address => uint256) prices 31 | ``` 32 | 33 | - - - 34 | 35 | ### tokenConfigs 36 | 37 | Token config by assets 38 | 39 | ```solidity 40 | mapping(address => struct ChainlinkOracle.TokenConfig) tokenConfigs 41 | ``` 42 | 43 | - - - 44 | 45 | ### constructor 46 | 47 | Constructor for the implementation contract. 48 | 49 | ```solidity 50 | constructor() public 51 | ``` 52 | 53 | - - - 54 | 55 | ### initialize 56 | 57 | Initializes the owner of the contract 58 | 59 | ```solidity 60 | function initialize(address accessControlManager_) external 61 | ``` 62 | 63 | #### Parameters 64 | | Name | Type | Description | 65 | | ---- | ---- | ----------- | 66 | | accessControlManager_ | address | Address of the access control manager contract | 67 | 68 | - - - 69 | 70 | ### setDirectPrice 71 | 72 | Manually set the price of a given asset 73 | 74 | ```solidity 75 | function setDirectPrice(address asset, uint256 price) external 76 | ``` 77 | 78 | #### Parameters 79 | | Name | Type | Description | 80 | | ---- | ---- | ----------- | 81 | | asset | address | Asset address | 82 | | price | uint256 | Asset price in 18 decimals | 83 | 84 | #### 📅 Events 85 | * Emits PricePosted event on succesfully setup of asset price 86 | 87 | #### ⛔️ Access Requirements 88 | * Only Governance 89 | 90 | - - - 91 | 92 | ### setTokenConfigs 93 | 94 | Add multiple token configs at the same time 95 | 96 | ```solidity 97 | function setTokenConfigs(struct ChainlinkOracle.TokenConfig[] tokenConfigs_) external 98 | ``` 99 | 100 | #### Parameters 101 | | Name | Type | Description | 102 | | ---- | ---- | ----------- | 103 | | tokenConfigs_ | struct ChainlinkOracle.TokenConfig[] | config array | 104 | 105 | #### ⛔️ Access Requirements 106 | * Only Governance 107 | 108 | #### ❌ Errors 109 | * Zero length error thrown, if length of the array in parameter is 0 110 | 111 | - - - 112 | 113 | ### setTokenConfig 114 | 115 | Add single token config. asset & feed cannot be null addresses and maxStalePeriod must be positive 116 | 117 | ```solidity 118 | function setTokenConfig(struct ChainlinkOracle.TokenConfig tokenConfig) public 119 | ``` 120 | 121 | #### Parameters 122 | | Name | Type | Description | 123 | | ---- | ---- | ----------- | 124 | | tokenConfig | struct ChainlinkOracle.TokenConfig | Token config struct | 125 | 126 | #### 📅 Events 127 | * Emits TokenConfigAdded event on succesfully setting of the token config 128 | 129 | #### ⛔️ Access Requirements 130 | * Only Governance 131 | 132 | #### ❌ Errors 133 | * NotNullAddress error is thrown if asset address is null 134 | * NotNullAddress error is thrown if token feed address is null 135 | * Range error is thrown if maxStale period of token is not greater than zero 136 | 137 | - - - 138 | 139 | ### getPrice 140 | 141 | Gets the price of a asset from the chainlink oracle 142 | 143 | ```solidity 144 | function getPrice(address asset) public view virtual returns (uint256) 145 | ``` 146 | 147 | #### Parameters 148 | | Name | Type | Description | 149 | | ---- | ---- | ----------- | 150 | | asset | address | Address of the asset | 151 | 152 | #### Return Values 153 | | Name | Type | Description | 154 | | ---- | ---- | ----------- | 155 | | [0] | uint256 | Price in USD from Chainlink or a manually set price for the asset | 156 | 157 | - - - 158 | 159 | -------------------------------------------------------------------------------- /technical-reference/reference-oracle/oracles/sequencer-chainlink-oracle.md: -------------------------------------------------------------------------------- 1 | # Sequencer Chain Link Oracle 2 | Oracle to fetch price using chainlink oracles on L2s with sequencer 3 | 4 | # Solidity API 5 | 6 | ### sequencer 7 | 8 | L2 Sequencer feed 9 | 10 | ```solidity 11 | contract AggregatorV3Interface sequencer 12 | ``` 13 | 14 | - - - 15 | 16 | ### GRACE_PERIOD_TIME 17 | 18 | L2 Sequencer grace period 19 | 20 | ```solidity 21 | uint256 GRACE_PERIOD_TIME 22 | ``` 23 | 24 | - - - 25 | 26 | ### constructor 27 | 28 | Contract constructor 29 | @param _sequencer L2 sequencer 30 | @custom:oz-upgrades-unsafe-allow constructor 31 | 32 | ```solidity 33 | constructor(contract AggregatorV3Interface _sequencer) public 34 | ``` 35 | 36 | - - - 37 | 38 | ### getPrice 39 | 40 | Gets the price of a asset from the chainlink oracle 41 | 42 | ```solidity 43 | function getPrice(address asset) public view returns (uint256) 44 | ``` 45 | 46 | #### Parameters 47 | | Name | Type | Description | 48 | | ---- | ---- | ----------- | 49 | | asset | address | Address of the asset | 50 | 51 | #### Return Values 52 | | Name | Type | Description | 53 | | ---- | ---- | ----------- | 54 | | [0] | uint256 | Price in USD from Chainlink or a manually set price for the asset | 55 | 56 | - - - 57 | 58 | -------------------------------------------------------------------------------- /technical-reference/reference-technical-articles/README.md: -------------------------------------------------------------------------------- 1 | # Technical articles -------------------------------------------------------------------------------- /technical-reference/reference-technical-articles/two-kinks-interest-rate-curve.md: -------------------------------------------------------------------------------- 1 | # Two Kinks Interest Rate Curve 2 | 3 | ## Overview 4 | 5 | The 2-Kink Interest Rate Curve introduces a new model to optimize interest rates and utilization across Venus protocol markets. By incorporating two separate "kinks", this model aims to provide more flexible control over market dynamics, enhancing both the predictability and efficiency of APYs (Annual Percentage Yields) for borrowers and suppliers. 6 | 7 | This design helps reduce the volatility of APYs during periods of high demand, such as during launchpool events, and encourages greater participation by offering more predictable costs and returns. 8 | 9 | ## 2-Kink Interest Rate Model Architecture 10 | 11 | The 2-Kink IR Curve is built into the Interest Rate Models used by Venus markets. It allows for two distinct kinks in the curve, separating the initial utilization phase from the high-utilization phase. This enables better control over borrow and supply rates as utilization increases. 12 | 13 | The curve is defined by: 14 | 15 | - **Kink**: A utilization threshold where the interest rate curve’s slope changes. 16 | - **Multiplier**: The rate at which the interest rate increases before and after the kink, controlling the curve’s steepness. 17 | - **Base Rate**: A predefined APY jump at the start of the curve or any kink, providing a step-up in interest rates as utilization increases. 18 | 19 | By using two kinks and base rates, the protocol can more accurately balance supply and borrow demand, especially in markets with varying demand cycles like launchpools. 20 | 21 |
Two Kinks Interest Rate Model
Two Kinks Interest Rate Model
22 | 23 | ## Benefits of 2-Kink IR Curve 24 | 25 | - **More Predictable APYs**: By introducing a second kink, the interest rate curve allows for smoother transitions in APYs as market utilization changes. 26 | - **Increased Participation**: Both borrowers and suppliers benefit from more predictable rates, encouraging greater market participation even during high-demand periods. 27 | - **Optimized Market Efficiency**: By reducing sharp spikes in borrow APYs, the 2-Kink IR Curve improves the overall efficiency of Venus markets, ensuring better control over utilization rates and protocol reserves. 28 | 29 | ## Smart Contract Reference 30 | 31 | * [Two Kinks Rate Model contract (for the Core pool on BNB Chain)](../reference-core-pool/interestratemodels/twokinksinterestratemodel.md) 32 | * [Two Kinks Rate Model contract (for the Isolated pools)](../reference-isolated-pools/interest-rate-models/two-kinks-interest-rate-model.md) 33 | * [Jump Rate Model contract (used in the Core pool on BNB Chain)](../reference-core-pool/interestratemodels/jumpmodel.md) 34 | * [Jump Rate Model V2 contract (used in the Isolated pools)](../reference-isolated-pools/interest-rate-models/jump-rate-model-v2.md) -------------------------------------------------------------------------------- /technical-reference/reference-token-converter/README.md: -------------------------------------------------------------------------------- 1 | # Token Converter -------------------------------------------------------------------------------- /technical-reference/reference-token-converter/RiskFundConverter.md: -------------------------------------------------------------------------------- 1 | # RiskFundConverter 2 | This contract extends the AbtractTokenConverter contract. It maintains a distribution of assets per comptroller and assets. ProtocolShareReserve will send RiskFund's share of income to this contract which will convert the assets and send them to RiskFund. 3 | 4 | # Solidity API 5 | 6 | ### CORE_POOL_COMPTROLLER 7 | 8 | Address of the core pool comptroller 9 | 10 | ```solidity 11 | address CORE_POOL_COMPTROLLER 12 | ``` 13 | 14 | - - - 15 | 16 | ### VBNB 17 | 18 | Address of the vBNB 19 | 20 | ```solidity 21 | address VBNB 22 | ``` 23 | 24 | - - - 25 | 26 | ### NATIVE_WRAPPED 27 | 28 | Address of the native wrapped currency 29 | 30 | ```solidity 31 | address NATIVE_WRAPPED 32 | ``` 33 | 34 | - - - 35 | 36 | ### poolRegistry 37 | 38 | Address of pool registry contract 39 | 40 | ```solidity 41 | address poolRegistry 42 | ``` 43 | 44 | - - - 45 | 46 | ### poolsAssetsDirectTransfer 47 | 48 | The mapping contains the assets for each pool which are sent to RiskFund directly 49 | 50 | ```solidity 51 | mapping(address => mapping(address => bool)) poolsAssetsDirectTransfer 52 | ``` 53 | 54 | - - - 55 | 56 | ### setPoolsAssetsDirectTransfer 57 | 58 | Update the poolsAssetsDirectTransfer mapping 59 | 60 | ```solidity 61 | function setPoolsAssetsDirectTransfer(address[] comptrollers, address[][] assets, bool[][] values) external 62 | ``` 63 | 64 | #### Parameters 65 | | Name | Type | Description | 66 | | ---- | ---- | ----------- | 67 | | comptrollers | address[] | Addresses of the pools | 68 | | assets | address[][] | Addresses of the assets need to be added for direct transfer | 69 | | values | bool[][] | Boolean value to indicate whether direct transfer is allowed for each asset. | 70 | 71 | #### 📅 Events 72 | * PoolAssetsDirectTransferUpdated emits on success 73 | 74 | #### ⛔️ Access Requirements 75 | * Restricted by ACM 76 | 77 | - - - 78 | 79 | ### balanceOf 80 | 81 | Get the balance for specific token 82 | 83 | ```solidity 84 | function balanceOf(address tokenAddress) public view returns (uint256 tokenBalance) 85 | ``` 86 | 87 | #### Parameters 88 | | Name | Type | Description | 89 | | ---- | ---- | ----------- | 90 | | tokenAddress | address | Address of the token | 91 | 92 | #### Return Values 93 | | Name | Type | Description | 94 | | ---- | ---- | ----------- | 95 | | tokenBalance | uint256 | Reserves of the token the contract has | 96 | 97 | - - - 98 | 99 | ### getPools 100 | 101 | Get the array of all pools addresses 102 | 103 | ```solidity 104 | function getPools(address tokenAddress) public view returns (address[] poolsWithCore) 105 | ``` 106 | 107 | #### Parameters 108 | | Name | Type | Description | 109 | | ---- | ---- | ----------- | 110 | | tokenAddress | address | Address of the token | 111 | 112 | #### Return Values 113 | | Name | Type | Description | 114 | | ---- | ---- | ----------- | 115 | | poolsWithCore | address[] | Array of the pools addresses in which token is available | 116 | 117 | - - - 118 | 119 | -------------------------------------------------------------------------------- /technical-reference/reference-token-converter/SingleTokenConverter.md: -------------------------------------------------------------------------------- 1 | # SingleTokenConverter 2 | 3 | Used for token conversions and sends received tokens 4 | 5 | # Solidity API 6 | 7 | ### baseAsset 8 | 9 | Address of the base asset token 10 | 11 | ```solidity 12 | address baseAsset 13 | ``` 14 | 15 | - - - 16 | 17 | ### setBaseAsset 18 | 19 | Sets the base asset for the contract 20 | 21 | ```solidity 22 | function setBaseAsset(address baseAsset_) external 23 | ``` 24 | 25 | #### Parameters 26 | | Name | Type | Description | 27 | | ---- | ---- | ----------- | 28 | | baseAsset_ | address | The new address of the base asset | 29 | 30 | #### ⛔️ Access Requirements 31 | * Only Governance 32 | 33 | - - - 34 | 35 | ### balanceOf 36 | 37 | Get the balance for specific token 38 | 39 | ```solidity 40 | function balanceOf(address tokenAddress) public view returns (uint256 tokenBalance) 41 | ``` 42 | 43 | #### Parameters 44 | | Name | Type | Description | 45 | | ---- | ---- | ----------- | 46 | | tokenAddress | address | Address of the token | 47 | 48 | #### Return Values 49 | | Name | Type | Description | 50 | | ---- | ---- | ----------- | 51 | | tokenBalance | uint256 | Balance of the token the contract has | 52 | 53 | - - - 54 | 55 | -------------------------------------------------------------------------------- /technical-reference/reference-xvs-bridge/README.md: -------------------------------------------------------------------------------- 1 | # XVS Bridge -------------------------------------------------------------------------------- /technical-reference/reference-xvs-bridge/TokenController.md: -------------------------------------------------------------------------------- 1 | # TokenController 2 | TokenController contract acts as a governance and access control mechanism, 3 | allowing the owner to manage minting restrictions and blacklist certain addresses to maintain control and security within the token ecosystem. 4 | It provides a flexible framework for token-related operations. 5 | 6 | # Solidity API 7 | 8 | ### accessControlManager 9 | 10 | Access control manager contract address. 11 | 12 | ```solidity 13 | address accessControlManager 14 | ``` 15 | 16 | - - - 17 | 18 | ### minterToCap 19 | 20 | A mapping is used to keep track of the maximum amount a minter is permitted to mint. 21 | 22 | ```solidity 23 | mapping(address => uint256) minterToCap 24 | ``` 25 | 26 | - - - 27 | 28 | ### minterToMintedAmount 29 | 30 | A Mapping used to keep track of the amount i.e already minted by minter. 31 | 32 | ```solidity 33 | mapping(address => uint256) minterToMintedAmount 34 | ``` 35 | 36 | - - - 37 | 38 | ### pause 39 | 40 | Pauses Token 41 | 42 | ```solidity 43 | function pause() external 44 | ``` 45 | 46 | #### ⛔️ Access Requirements 47 | * Controlled by AccessControlManager. 48 | 49 | - - - 50 | 51 | ### unpause 52 | 53 | Resumes Token 54 | 55 | ```solidity 56 | function unpause() external 57 | ``` 58 | 59 | #### ⛔️ Access Requirements 60 | * Controlled by AccessControlManager. 61 | 62 | - - - 63 | 64 | ### updateBlacklist 65 | 66 | Function to update blacklist. 67 | 68 | ```solidity 69 | function updateBlacklist(address user_, bool value_) external 70 | ``` 71 | 72 | #### Parameters 73 | | Name | Type | Description | 74 | | ---- | ---- | ----------- | 75 | | user_ | address | User address to be affected. | 76 | | value_ | bool | Boolean to toggle value. | 77 | 78 | #### 📅 Events 79 | * Emits BlacklistUpdated event. 80 | 81 | #### ⛔️ Access Requirements 82 | * Controlled by AccessControlManager. 83 | 84 | - - - 85 | 86 | ### setMintCap 87 | 88 | Sets the minting cap for minter. 89 | 90 | ```solidity 91 | function setMintCap(address minter_, uint256 amount_) external 92 | ``` 93 | 94 | #### Parameters 95 | | Name | Type | Description | 96 | | ---- | ---- | ----------- | 97 | | minter_ | address | Minter address. | 98 | | amount_ | uint256 | Cap for the minter. | 99 | 100 | #### 📅 Events 101 | * Emits MintCapChanged. 102 | 103 | #### ⛔️ Access Requirements 104 | * Controlled by AccessControlManager. 105 | 106 | - - - 107 | 108 | ### setAccessControlManager 109 | 110 | Sets the address of the access control manager of this contract. 111 | 112 | ```solidity 113 | function setAccessControlManager(address newAccessControlAddress_) external 114 | ``` 115 | 116 | #### Parameters 117 | | Name | Type | Description | 118 | | ---- | ---- | ----------- | 119 | | newAccessControlAddress_ | address | New address for the access control. | 120 | 121 | #### 📅 Events 122 | * Emits NewAccessControlManager. 123 | 124 | #### ⛔️ Access Requirements 125 | * Only owner. 126 | 127 | #### ❌ Errors 128 | * ZeroAddressNotAllowed is thrown when newAccessControlAddress_ contract address is zero. 129 | 130 | - - - 131 | 132 | ### isBlackListed 133 | 134 | Returns the blacklist status of the address. 135 | 136 | ```solidity 137 | function isBlackListed(address user_) external view returns (bool) 138 | ``` 139 | 140 | #### Parameters 141 | | Name | Type | Description | 142 | | ---- | ---- | ----------- | 143 | | user_ | address | Address of user to check blacklist status. | 144 | 145 | #### Return Values 146 | | Name | Type | Description | 147 | | ---- | ---- | ----------- | 148 | | [0] | bool | bool status of blacklist. | 149 | 150 | - - - 151 | 152 | -------------------------------------------------------------------------------- /technical-reference/reference-xvs-bridge/XVS.md: -------------------------------------------------------------------------------- 1 | # XVS 2 | XVS contract serves as a customized ERC-20 token with additional minting and burning functionality. 3 | It also incorporates access control features provided by the "TokenController" contract to ensure proper governance and restrictions on minting and burning operations. 4 | 5 | # Solidity API 6 | 7 | ### mint 8 | 9 | Creates `amount_` tokens and assigns them to `account_`, increasing 10 | the total supply. Checks access and eligibility. 11 | 12 | ```solidity 13 | function mint(address account_, uint256 amount_) external 14 | ``` 15 | 16 | #### Parameters 17 | | Name | Type | Description | 18 | | ---- | ---- | ----------- | 19 | | account_ | address | Address to which tokens are assigned. | 20 | | amount_ | uint256 | Amount of tokens to be assigned. | 21 | 22 | #### 📅 Events 23 | * Emits MintLimitDecreased with new available limit. 24 | 25 | #### ⛔️ Access Requirements 26 | * Controlled by AccessControlManager. 27 | 28 | #### ❌ Errors 29 | * MintLimitExceed is thrown when minting amount exceeds the maximum cap. 30 | 31 | - - - 32 | 33 | ### burn 34 | 35 | Destroys `amount_` tokens from `account_`, reducing the 36 | total supply. Checks access and eligibility. 37 | 38 | ```solidity 39 | function burn(address account_, uint256 amount_) external 40 | ``` 41 | 42 | #### Parameters 43 | | Name | Type | Description | 44 | | ---- | ---- | ----------- | 45 | | account_ | address | Address from which tokens be destroyed. | 46 | | amount_ | uint256 | Amount of tokens to be destroyed. | 47 | 48 | #### 📅 Events 49 | * Emits MintLimitIncreased with new available limit. 50 | 51 | #### ⛔️ Access Requirements 52 | * Controlled by AccessControlManager. 53 | 54 | - - - 55 | 56 | -------------------------------------------------------------------------------- /technical-reference/reference-xvs-bridge/XVSBridgeAdmin.md: -------------------------------------------------------------------------------- 1 | # XVSBridgeAdmin 2 | The XVSBridgeAdmin contract extends a parent contract AccessControlledV8 for access control, and it manages an external contract called XVSProxyOFT. 3 | It maintains a registry of function signatures and names, 4 | allowing for dynamic function handling i.e checking of access control of interaction with only owner functions. 5 | 6 | # Solidity API 7 | 8 | ### functionRegistry 9 | 10 | A mapping keeps track of function signature associated with function name string. 11 | 12 | ```solidity 13 | mapping(bytes4 => string) functionRegistry 14 | ``` 15 | 16 | - - - 17 | 18 | ### fallback 19 | 20 | Invoked when called function does not exist in the contract. 21 | 22 | ```solidity 23 | fallback(bytes data) external returns (bytes) 24 | ``` 25 | 26 | #### Return Values 27 | | Name | Type | Description | 28 | | ---- | ---- | ----------- | 29 | | [0] | bytes | Response of low level call. | 30 | 31 | #### ⛔️ Access Requirements 32 | * Controlled by AccessControlManager. 33 | 34 | - - - 35 | 36 | ### setTrustedRemoteAddress 37 | 38 | Sets trusted remote on particular chain. 39 | 40 | ```solidity 41 | function setTrustedRemoteAddress(uint16 remoteChainId_, bytes remoteAddress_) external 42 | ``` 43 | 44 | #### Parameters 45 | | Name | Type | Description | 46 | | ---- | ---- | ----------- | 47 | | remoteChainId_ | uint16 | Chain Id of the destination chain. | 48 | | remoteAddress_ | bytes | Address of the destination bridge. | 49 | 50 | #### ⛔️ Access Requirements 51 | * Controlled by AccessControlManager. 52 | 53 | #### ❌ Errors 54 | * ZeroAddressNotAllowed is thrown when remoteAddress_ contract address is zero. 55 | 56 | - - - 57 | 58 | ### upsertSignature 59 | 60 | A setter for the registry of functions that are allowed to be executed from proposals. 61 | 62 | ```solidity 63 | function upsertSignature(string[] signatures_, bool[] active_) external 64 | ``` 65 | 66 | #### Parameters 67 | | Name | Type | Description | 68 | | ---- | ---- | ----------- | 69 | | signatures_ | string[] | Function signature to be added or removed. | 70 | | active_ | bool[] | bool value, should be true to add function. | 71 | 72 | #### 📅 Events 73 | * Emits FunctionRegistryChanged if bool value of function changes. 74 | 75 | #### ⛔️ Access Requirements 76 | * Only owner. 77 | 78 | - - - 79 | 80 | ### transferBridgeOwnership 81 | 82 | This function transfers the ownership of the bridge from this contract to new owner. 83 | 84 | ```solidity 85 | function transferBridgeOwnership(address newOwner_) external 86 | ``` 87 | 88 | #### Parameters 89 | | Name | Type | Description | 90 | | ---- | ---- | ----------- | 91 | | newOwner_ | address | New owner of the XVS Bridge. | 92 | 93 | #### ⛔️ Access Requirements 94 | * Controlled by AccessControlManager. 95 | 96 | - - - 97 | 98 | ### isTrustedRemote 99 | 100 | Returns true if remote address is trustedRemote corresponds to chainId_. 101 | 102 | ```solidity 103 | function isTrustedRemote(uint16 remoteChainId_, bytes remoteAddress_) external returns (bool) 104 | ``` 105 | 106 | #### Parameters 107 | | Name | Type | Description | 108 | | ---- | ---- | ----------- | 109 | | remoteChainId_ | uint16 | Chain Id of the destination chain. | 110 | | remoteAddress_ | bytes | Address of the destination bridge. | 111 | 112 | #### Return Values 113 | | Name | Type | Description | 114 | | ---- | ---- | ----------- | 115 | | [0] | bool | Bool indicating whether the remote chain is trusted or not. | 116 | 117 | #### ❌ Errors 118 | * ZeroAddressNotAllowed is thrown when remoteAddress_ contract address is zero. 119 | 120 | - - - 121 | 122 | ### renounceOwnership 123 | 124 | Empty implementation of renounce ownership to avoid any mishappening. 125 | 126 | ```solidity 127 | function renounceOwnership() public 128 | ``` 129 | 130 | - - - 131 | 132 | -------------------------------------------------------------------------------- /technical-reference/reference-xvs-bridge/XVSProxyOFTDest.md: -------------------------------------------------------------------------------- 1 | # XVSProxyOFTDest 2 | XVSProxyOFTDest contract builds upon the functionality of its parent contract, BaseXVSProxyOFT, 3 | and focuses on managing token transfers to the destination chain. 4 | It provides functions to check eligibility and perform the actual token transfers while maintaining strict access controls and pausing mechanisms. 5 | 6 | # Solidity API 7 | 8 | ### dropFailedMessage 9 | 10 | Clear failed messages from the storage. 11 | 12 | ```solidity 13 | function dropFailedMessage(uint16 srcChainId_, bytes srcAddress_, uint64 nonce_) external 14 | ``` 15 | 16 | #### Parameters 17 | | Name | Type | Description | 18 | | ---- | ---- | ----------- | 19 | | srcChainId_ | uint16 | Chain id of source | 20 | | srcAddress_ | bytes | Address of source followed by current bridge address | 21 | | nonce_ | uint64 | Nonce_ of the transaction | 22 | 23 | #### 📅 Events 24 | * Emits DropFailedMessage on clearance of failed message. 25 | 26 | #### ⛔️ Access Requirements 27 | * Only owner 28 | 29 | - - - 30 | 31 | ### circulatingSupply 32 | 33 | Returns the total circulating supply of the token on the destination chain i.e (total supply). 34 | 35 | ```solidity 36 | function circulatingSupply() public view returns (uint256) 37 | ``` 38 | 39 | #### Return Values 40 | | Name | Type | Description | 41 | | ---- | ---- | ----------- | 42 | | [0] | uint256 | total circulating supply of the token on the destination chain. | 43 | 44 | - - - 45 | 46 | -------------------------------------------------------------------------------- /technical-reference/reference-xvs-bridge/XVSProxyOFTSrc.md: -------------------------------------------------------------------------------- 1 | # XVSProxyOFTSrc 2 | XVSProxyOFTSrc contract serves as a crucial component for cross-chain token transactions, 3 | focusing on the source side of these transactions. 4 | It monitors the total amount transferred to other chains, ensuring it complies with defined limits, 5 | and provides functions for transferring tokens while maintaining control over the circulating supply on the source chain. 6 | 7 | # Solidity API 8 | 9 | ### outboundAmount 10 | 11 | Total amount that is transferred from this chain to other chains. 12 | 13 | ```solidity 14 | uint256 outboundAmount 15 | ``` 16 | 17 | - - - 18 | 19 | ### fallbackWithdraw 20 | 21 | Only call it when there is no way to recover the failed message. 22 | `dropFailedMessage` must be called first if transaction is from remote->local chain to avoid double spending. 23 | 24 | ```solidity 25 | function fallbackWithdraw(address to_, uint256 amount_) external 26 | ``` 27 | 28 | #### Parameters 29 | | Name | Type | Description | 30 | | ---- | ---- | ----------- | 31 | | to_ | address | The address to withdraw to | 32 | | amount_ | uint256 | The amount of withdrawal | 33 | 34 | #### 📅 Events 35 | * Emits FallbackWithdraw, once done with transfer. 36 | 37 | #### ⛔️ Access Requirements 38 | * Only owner. 39 | 40 | - - - 41 | 42 | ### dropFailedMessage 43 | 44 | Clear failed messages from the storage. 45 | 46 | ```solidity 47 | function dropFailedMessage(uint16 srcChainId_, bytes srcAddress_, uint64 nonce_) external 48 | ``` 49 | 50 | #### Parameters 51 | | Name | Type | Description | 52 | | ---- | ---- | ----------- | 53 | | srcChainId_ | uint16 | Chain id of source | 54 | | srcAddress_ | bytes | Address of source followed by current bridge address | 55 | | nonce_ | uint64 | Nonce_ of the transaction | 56 | 57 | #### 📅 Events 58 | * Emits DropFailedMessage on clearance of failed message. 59 | 60 | #### ⛔️ Access Requirements 61 | * Only owner. 62 | 63 | - - - 64 | 65 | ### circulatingSupply 66 | 67 | Returns the total circulating supply of the token on the source chain i.e (total supply - locked in this contract). 68 | 69 | ```solidity 70 | function circulatingSupply() public view returns (uint256) 71 | ``` 72 | 73 | #### Return Values 74 | | Name | Type | Description | 75 | | ---- | ---- | ----------- | 76 | | [0] | uint256 | Returns difference in total supply and the outbound amount. | 77 | 78 | - - - 79 | 80 | -------------------------------------------------------------------------------- /tokens/vai-unitroller.md: -------------------------------------------------------------------------------- 1 | # VAI Unitroller 2 | 3 | This is the proxy contract for the VAIComptroller 4 | 5 | # Solidity API 6 | 7 | ### \_setPendingImplementation 8 | 9 | * Admin Functions \*\* 10 | 11 | ```solidity 12 | function _setPendingImplementation(address newPendingImplementation) public returns (uint256) 13 | ``` 14 | 15 | --- 16 | 17 | ### \_acceptImplementation 18 | 19 | Accepts new implementation of comptroller. msg.sender must be pendingImplementation 20 | 21 | ```solidity 22 | function _acceptImplementation() public returns (uint256) 23 | ``` 24 | 25 | #### Return Values 26 | 27 | | Name | Type | Description | 28 | | ---- | ---- | ----------- | 29 | | \[0] | uint256 | uint 0=success, otherwise a failure (see ErrorReporter.sol for details) | 30 | 31 | --- 32 | 33 | ### \_setPendingAdmin 34 | 35 | Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer. 36 | 37 | ```solidity 38 | function _setPendingAdmin(address newPendingAdmin) public returns (uint256) 39 | ``` 40 | 41 | #### Parameters 42 | 43 | | Name | Type | Description | 44 | | ---- | ---- | ----------- | 45 | | newPendingAdmin | address | New pending admin. | 46 | 47 | #### Return Values 48 | 49 | | Name | Type | Description | 50 | | ---- | ---- | ----------- | 51 | | \[0] | uint256 | uint 0=success, otherwise a failure (see ErrorReporter.sol for details) | 52 | 53 | --- 54 | 55 | ### \_acceptAdmin 56 | 57 | Accepts transfer of admin rights. msg.sender must be pendingAdmin 58 | 59 | ```solidity 60 | function _acceptAdmin() public returns (uint256) 61 | ``` 62 | 63 | #### Return Values 64 | 65 | | Name | Type | Description | 66 | | ---- | ---- | ----------- | 67 | | \[0] | uint256 | uint 0=success, otherwise a failure (see ErrorReporter.sol for details) | 68 | 69 | --- 70 | -------------------------------------------------------------------------------- /tokens/vai.md: -------------------------------------------------------------------------------- 1 | # VAI 2 | 3 | ### Overview 4 | 5 | VAI is the primary stablecoin of the Venus Protocol. It is carefully designed and integrated with a series of stability mechanisms to maintain its peg to 1 USD. 6 | 7 | ### Stability Fee and Optimised Minting 8 | 9 | VAI sustains its value via a stability fee system. This fee is a charge that users incur when they repay their minted VAI. Calculated on a block-by-block basis, this fee gets added to the user's minted VAI balance. This fee system encourages users to either mint or burn VAI in response to its price fluctuations, thereby contributing to its stability. 10 | 11 | The stability fee is determined through the following formula: 12 | 13 | $$ 14 | \text{{stabilityFee}}(\%) = \text{{baseRate}}(\%) + \max(0, (1 - \text{{currentPriceOfVAI}})) \times \text{{floatingRate}}(\%) 15 | $$ 16 | 17 | The `baseRate` is a fixed rate that users must always pay, while `max(0, (1 - currentPriceOfVAI)) * floatingRate` is a variable rate that users pay based on outstanding VAI. This incentivizes users to burn or mint VAI according to its price. The variable rate will always be greater or equal to zero, meaning the minimum stability fee will be the base rate. 18 | 19 | Revenue generated from the stability fee serves as a financial cushion during extreme market conditions, such as bad debt scenarios. 20 | -------------------------------------------------------------------------------- /tokens/xvs.md: -------------------------------------------------------------------------------- 1 | # XVS 2 | 3 | ### Overview 4 | 5 | XVS is the native token of Venus Protocol and serves as its governance token. By staking XVS tokens in the vault, users gain voting power proportionate to the amount staked. This voting power enables them to participate in the voting process for Venus Improvement Proposals (VIPs), thereby playing a critical role in the development and evolution of the Venus Protocol. 6 | 7 | Furthermore, users who stake their XVS tokens in the vault have the potential to earn yield, creating an incentive for participation in the Venus governance process. This aligns the interests of XVS holders with the overall health and success of the Venus Protocol. 8 | 9 | ### Next Steps and Future of XVS 10 | 11 | The upcoming Venus Prime program adds a new dimension to the utility of XVS tokens. As Venus Protocol continues to innovate: 12 | 13 | * The launch of Venus Prime will provide opportunities for additional yield to committed users, using protocol's revenue instead of just relying on the token supply. 14 | * The program will introduce unique, non-transferable tokens for eligible participants, adding a new layer of user interaction. 15 | 16 | These developments further emphasize the importance of the XVS token in the ecosystem, providing holders with more ways to earn and participate in the protocol's future. 17 | -------------------------------------------------------------------------------- /whats-new/automatic-income-allocation.md: -------------------------------------------------------------------------------- 1 | # Automatic Income Allocation 2 | 3 | ### Overview 4 | 5 | This innovation is designed to distribute the incomes generated by Venus Protocol seamlessly, channeling them to different destinations according to specific rules and percentages. This functionality will incorporate incomes generated through various sources, including interest reserves and liquidation incentives, for both the Core pools and Isolated pools. The goal is to distribute these incomes in underlying tokens and not in vTokens, based on the latest protocol [tokenomics](https://snapshot.org/#/venus-xvs.eth/proposal/0xc9d270ccecb7b91c75b95b8d9af24fc7c20cd38c0c0c44888ed4e7724f4e7ce9). 6 | 7 | ### Key Aspects of Automatic Income Allocation 8 | 9 | * **Near-Streaming Distribution**: The income will be distributed in a near-streaming fashion, from the different pools to the ProtocolShareReserve contract. 10 | * **Flexible Distribution Rules**: The incomes generated by Venus Protocol will be distributed according to two schemas: 11 | * **Schema (PROTOCOL\_RESERVES)**: Applied specifically to income generated by the interest reserves in every Venus market. 12 | * 60% to Treasury 13 | * 20% to XVS Vault rewards 14 | * 20% to Venus Prime 15 | * **Schema (ADDITIONAL\_REVENUE)**: Valid for liquidation and other product developments. 16 | * 80% to Treasury 17 | * 20% to XVS Vault rewards 18 | * **Integration with Existing Architecture**: The Automatic Income Allocation will seamlessly integrate with the existing ProtocolShareReserve contract, ensuring that the incomes are sent to their designated reserves. 19 | 20 | ### Benefits 21 | 22 | * **Efficiency**: Automating the income distribution process allows for quicker and more accurate allocation. 23 | * **Transparency**: All distributions are recorded on the blockchain, reinforcing Venus Protocol's commitment to clear and open practices. 24 | * **Flexibility**: The ability to define specific rules and percentages for different destinations ensures that the distribution aligns with the community's needs and goals. 25 | 26 | ### Architecture 27 | 28 |
29 | 30 | _The dashed lines represent transactions initiated by external agents (VIP’s, scripts, arbitrage bots, etc.), and the solid lines represent transfers of funds._ 31 | -------------------------------------------------------------------------------- /whats-new/isolated-pools.md: -------------------------------------------------------------------------------- 1 | # Isolated Pools 2 | 3 | ### Overview 4 | 5 | Isolated Pools are made up of separate collections of assets with tailored risk management configurations. This design offers users broader opportunities to manage risk and allocate assets to earn yield. Moreover, it prevents hypothetical failures from affecting the liquidity of the entire protocol as they are confined to isolated markets. 6 | 7 | Isolated Pools also offer custom rewards for each market in the pool, incentivizing users accordingly. 8 | 9 | ### Isolated Pools Architecture 10 | 11 | The Isolated Pools system is based on the *PoolRegistry* contract. It maintains a directory of isolated lending pools, allows the creation and registration of new pools, and offers getter methods to fetch pool details. 12 | 13 | To add a new market to an existing lending pool, the PoolRegistry deploys a JumpRateModelV2 or a WhitePaperInterestRateModel contract, deploying the upgradable VToken for the market before gaining the approval of the market's Comptroller. 14 | 15 |

Isolated Lending Pools Architecture

16 | 17 | ### User Actions 18 | 19 | Users can perform the following actions on any market in a pool: 20 | 21 | 1. **Deposit**: Users can deposit an asset, receiving vTokens that correspond to the liquidity deposited. These vTokens accrue interest until they are burned on redeem or liquidated. 22 | 2. **Borrow**: Users can borrow assets, in exchange for locked collateral. 23 | 3. **Redeem**: Users can redeem vTokens for the underlying asset based on the exchange rate. 24 | 4. **Repay Borrow**: Users can repay the borrowed asset and accrued interest. 25 | -------------------------------------------------------------------------------- /whats-new/reward-distributor.md: -------------------------------------------------------------------------------- 1 | # Reward Distributor 2 | 3 | ### Overview 4 | 5 | The Venus Reward Distributor allows for the configuration and management of rewards for lenders and borrowers, dependent on the user's activity within the associated markets. The addition of one or more reward distributors to a pool is facilitated through the addRewardsDistributor feature, enhancing the protocol's capability to customize distribution rates on a per-market basis. 6 | 7 | In the Venus Protocol V4, the reward system has been upgraded to allow for rewards per market and lending activity, as well as the support for multiple reward tokens. This revamp serves to provide further incentives and yield opportunities for users. 8 | 9 | ### Reward Distributor Architecture 10 | 11 | The Rewards Distributor system is centered around the `RewardsDistributor` contract. This contract maintains the functionality to configure, track and distribute rewards to users based on their borrow and supply activities within the protocol. Upon initialization, each `RewardsDistributor` proxy is associated with a specific reward token and Comptroller, from which point the reward token can be disseminated to users that supply or borrow in the corresponding pool. 12 | 13 | ### User Interactions 14 | 15 | Users have a range of possible interactions with the Reward Distributor: 16 | 17 | * **Supply:** Users can supply assets and earn rewards based on the supply speeds set for the reward token. 18 | * **Borrow:** Users can borrow assets and earn rewards according to the configured borrow speed of the reward token. 19 | * **Claim Rewards:** Users can claim their accrued reward tokens for individual markets, a feature that significantly reduces gas fees and streamlines the reward claiming process. 20 | -------------------------------------------------------------------------------- /whats-new/stable-rate-borrowing.md: -------------------------------------------------------------------------------- 1 | # Stable Rate Borrowing 2 | 3 | {% hint style="warning" %} 4 | **To be released** 5 | {% endhint %} 6 | 7 | ### Overview: 8 | 9 | Stable Rate Borrowing is a distinctive feature of the Venus Protocol that provides an alternative to variable interest rate loans. Stable-rate loans set their interest rates at issuance until a rebalancing event occurs. This approach shields users who borrow at a stable rate from being affected by individual actions of other users and large fluctuations in the market. 10 | 11 | ### Rate Determination: 12 | 13 | The interest rates for stable and variable rate borrowing are determined based on several calculations involving parameters such as utilization rate, stable loan adoption rate, and total supply. For instance, the stable interest rate will include a base premium plus an additional premium that depends on the stable loan adoption rate. 14 | 15 | ### Model Parameters: 16 | 17 | The model parameters involved in the calculations include slopes for the variable interest rate, a base rate per block, the optimal utilization rate (kink), a reserve factor, base premium, and other parameters related to stable loan borrowing. 18 | 19 | ### Rebalancing Conditions: 20 | 21 | The fixed rate of a stable loan persists until certain rebalancing conditions are met. These conditions involve the utilization rate and the comparison between the market average borrow rate and the variable borrow rate. The stable rate provides predictability for the borrower but may come at a cost of higher interest rates compared to the variable rate. 22 | -------------------------------------------------------------------------------- /whats-new/token-converter.md: -------------------------------------------------------------------------------- 1 | # Token Converter 2 | 3 | ### Overview 4 | 5 | Protocol revenues, sourced from reserve interests and liquidations, are processed through the [Automatic Income Allocation](automatic-income-allocation.md) module. Once allocated, these underlying tokens are subsequently sent to various Token Converters, each transforming the received income into specific tokens, automating and optimizing this conversion process. 6 | 7 | ### Key Aspects of the Token Converter 8 | 9 | The Token Converter works on four key principles: 10 | 11 | 1. **Distributed and Autonomous**: No centralized management or human interactions needed, ensuring a secure and seamless conversion process. 12 | 2. **Efficient**: The system is designed to maximize the amount of specific tokens we receive while protecting against potential risks like sandwich attacks. 13 | 3. **Streaming**: The conversions occur continually, without waiting for scheduled intervals. 14 | 4. **Transparent**: All conversions are publicly recorded in the blockchain, reinforcing our commitment to transparency. 15 | 16 | Venus Protocol will offer discounts to incentivize these conversions. This incentive will create arbitrage opportunities in the market, and external agents can potentially gain from these opportunities. 17 | 18 | ### Rational 19 | 20 | Before the Token Converter, token conversions were not as seamless and efficient. Venus Protocol needed a system that could constantly convert the received income into specific tokens, with no room for errors or delays. 21 | 22 | The Token Converter streamlines the conversion process by allowing key elements in the Venus Protocol, such as the XVSVaultConverter and RiskFundConverter, to autonomously offer token conversions. This solution follows the rules of distributed and autonomous systems, removing the need for human intervention. 23 | 24 | Moreover, the introduction of incentives through discounts encourages external agents to take part in the conversion process, thus creating a win-win situation for all. This is in line with the vision of decentralization, where processes are not only transparent but also rewarding for participants. 25 | 26 | ### Architecture 27 | 28 |
29 | 30 | _The dashed lines represent transactions initiated by external agents (VIP’s, scripts, arbitrage bots, etc.), and the solid lines represent transfers of funds._ 31 | -------------------------------------------------------------------------------- /whitepapers/Venus-whitepaper-v1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/whitepapers/Venus-whitepaper-v1.pdf -------------------------------------------------------------------------------- /whitepapers/Venus-whitepaper-v4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VenusProtocol/venus-protocol-documentation/e8e3aad3c6340c251d6c8974ccbc5be5a5a0ead2/whitepapers/Venus-whitepaper-v4.pdf --------------------------------------------------------------------------------