├── .gitbook.yaml ├── .gitbook ├── assets │ ├── EF_Math_Welcome_dark_v2.gif │ ├── EF_Math_Welcome_dark_v3.gif │ ├── Graphs random-v2_Allocation color (1).png │ ├── Graphs random-v2_Allocation color.png │ ├── Graphs random-v2_EUL Distribution Schedule.png │ ├── Graphs random-v2_Liquid Supply As % of Total Initial Issuance color.png │ ├── Graphs random-v4_Allocation 10years.png │ ├── Implied Annual Inflation (1).png │ ├── Implied Annual Inflation.png │ ├── Qubelab mobile gif_2_opt - Copy (1).gif │ ├── Qubelab mobile gif_2_opt - Copy.gif │ ├── allocation.png │ ├── claim2 (1).png │ ├── claim2.png │ ├── delegate_metamask.png │ ├── eul_connect_wallet.png │ ├── eul_contract.png │ ├── eul_delegate_to_address.png │ ├── eul_delegatee_address.png │ ├── eul_token_etherscan (1).png │ ├── eul_token_etherscan.png │ ├── eul_view_delegate.png │ ├── eul_write.png │ ├── getvotes_delegates.png │ ├── image (1) (1).png │ ├── image (1).png │ ├── image (2).png │ ├── image (3) (1).png │ ├── image (3).png │ ├── image (4) (1).png │ ├── image (4).png │ ├── image (5).png │ ├── image (6).png │ ├── image (7).png │ ├── image.png │ ├── proposals.png │ ├── snapshot_ui.png │ ├── tally-vote.png │ ├── top_voters.png │ ├── uniweth.JPG │ ├── usdc rating.png │ ├── usdc rating2.png │ └── votes_in_support_against.png └── governance │ ├── connect_to_vote.png │ ├── connect_wallet.png │ ├── dao_1_tally_2.png │ ├── dao_1_tally_2i.png │ ├── dao_1_tally_3.png │ ├── dao_1_tally_4_i.png │ ├── dao_1_tally_4_ii.png │ ├── dao_1_tally_5.png │ ├── delegate_to_other_address.png │ ├── delegate_to_self.png │ ├── delegate_to_self_metamask.png │ ├── gov_tool_1.png │ ├── gov_tool_3.png │ ├── gov_tool_4_i.png │ ├── gov_tool_4_ii.png │ ├── gov_tool_5.png │ ├── governance_process.png │ ├── manage_proposals_1.png │ ├── manage_proposals_2.png │ ├── new_active_proposal.png │ ├── new_proposal_1.png │ ├── new_proposal_2.png │ ├── new_proposal_3.png │ ├── new_proposal_review.png │ ├── new_proposal_submitted.png │ ├── proposal_details.png │ ├── proposal_executable_code.png │ ├── proposal_information_for_governance update.png │ ├── proposal_to_update_governance_config.png │ ├── recent_proposals.png │ ├── snapshot-euler-search.png │ ├── snapshot-home.png │ ├── snapshot-new-proposal.png │ ├── snapshot-notification.png │ ├── snapshot-proposal.png │ ├── snapshot-vote.png │ ├── snapshot_ui.png │ ├── succeeded_proposal.png │ ├── top_voters.png │ ├── view_wallet_profile_on_tally.png │ ├── vote_for.png │ └── vote_with_message_and_submit.png ├── .github ├── ISSUE_TEMPLATE │ └── improve-docs.yml └── workflows │ └── links.yml ├── .gitignore ├── README.md ├── SUMMARY.md ├── app ├── faq.md ├── getting-started │ ├── README.md │ └── common-errors.md └── ui │ ├── README.md │ ├── activate.md │ ├── allowances.md │ ├── borrow.md │ ├── burn.md │ ├── connect-a-wallet.md │ ├── deposit.md │ ├── lending-and-borrowing-example.md │ ├── mint.md │ ├── protected-collateral.md │ ├── repay.md │ ├── retrieve-errors.md │ ├── short-long.md │ ├── sub-accounts.md │ ├── swap.md │ ├── transaction-builder.md │ ├── transfer.md │ ├── withdraw.md │ └── wrap.md ├── assets ├── errors-guide │ ├── all-errors.png │ ├── open-dev-console.png │ ├── select-console.png │ └── single-error.png └── functional-diagram │ ├── functional-diagram.drawio.xml │ └── functional-diagram.png ├── developers ├── chainlink-support.md ├── getting-started │ ├── README.md │ ├── architecture.md │ ├── contract-reference.md │ ├── integration-guide.md │ └── swap-handlers.md ├── mining.md ├── numeric-limits.md ├── proxy-protocol.md ├── sdk.md ├── subgraph.md └── swap-and-repay.md ├── eul ├── about.md ├── distribution-1.md ├── distribution.md ├── gauges.md └── staking.md ├── euler-governance ├── addresses.md ├── getting-started │ ├── README.md │ └── governance-launch-phases.md ├── governance-parameters.md ├── grants.md ├── how-to │ ├── README.md │ ├── create-a-tally-on-chain-proposal │ │ ├── README.md │ │ └── create-a-snapshot-off-chain-proposal.md │ ├── delegate-voting-power.md │ ├── join-the-forum.md │ ├── vote-on-snapshot-off-chain.md │ ├── vote-on-tally-on-chain.md │ └── write-a-proposal.md └── treasury.md ├── euler-protocol ├── addresses.md ├── eulers-default-parameters │ ├── README.md │ ├── list-of-assets.md │ └── risk-factors-list.md └── getting-started │ ├── README.md │ ├── methodology │ ├── README.md │ ├── collateral-and-borrow-factors.md │ ├── oracle-rating.md │ ├── ranking-assets.md │ └── tiers.md │ └── simulation-environment.md ├── getting-started ├── introduction.md ├── quick-links.md └── white-paper.md ├── languages ├── community-translations.md └── white-paper-ENG-CHN.md ├── legal ├── privacyPolicy.md └── termsAndConditions.md ├── protocol ├── parameters.md └── tokens.md └── security ├── audits.md ├── bug-bounty.md └── insurance.md /.gitbook.yaml: -------------------------------------------------------------------------------- 1 | redirects: 2 | security/smart-contract-audits: security/audits.md 3 | governance/eul: eul/distribution.md 4 | developers/integration-guide: developers/getting-started/integration-guide.md 5 | -------------------------------------------------------------------------------- /.gitbook/assets/EF_Math_Welcome_dark_v2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/EF_Math_Welcome_dark_v2.gif -------------------------------------------------------------------------------- /.gitbook/assets/EF_Math_Welcome_dark_v3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/EF_Math_Welcome_dark_v3.gif -------------------------------------------------------------------------------- /.gitbook/assets/Graphs random-v2_Allocation color (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/Graphs random-v2_Allocation color (1).png -------------------------------------------------------------------------------- /.gitbook/assets/Graphs random-v2_Allocation color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/Graphs random-v2_Allocation color.png -------------------------------------------------------------------------------- /.gitbook/assets/Graphs random-v2_EUL Distribution Schedule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/Graphs random-v2_EUL Distribution Schedule.png -------------------------------------------------------------------------------- /.gitbook/assets/Graphs random-v2_Liquid Supply As % of Total Initial Issuance color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/Graphs random-v2_Liquid Supply As % of Total Initial Issuance color.png -------------------------------------------------------------------------------- /.gitbook/assets/Graphs random-v4_Allocation 10years.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/Graphs random-v4_Allocation 10years.png -------------------------------------------------------------------------------- /.gitbook/assets/Implied Annual Inflation (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/Implied Annual Inflation (1).png -------------------------------------------------------------------------------- /.gitbook/assets/Implied Annual Inflation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/Implied Annual Inflation.png -------------------------------------------------------------------------------- /.gitbook/assets/Qubelab mobile gif_2_opt - Copy (1).gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/Qubelab mobile gif_2_opt - Copy (1).gif -------------------------------------------------------------------------------- /.gitbook/assets/Qubelab mobile gif_2_opt - Copy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/Qubelab mobile gif_2_opt - Copy.gif -------------------------------------------------------------------------------- /.gitbook/assets/allocation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/allocation.png -------------------------------------------------------------------------------- /.gitbook/assets/claim2 (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/claim2 (1).png -------------------------------------------------------------------------------- /.gitbook/assets/claim2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/claim2.png -------------------------------------------------------------------------------- /.gitbook/assets/delegate_metamask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/delegate_metamask.png -------------------------------------------------------------------------------- /.gitbook/assets/eul_connect_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/eul_connect_wallet.png -------------------------------------------------------------------------------- /.gitbook/assets/eul_contract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/eul_contract.png -------------------------------------------------------------------------------- /.gitbook/assets/eul_delegate_to_address.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/eul_delegate_to_address.png -------------------------------------------------------------------------------- /.gitbook/assets/eul_delegatee_address.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/eul_delegatee_address.png -------------------------------------------------------------------------------- /.gitbook/assets/eul_token_etherscan (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/eul_token_etherscan (1).png -------------------------------------------------------------------------------- /.gitbook/assets/eul_token_etherscan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/eul_token_etherscan.png -------------------------------------------------------------------------------- /.gitbook/assets/eul_view_delegate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/eul_view_delegate.png -------------------------------------------------------------------------------- /.gitbook/assets/eul_write.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/eul_write.png -------------------------------------------------------------------------------- /.gitbook/assets/getvotes_delegates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/getvotes_delegates.png -------------------------------------------------------------------------------- /.gitbook/assets/image (1) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/image (1) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/image (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/image (2).png -------------------------------------------------------------------------------- /.gitbook/assets/image (3) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/image (3) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (3).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/image (3).png -------------------------------------------------------------------------------- /.gitbook/assets/image (4) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/image (4) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (4).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/image (4).png -------------------------------------------------------------------------------- /.gitbook/assets/image (5).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/image (5).png -------------------------------------------------------------------------------- /.gitbook/assets/image (6).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/image (6).png -------------------------------------------------------------------------------- /.gitbook/assets/image (7).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/image (7).png -------------------------------------------------------------------------------- /.gitbook/assets/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/image.png -------------------------------------------------------------------------------- /.gitbook/assets/proposals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/proposals.png -------------------------------------------------------------------------------- /.gitbook/assets/snapshot_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/snapshot_ui.png -------------------------------------------------------------------------------- /.gitbook/assets/tally-vote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/tally-vote.png -------------------------------------------------------------------------------- /.gitbook/assets/top_voters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/top_voters.png -------------------------------------------------------------------------------- /.gitbook/assets/uniweth.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/uniweth.JPG -------------------------------------------------------------------------------- /.gitbook/assets/usdc rating.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/usdc rating.png -------------------------------------------------------------------------------- /.gitbook/assets/usdc rating2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/usdc rating2.png -------------------------------------------------------------------------------- /.gitbook/assets/votes_in_support_against.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/assets/votes_in_support_against.png -------------------------------------------------------------------------------- /.gitbook/governance/connect_to_vote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/connect_to_vote.png -------------------------------------------------------------------------------- /.gitbook/governance/connect_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/connect_wallet.png -------------------------------------------------------------------------------- /.gitbook/governance/dao_1_tally_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/dao_1_tally_2.png -------------------------------------------------------------------------------- /.gitbook/governance/dao_1_tally_2i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/dao_1_tally_2i.png -------------------------------------------------------------------------------- /.gitbook/governance/dao_1_tally_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/dao_1_tally_3.png -------------------------------------------------------------------------------- /.gitbook/governance/dao_1_tally_4_i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/dao_1_tally_4_i.png -------------------------------------------------------------------------------- /.gitbook/governance/dao_1_tally_4_ii.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/dao_1_tally_4_ii.png -------------------------------------------------------------------------------- /.gitbook/governance/dao_1_tally_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/dao_1_tally_5.png -------------------------------------------------------------------------------- /.gitbook/governance/delegate_to_other_address.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/delegate_to_other_address.png -------------------------------------------------------------------------------- /.gitbook/governance/delegate_to_self.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/delegate_to_self.png -------------------------------------------------------------------------------- /.gitbook/governance/delegate_to_self_metamask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/delegate_to_self_metamask.png -------------------------------------------------------------------------------- /.gitbook/governance/gov_tool_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/gov_tool_1.png -------------------------------------------------------------------------------- /.gitbook/governance/gov_tool_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/gov_tool_3.png -------------------------------------------------------------------------------- /.gitbook/governance/gov_tool_4_i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/gov_tool_4_i.png -------------------------------------------------------------------------------- /.gitbook/governance/gov_tool_4_ii.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/gov_tool_4_ii.png -------------------------------------------------------------------------------- /.gitbook/governance/gov_tool_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/gov_tool_5.png -------------------------------------------------------------------------------- /.gitbook/governance/governance_process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/governance_process.png -------------------------------------------------------------------------------- /.gitbook/governance/manage_proposals_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/manage_proposals_1.png -------------------------------------------------------------------------------- /.gitbook/governance/manage_proposals_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/manage_proposals_2.png -------------------------------------------------------------------------------- /.gitbook/governance/new_active_proposal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/new_active_proposal.png -------------------------------------------------------------------------------- /.gitbook/governance/new_proposal_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/new_proposal_1.png -------------------------------------------------------------------------------- /.gitbook/governance/new_proposal_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/new_proposal_2.png -------------------------------------------------------------------------------- /.gitbook/governance/new_proposal_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/new_proposal_3.png -------------------------------------------------------------------------------- /.gitbook/governance/new_proposal_review.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/new_proposal_review.png -------------------------------------------------------------------------------- /.gitbook/governance/new_proposal_submitted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/new_proposal_submitted.png -------------------------------------------------------------------------------- /.gitbook/governance/proposal_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/proposal_details.png -------------------------------------------------------------------------------- /.gitbook/governance/proposal_executable_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/proposal_executable_code.png -------------------------------------------------------------------------------- /.gitbook/governance/proposal_information_for_governance update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/proposal_information_for_governance update.png -------------------------------------------------------------------------------- /.gitbook/governance/proposal_to_update_governance_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/proposal_to_update_governance_config.png -------------------------------------------------------------------------------- /.gitbook/governance/recent_proposals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/recent_proposals.png -------------------------------------------------------------------------------- /.gitbook/governance/snapshot-euler-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/snapshot-euler-search.png -------------------------------------------------------------------------------- /.gitbook/governance/snapshot-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/snapshot-home.png -------------------------------------------------------------------------------- /.gitbook/governance/snapshot-new-proposal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/snapshot-new-proposal.png -------------------------------------------------------------------------------- /.gitbook/governance/snapshot-notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/snapshot-notification.png -------------------------------------------------------------------------------- /.gitbook/governance/snapshot-proposal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/snapshot-proposal.png -------------------------------------------------------------------------------- /.gitbook/governance/snapshot-vote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/snapshot-vote.png -------------------------------------------------------------------------------- /.gitbook/governance/snapshot_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/snapshot_ui.png -------------------------------------------------------------------------------- /.gitbook/governance/succeeded_proposal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/succeeded_proposal.png -------------------------------------------------------------------------------- /.gitbook/governance/top_voters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/top_voters.png -------------------------------------------------------------------------------- /.gitbook/governance/view_wallet_profile_on_tally.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/view_wallet_profile_on_tally.png -------------------------------------------------------------------------------- /.gitbook/governance/vote_for.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/vote_for.png -------------------------------------------------------------------------------- /.gitbook/governance/vote_with_message_and_submit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/.gitbook/governance/vote_with_message_and_submit.png -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/improve-docs.yml: -------------------------------------------------------------------------------- 1 | name: Improve Docs 2 | description: Something isn't described correctly in the documentation, needs to be updated, missing, or badly structured? Here is the right place to report. 3 | title: "" 4 | labels: ["unconfirmed"] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thank you for helping us improve our documentation. Please complete the following so we can have the necessary details about your suggestion. 10 | - type: checkboxes 11 | id: prerequisites 12 | attributes: 13 | label: Prerequisites 14 | description: Please confirm before submitting a new issue. 15 | options: 16 | - label: My suggestion/issue is about the [latest version of the documentation](https://docs.euler.finance/). 17 | required: true 18 | - label: I checked the [existing issues](https://github.com/euler-xyz/euler-docs/issues/new) to make sure my problem has not already been reported. 19 | required: true 20 | - type: dropdown 21 | id: type 22 | attributes: 23 | label: Type 24 | description: What is this issue about? 25 | options: 26 | - Bug 27 | - Something is missing 28 | - Something needs improving (e.g. is badly explained) 29 | - Something is wrong 30 | - General suggestion 31 | - Something else 32 | validations: 33 | required: true 34 | - type: textarea 35 | id: details 36 | attributes: 37 | label: More details 38 | description: Give a detailed description of the bug/improvement/suggestion. 39 | validations: 40 | required: true 41 | - type: textarea 42 | id: permalink 43 | attributes: 44 | label: Relevant Section(s) 45 | description: Insert the links to the relevant section(s) in the docs. Choose the most specific section / lowest-level heading to which your suggested change applies. 46 | placeholder: "For example: https://docs.euler.finance/guides/ui/lending-and-borrowing-example" 47 | validations: 48 | required: false 49 | - type: textarea 50 | id: assets 51 | attributes: 52 | label: Assets 53 | description: Include any relevant files or links here. 54 | validations: 55 | required: false 56 | -------------------------------------------------------------------------------- /.github/workflows/links.yml: -------------------------------------------------------------------------------- 1 | name: Links Checker Report 2 | 3 | on: 4 | repository_dispatch: 5 | workflow_dispatch: 6 | schedule: 7 | - cron: "00 09 * * 1" 8 | 9 | permissions: 10 | issues: write 11 | 12 | jobs: 13 | linkChecker: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v3 17 | 18 | - name: Link Checker 19 | id: lychee 20 | uses: lycheeverse/lychee-action@v1.5.4 21 | env: 22 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 23 | 24 | - name: Create Issue From File 25 | if: env.lychee_exit_code != 0 26 | uses: peter-evans/create-issue-from-file@v4 27 | with: 28 | title: Link Checker Report 29 | content-filepath: ./lychee/out.md 30 | labels: report, automated issue 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Welcome to the Euler documentation pages! 3 | cover: .gitbook/assets/EF_Math_Welcome_dark_v3.gif 4 | coverY: 0 5 | --- 6 | 7 | # Welcome 8 | 9 | Here you will find the white paper, guides on how to use the app, and all the developer materials needed to start building on top of Euler. 10 | 11 | Don't be shy, if there is anything missing or unclear, please drop in to the community [Discord](https://discord.gg/CdG97VSYGk) server where you can have all of your questions answered. 12 | -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Table of contents 2 | 3 | * [Welcome](README.md) 4 | 5 | ## Getting Started 6 | 7 | * [Introduction](getting-started/introduction.md) 8 | * [White Paper](getting-started/white-paper.md) 9 | * [Quick Links](getting-started/quick-links.md) 10 | 11 | ## App 12 | 13 | * [Getting Started](app/getting-started/README.md) 14 | * [Common Errors](app/getting-started/common-errors.md) 15 | * [How To](app/ui/README.md) 16 | * [Connect a Wallet](app/ui/connect-a-wallet.md) 17 | * [Deposit](app/ui/deposit.md) 18 | * [Withdraw](app/ui/withdraw.md) 19 | * [Borrow](app/ui/borrow.md) 20 | * [Repay](app/ui/repay.md) 21 | * [Mint](app/ui/mint.md) 22 | * [Burn](app/ui/burn.md) 23 | * [Sub-Accounts](app/ui/sub-accounts.md) 24 | * [Transfer](app/ui/transfer.md) 25 | * [Swap](app/ui/swap.md) 26 | * [Short/Long](app/ui/short-long.md) 27 | * [Protected Collateral](app/ui/protected-collateral.md) 28 | * [Transaction Builder](app/ui/transaction-builder.md) 29 | * [Wrap](app/ui/wrap.md) 30 | * [Activate](app/ui/activate.md) 31 | * [Allowances](app/ui/allowances.md) 32 | * [Retrieve Browser Errors](app/ui/retrieve-errors.md) 33 | * [Lending and Borrowing](app/ui/lending-and-borrowing-example.md) 34 | * [FAQ](app/faq.md) 35 | 36 | ## Euler Protocol 37 | 38 | * [Getting Started](euler-protocol/getting-started/README.md) 39 | * [Risk Methodology](euler-protocol/getting-started/methodology/README.md) 40 | * [Asset Tiers](euler-protocol/getting-started/methodology/tiers.md) 41 | * [Collateral and Borrow Factor](euler-protocol/getting-started/methodology/collateral-and-borrow-factors.md) 42 | * [Ranking Assets](euler-protocol/getting-started/methodology/ranking-assets.md) 43 | * [Oracle Rating](euler-protocol/getting-started/methodology/oracle-rating.md) 44 | * [Simulation Environment](euler-protocol/getting-started/simulation-environment.md) 45 | * [Addresses](euler-protocol/addresses.md) 46 | * [Parameters](euler-protocol/eulers-default-parameters/README.md) 47 | * [Interest Rates](euler-protocol/eulers-default-parameters/list-of-assets.md) 48 | * [Risk Factors](euler-protocol/eulers-default-parameters/risk-factors-list.md) 49 | 50 | ## Euler Governance 51 | 52 | * [Getting Started](euler-governance/getting-started/README.md) 53 | * [Phases](euler-governance/getting-started/governance-launch-phases.md) 54 | * [How To](euler-governance/how-to/README.md) 55 | * [Delegate Voting Power](euler-governance/how-to/delegate-voting-power.md) 56 | * [Write a Proposal](euler-governance/how-to/write-a-proposal.md) 57 | * [Create a Tally (On-Chain) Proposal](euler-governance/how-to/create-a-tally-on-chain-proposal/README.md) 58 | * [Create a Snapshot (Off-Chain) Proposal](euler-governance/how-to/create-a-tally-on-chain-proposal/create-a-snapshot-off-chain-proposal.md) 59 | * [Vote on Tally (On-Chain)](euler-governance/how-to/vote-on-tally-on-chain.md) 60 | * [Vote on Snapshot (Off-Chain)](euler-governance/how-to/vote-on-snapshot-off-chain.md) 61 | * [Join the Forum](euler-governance/how-to/join-the-forum.md) 62 | * [Treasury](euler-governance/treasury.md) 63 | * [Grants](euler-governance/grants.md) 64 | * [Addresses](euler-governance/addresses.md) 65 | * [Parameters](euler-governance/governance-parameters.md) 66 | 67 | ## EUL 68 | 69 | * [About](eul/about.md) 70 | * [Distribution](eul/distribution.md) 71 | * [Epochs](eul/distribution-1.md) 72 | * [Gauges](eul/gauges.md) 73 | * [Staking](eul/staking.md) 74 | 75 | ## Developers 76 | 77 | * [Getting Started](developers/getting-started/README.md) 78 | * [Contract Integration Guide](developers/getting-started/integration-guide.md) 79 | * [Contract Reference](developers/getting-started/contract-reference.md) 80 | * [Architecture](developers/getting-started/architecture.md) 81 | * [Proxy Protocol](developers/proxy-protocol.md) 82 | * [Numeric Limits](developers/numeric-limits.md) 83 | * [SDK](developers/sdk.md) 84 | * [Subgraph](developers/subgraph.md) 85 | 86 | ## Security 87 | 88 | * [Audits](security/audits.md) 89 | * [Bug Bounty](security/bug-bounty.md) 90 | * [Insurance](security/insurance.md) 91 | 92 | ## Languages 93 | 94 | * [White Paper (ENG-CHN)](languages/white-paper-ENG-CHN.md) 95 | * [Community Translations](languages/community-translations.md) 96 | 97 | ## Legal 98 | * [Terms and Conditions](legal/termsAndConditions.md) 99 | * [Privacy Policy](legal/privacyPolicy.md) 100 | -------------------------------------------------------------------------------- /app/getting-started/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | -------------------------------------------------------------------------------- /app/getting-started/common-errors.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: >- 3 | Learn about different errors users might encounter from time on the UI and 4 | what they mean 5 | --- 6 | 7 | # Common Errors 8 | 9 | ### You have a collateral violation 10 | 11 | Collateral violation means you're trying to borrow something without having enough collateral in your account to do so. Make sure you deposit a collateral asset first, like USDC. You can filter collateral assets on the markets page. 12 | 13 | ### No match, code: NETWORK\_ERROR 14 | 15 | Please try refreshing the page and make sure you have a stable internet connection and your web3 wallet is on the correct RPC network (e.g., Goerli Test Network). 16 | 17 | ### No match, code: UNPREDICTABLE\_GAS\_LIMIT 18 | 19 | Try refreshing the page and trying the transaction again. This error also often occurs for other reasons. So if you keep having this issue, please check your browser’s console log and please report the error that it shows. 20 | 21 | ### Unknown error 22 | 23 | Please try refreshing the page. If you receive the same error message, please check your browser’s log for errors and create a support ticket with what you find. 24 | 25 | ### Transfer amount exceeds balance, please check you have enough tokens in your wallet and make sure they are also not deposited into Euler 26 | 27 | You don't have enough tokens in your wallet. If using the test, please make sure you have the correct testnet tokens from the official Euler testnet faucet. 28 | 29 | ### execution reverted: e/too-many-entered-markets 30 | 31 | For a given account, you can enter 10 markets max. You should try the transaction with another account or sub-account. 32 | 33 | ### RPC error 34 | 35 | Some RPC providers on the market (i.e. [Flashbots Protect RPC](https://docs.flashbots.net/flashbots-protect/rpc/quick-start/)) are not compatibile with Euler simulation mode. If this error occurs, the user is advised to change the RPC (i.e. by changing the network in Metamask to default Ethereum network) and refresh the dapp. Having done that, the simulation feature should be functional again. 36 | 37 | If, due to any reason, user wants to use their originally selected RPC to send the transaction, the following should be done (example described based on Metamask, actions might differ for other wallets): 38 | - change the RPC to default Ethereum network 39 | - add all the desired transactions to the batch 40 | - assure that the simulation is passing without any error 41 | - click 'Send txs' button 42 | - when Metamask pops up 43 | - click on 'New address detected! Click here...' at the top. Then click 'Add a nickname'. Input 'Euler Exec' as a nickname and click 'Save' 44 | - click on 'HEX', scroll down and click 'Copy raw transaction data' 45 | - click 'Reject' 46 | - disregard the error in the dapp 47 | - open Metamask and click 'Send' 48 | - select previously added 'Euler Exec' address 49 | - leave the asset set to ETH 50 | - leave the amount as 0 ETH 51 | - paste your clipboard contents into the 'Hex Data' field 52 | - change the network to desired 53 | - click 'Next' and sign the transaction 54 | -------------------------------------------------------------------------------- /app/ui/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: >- 3 | Find out how to use the Euler Protocol through the interface at 4 | https://app.euler.finance/ 5 | --- 6 | 7 | # How To 8 | 9 | Use the navigation bar on the left side to find guides for all the primary actions and functions on the Euler dApp. 10 | 11 | Most of the functions and actions can be accessed through the **Quick Action** menu in the top navigation bar on the platform UI, while several actions will appear as buttons throughout the site for convenience. 12 | 13 | If you come across an error while using the Euler dApp, please see the link below for the list of common errors. If the error persists or is not in the common errors list, please join the community Discord and open a ticket in the #support-ticket channel above the News and Announcement channels. 14 | 15 | ### Errors 16 | 17 | {% content-ref url="../getting-started/common-errors.md" %} 18 | [common-errors.md](../getting-started/common-errors.md) 19 | {% endcontent-ref %} 20 | -------------------------------------------------------------------------------- /app/ui/activate.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to activate a market in Euler 3 | --- 4 | 5 | # Activate 6 | 7 | ## About 8 | 9 | Users can activate new lending markets for assets on Euler in a permissionless way. Assets must have a Uniswap V3 WETH paired pool and should be listed on [CoinGecko](https://coingecko.com/) in order to appear in the asset's table. Since Euler uses Uniswap's V3 pools for the market's oracle, it's highly recommended to only activate pools with sufficient and wide range liquidity. Check out an asset's oracle risk [here](https://oracle.euler.finance/). 10 | 11 | ## Step-by-step 12 | 13 | 1. Search and select an unlisted asset. 14 | 2. Click `Activate` to create a market for the token. 15 | * Unlisted tokens come from community token lists, contact support if the desired token does not appear in the list. 16 | * Borrowing will not be available right away, somebody has to lend the asset first. 17 | 18 | ## FAQ 19 | 20 | **Where can I Activate a market?**\ 21 | ****Search for an asset in the search bar on the [Euler app](https://app.euler.finance/). 22 | 23 | **I've activated a market, how come I cannot use it as collateral?**\ 24 | ****Newly activated markets are automatically set as isolated tier assets. Create a proposal to make it a collateral tier asset if it has sufficient liquidity in its oracle. 25 | -------------------------------------------------------------------------------- /app/ui/allowances.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to change asset approvals through Allowances in Euler 3 | --- 4 | 5 | # Allowances 6 | 7 | ## About 8 | 9 | Allowances enable users to add, update or revoke approval of the Euler protocol to access markets in the user's wallet. Users can change the amount of tokens in pre-approved markets. 10 | 11 | ## Step-by-step 12 | 13 | 1. Select an asset from the list. 14 | 2. Enter the amount you wish to allow the protocol to approve for use and click `Update`. 15 | * `Max` will allow the protocol to use the total supply of that token, not just what the user owns. 16 | * Enter `0` (zero) to restrict the protocol from using any more than zero tokens. 17 | 3. If listed, change the pre-approved amounts by entering a new amount and clicking `Update` or by selecting `Max`. 18 | 4. To completely revoke allowance, select the `Revoke` button. 19 | 20 | ## FAQ 21 | 22 | **I've changed my allowances, but now I cannot complete some transactions.**\ 23 | ****Make sure the amount in your transaction is allowed in the amount you've permitted in the allowances. 24 | -------------------------------------------------------------------------------- /app/ui/borrow.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to borrow assets on Euler 3 | --- 4 | 5 | # Borrow 6 | 7 | ## About 8 | 9 | Borrowing assets on Euler creates a loan that users can repay at any time. Borrowers pay the Borrow APY rate to lenders. Note that users must first deposit collateral before they can borrow. All loans are over-collateralised, which means that users must deposit more value into the protocol than they can borrow. 10 | 11 | ## Step-by-step 12 | 13 | 1. Select `Borrow` in the `Quick Action` menu. 14 | 2. Select the Euler sub-account that you want to borrow on. 15 | * Ensure that you have sufficient collateral deposited in the sub-account, and the asset is entered into the market. 16 | 3. Select the asset you are interested in. 17 | 4. Enter the amount you wish to borrow: 18 | * The `Max` button is representative of Liquidation x 1.5 to give a better UI experience, but we do not recommend you borrow more than `Safe Max` (unless it is a self-collateralized loan). 19 | * Select `Safe Max` to borrow enough such that your Euler sub-account will result in having a health score of 1.25 (not supported for self-collateralized loans). 20 | * Select `Liquidation` to borrow enough such that your Euler sub-account will end up at a health score of 1 (right on the edge of a liquidation). 21 | 22 | ## FAQ 23 | 24 | **I've deposited an asset, but cannot borrow.**\ 25 | ****Make your transactions were completed successfully. You can only borrow using approved collateral-tier assets, unless you're borrowing the same asset you've deposited. Make sure your collateral is sufficient for the amount you're trying to borrow. Otherwise, please create a support ticket in [Discord](https://discord.gg/CdG97VSYGk). 26 | 27 | **How come I can't borrow with an isolated asset?**\ 28 | ****Note that isolated and Cross assets cannot be used as collateral, but Cross assets can be borrowed alongside other assets, while Isolated assets cannot. Euler aims to curb risk by limiting collateral tier assets to certain tokens with lower risk profiles. 29 | -------------------------------------------------------------------------------- /app/ui/burn.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to burn assets on Euler to remove Mint positions 3 | --- 4 | 5 | # Burn 6 | 7 | ## About 8 | 9 | Burn enables users to 'repay' and undo their multiplied positions created by the Mint function by removing an equal amount of deposits and debts from an account. 10 | 11 | ## Step-by-step 12 | 13 | 1. Ensure that you have sufficient supply & debt tokens in the sub-account you are burning on. 14 | 2. Select the Euler sub-account that you want to burn on. 15 | 3. Select the asset you are interested in. 16 | 4. Enter the amount you wish to burn: 17 | * Select `Max` to burn all available of selected asset. 18 | * While entering the amount, observe the Multiplier to make a decision. 19 | 20 | ## FAQ 21 | 22 | **Can I use Burn to repay my debts?**\ 23 | ****Burn is only used to close leverage positions from `Mint` and `Long` functions. Use the `Repay` function to close borrow positions. 24 | -------------------------------------------------------------------------------- /app/ui/connect-a-wallet.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to connect a wallet in Euler 3 | --- 4 | 5 | # Connect a Wallet 6 | 7 | ## About 8 | 9 | Connecting a web3 wallet is the first step to utilise the Euler platform. Euler integrated Blocknative to enable users to connect with Formatic, MetaMask, Ledger, Trezor, WalletConnect, and Coinbase. 10 | 11 | ## Step-by-step 12 | 13 | 1. Click the `Connect` button at the top right of the page. 14 | 2. Select your wallet provider in the Blocknative window. 15 | 3. Select your wallet from the list and unlock it. 16 | 4. Ensure you have selected the correct wallet, and your network is set to the correct one. 17 | 18 | ## FAQ 19 | 20 | **What chains/networks does Euler support?**\ 21 | ****Ethereum Mainnet and Goerli testnet (replacement for Ropsten). 22 | -------------------------------------------------------------------------------- /app/ui/deposit.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to deposit assets on Euler and begin earning interest 3 | --- 4 | 5 | # Deposit 6 | 7 | ## About 8 | 9 | Depositing into Euler allows users to supply assets to borrowers and earn the Supply APY for an asset. Depositing collateral is also the first step in being able to borrow assets on Euler. 10 | 11 | ## Step-by-step 12 | 13 | 1. Click the `Quick Action` button in the navigation bar. 14 | 2. From the menu, choose `Deposit`. 15 | 3. Select the sub-account you wish to deposit into and the asset you wish to deposit. 16 | * **Note**: if you have not yet approved Euler to be able to use this asset, you will need to `Enable` it first. In some cases you can achieve this with `Sign Permit` which is a type of gasless approval (free). 17 | 4. If you wish to use the asset as collateral to take out loans, check the `Enter market` box. 18 | * **Note**: you can only borrow against 'Collateral' tier assets. You will not be able to borrow against assets listed as 'Cross' or 'Isolated'. Entering the market for these type of assets will make them available to liquidators during liquidation events, but will not increase your borrowing power. 19 | 5. Enter the amount you wish to deposit (or hit `Max` to send the full available balance in your wallet). 20 | 6. Click `Deposit`. Your transaction will move to the `Transaction Builder`, which is a kind of shopping trolley for transactions. From here you have two options: 21 | 1. Click `Send txs` to immediately submit the deposit. 22 | 2. Add more transactions by revisiting the `Quick Action` button. You can then submit them all at once by clicking `Send txs`. This approach generally saves gas over submitting multiple individual transactions. 23 | 24 | ## FAQ 25 | 26 | **I deposited, but the asset does not show up in my account.**\ 27 | ****Make sure the deposit transactions did not fail, otherwise please create a support ticket in [Discord](https://discord.gg/CdG97VSYGk). 28 | -------------------------------------------------------------------------------- /app/ui/lending-and-borrowing-example.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: >- 3 | Below is a basic example of lending and borrowing on Euler protocol. This is 4 | not financial advice and only serves as an educational example on using the 5 | protocol. 6 | --- 7 | 8 | # Lending and Borrowing 9 | 10 | Let’s say you want to borrow XYZ token. XYZ token ranks high in the index list, and therefore has a borrow factor of 0.80. 11 | 12 | ### **Lending** 13 | 14 | Since the loan is collateralised, you first need to deposit (lend) one or more collateral assets. You deposit ABC, which is a stable coin with a collateral factor of 0.90. 15 | 16 | You lend 1000 ABC (1000 USD worth), receive eABC (claim on deposited ABC and interest accrued from utilisation). Note that the more users borrow your ABC tokens, the more interest you accrue and hence the higher value of your collateral. 17 | 18 | ### Borrowing 19 | 20 | To calculate the maximum amount of XYZ you can borrow, multiply the borrow and collateral factors: 0.80 x 0.90 = 0.72. Consequently, you can borrow up to 720 USD worth of XYZ against 1000 ABC (0.72 x 1000 ABC). 21 | 22 | If you decide to borrow 700 USD worth of XYZ, Euler will mint an equivalent amount of dXYZ (debt token equal to principal amount owed and accrued borrowing costs). Note that if borrowing rates rise, your debt levels will increase as well. 23 | 24 | ### Liquidation Risks 25 | 26 | If XYZ token rose in price and/or borrowing interest rose significantly so that the value of your dXYZ rose above 720 USD, you are subject to liquidation and your claim on the collateral (eABC) will be given to a liquidator at a discount as well as your debts (dXYZ) in exchange for repaying the debt. 27 | 28 | Similarly, should the value of ABC plummet, your eABC won’t be enough to maintain the 0.72 factor, and you will be subject to the same liquidation procedure. 29 | 30 | ### Return Potential 31 | 32 | Alternatively, if you borrowed XYZ, sold it and XYZ price plummeted, you’d be able to repay your debts at a lower level and make a profit. You could also utilize your position by selling XYZ, buying more collateral, borrowing more XYZ etc. until you reach the borrowing limit. This way, you’d have a multiplied short XYZ/ABC position. More on the mechanics of multiplied positions [here](https://medium.com/@Hoytech/82402529c51b). 33 | 34 | _Note: we have implemented the swap module that allows users to utilize their positions easily without incurring additional gas fees._ 35 | -------------------------------------------------------------------------------- /app/ui/mint.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to mint assets on Euler for self-collateralised positions 3 | --- 4 | 5 | # Mint 6 | 7 | ## About 8 | 9 | Mint is a unique function on Euler that enables users to simulate a recursive borrowing strategy. Mint creates equal amounts of deposits and debts for the same asset. It is often the starting point for creating a multiplied long/short position or used for liquidity mining (when lending/borrowing on a particular market is incentivised). 10 | 11 | ### **Example** 12 | 13 | A user first does a `Deposit` of $1000 of USDC. They then `Mint` $5000 USDC. Their account now has a total of $6000 USDC deposits, and $5000 USDC debts. This gives them a multiplied position, since they hold more debt than their initial deposit would allow for. 14 | 15 | The `Mint` function mimics what would happen if a user deposited $1000 USDC, then borrowed $900 USDC, then redeposited that $900 USDC, to borrow $810 more USDC, and so on. 16 | 17 | ## Step-by-step 18 | 19 | 1. Ensure that you have sufficient collateral in the sub-account you are minting to. 20 | 2. Select the Euler sub-account that you want to mint from. 21 | 3. Select the asset you are interested in. 22 | 4. Enter the amount you wish to have upon completion. 23 | * `Max` here is representative of 19x multiplier (right on the edge of a liquidation), and hence we do not recommend you mint more than safe max. 24 | * Select `Safe Max` to mint enough deposits and debt such that your Euler sub-account will result in having a multiplier of 15x. 25 | * Select 0 or the Burn button to burn a previously minted position (burn removes an equal amount of deposits and debts from an account). 26 | * While entering the amount, observe the Multiplier and Time to Liquidation to make a decision. 27 | 28 | ## FAQ 29 | 30 | **Can I be liquidated if I use mint?**\ 31 | ****Mint creates a multiplied position which poses liquidation risk when Mint an asset different from the user's collateral. Additionally, the interest rates also present risk of loss as they're variable and dependent on the market. 32 | -------------------------------------------------------------------------------- /app/ui/protected-collateral.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to protect your collateral assets in Euler 3 | --- 4 | 5 | # Protected Collateral 6 | 7 | ## About 8 | 9 | Toggling collateral assets on Euler enables users to protect their tokens as collateral without permitting borrowing. Users may want to do this so that their collateral is purely being used as collateral for their own borrowed assets, while lowering other risks. 10 | 11 | ## Step-by-step 12 | 13 | 1. At the desired sub-account page, find the asset under the supply column. 14 | 2. Click the `toggle` button in the `Entered` column in the Account view to enter/exit market. 15 | * Ensure that you have no outstanding borrows on the account that are collateralised by a given asset. 16 | 17 | ## FAQ 18 | 19 | **The transaction builder won't let me toggle collateral, it presents a Collateral violation error.**\ 20 | ****Toggling collateral will disallow using the asset as collateral, so you won't be able to borrow using the asset. 21 | -------------------------------------------------------------------------------- /app/ui/repay.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: >- 3 | Learn how to repay borrowed assets on Euler using funds from a wallet or 4 | deposits in Euler 5 | --- 6 | 7 | # Repay 8 | 9 | ## About 10 | 11 | Users can repay their borrowed assets using assets in their wallet are existing assets already deposited into Euler. Users are able to swap assets if they repay using deposited asset that are different from the borrowed assets. 12 | 13 | ## Step-by-step 14 | 15 | 1. Ensure that you have sufficient funds in your wallet or sufficient Euler deposits to repay a loan. 16 | 2. Select the Euler sub-account that you want to repay the loan on. 17 | 3. If repaying the loan using your Wallet Balance, select the liability asset (loaned asset) then the amount you want to repay. 18 | 4. If repaying the loan using Euler deposits, select the liability asset then the amount to repay. 19 | 5. Continue by selecting the swapped asset used to repay the loan and the amount. 20 | * If necessary, an appropriate swap will be made on an external exchange. Use the gear icon in the top-right to customise swap parameters. 21 | 6. Select `Max` to repay your full loan (or maximum amount possible based on your wallet balance/Euler deposits). 22 | 7. If a swap is necessary, wait for a quote and click the `Swap and Repay` button. 23 | 24 | ## FAQ 25 | 26 | **Can I repay a loan with a different asset?**\ 27 | ****Yes, either from the user's wallet or Euler deposits, which will be swapped for the loaned asset and repaid. 28 | -------------------------------------------------------------------------------- /app/ui/retrieve-errors.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to retrieve errors from the developer console in your browser 3 | --- 4 | 5 | # Retrieve Browser Errors 6 | 7 | ## About 8 | 9 | Sometimes an error will occur that needs further investigation by the Euler Labs team. If you have created a support ticket in [Discord](https://discord.gg/CdG97VSYGk), then you may be asked to report errors from the browser console to the team. You will find the instructions for doing this below. 10 | 11 | **IMPORTANT**: the Euler Labs team will never ask for your private keys or passphrase. 12 | 13 | ## Step-by-step 14 | 15 | 1. Open the developer console by pressing Option + ⌘ + J (on macOS) or Shift + CTRL + J (on Windows/Linux). You can open it by right-clicking anywhere on the webpage and selecting Inspect Element option. 16 | 2. On the top of the developer panel, there are multiple tabs like Elements, Console, Networks, and Sources. 17 | 18 | Open Developer Console 19 | 3. Click on the Console tab 20 | 21 | Select Console 22 | 4. Console is a place where we have all errors, warnings and general logs that appeared during the run time of the website. 23 | 24 | Warning and Errors 25 | 5. You will find the current errors in red text with a specific error code, the cause, and the file name and line number where this error occurred. 26 | 27 | Single Error 28 | 29 | ## FAQ 30 | 31 | Let us know if there's anything you think we should add here. 32 | -------------------------------------------------------------------------------- /app/ui/short-long.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to create short or long positions in Euler 3 | --- 4 | 5 | # Short/Long 6 | 7 | ## About 8 | 9 | Short allows users to build a leveraged short position by borrowing and then immediately selling an asset using external exchange (1inch or Uniswap). 10 | 11 | ## Step-by-step 12 | 13 | 1. Ensure that you have sufficient collateral in the sub-account you are shorting on. 14 | 2. Select the Euler sub-account that you want to short on. 15 | 3. Select the asset you wish to short on. 16 | 4. Select the asset you wish to use as the collateral. 17 | 5. Enter the amount you wish to short: 18 | * Select `Safe Max` to short the amount such that your Euler sub-account will result in having a health score of 1.25. 19 | * Select `Liquidation` to short the amount such that your Euler sub-account will end up at health score 1 (right on the edge of a liquidation). 20 | * Users can set the `slippage` to the desired value by clicking the `gear icon` in the top-right corner. 21 | 6. Wait for a quote and click the `Short` button. 22 | 23 | ## FAQ 24 | 25 | **I'm creating a Short/Long position, so why do I see the asset in a Self Collateral and Self Liability row?**\ 26 | ****The asset is sold and redeposited on Euler, which creates the self collateral/liability row, but your intended position is there. 27 | -------------------------------------------------------------------------------- /app/ui/sub-accounts.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn more about sub-accounts on Euler 3 | --- 4 | 5 | # Sub-Accounts 6 | 7 | ## About 8 | 9 | Sub-accounts enable users to create new accounts without having to create or connect different wallets. Users can create sub-accounts to isolate positions, for example. Here are the steps to create sub-accounts. 10 | 11 | ## Step-by-step 12 | 13 | In the top right navigation, hover over the icon and click on the `Create New` button, which will automatically add a new sub-account and simultaneously switch to it. 14 | 15 | * There is no cost to create sub-accounts. 16 | * Part of opening up ourselves to lending on every market means that we have to protect the system against volatile and potentially malicious tokens. To do this we have categorised assets as isolated, cross and collateral. 17 | * If the asset is isolated, then you can only borrow and lend on one single asset per sub-account. 18 | 19 | ## FAQ 20 | 21 | **How many sub-accounts can I create?** \ 22 | ****Users can create up to 255 sub-accounts (in addition to their Main account, which is sometimes called sub-account 0).\ 23 | \ 24 | **Can I rename sub-accounts?**\ 25 | ****No, sub-accounts cannot be renamed. This is because all the information held about users' accounts is retrieved from the blockchain, and adding sub-account names to the chain would be expensive. 26 | -------------------------------------------------------------------------------- /app/ui/swap.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to swap assets in Euler 3 | --- 4 | 5 | # Swap 6 | 7 | ## About 8 | 9 | Swapping assets in Euler enables uses to exchange one deposited asset for another using external exchanges that have been integrated into the platform (1inch or Uniswap). 10 | 11 | ## Step-by-step 12 | 13 | 1. Ensure you have sufficient supply tokens in the sub-account you want to swap from. 14 | 2. Select the Euler sub-account that you want to swap from. 15 | 3. Select the Euler sub-account that you want to swap to. 16 | 4. Select the asset you wish to sell. 17 | 5. Select the asset you wish to buy. 18 | 6. Enter the amount you wish to sell. 19 | * Select `Safe Max` to sell the amount such that your Euler sub-account will result in having a health score of 1.25. 20 | * Select `Liquidation` to sell the amount such that your Euler sub-account will end up at health score 1 (right on the edge of a liquidation). 21 | * Select `Max` to sell all the selected asset. 22 | * Users can set the `slippage` to the desired value by clicking the `gear icon` in the top-right corner. 23 | 7. Wait for a quote and click the `Swap` button. 24 | 25 | ## FAQ 26 | 27 | **Can I swap assets from my wallet?**\ 28 | ****Currently, users can only swap assets they've deposited. 29 | -------------------------------------------------------------------------------- /app/ui/transaction-builder.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to use the transaction builder in Euler 3 | --- 4 | 5 | # Transaction Builder 6 | 7 | ## About 8 | 9 | The transaction builder lists all the functions and actions that the user generated via the Quick Action menu, such as deposit, borrow, mint, etc. The transaction builder also enables users to add, remove, rearrange and edit transactions before approving the final transaction. 10 | 11 | ## Step-by-step 12 | 13 | The transaction builder can be expanded out from the right side of the UI by clicking the `OPEN` button. 14 | 15 | * Every time you alter your transaction builder, it automatically checks how much gas you will spend and tries to figure out if there will be any errors. 16 | * Transactions are executed in the order you have specified, and the order of the transactions can be re-arranged in a drag and drop fashion. 17 | * You are able to send transactions from different sub-accounts at the same time. 18 | 19 | ## FAQ 20 | 21 | **An error appeared as I added actions to the transaction builder.**\ 22 | ****Check with the [Common Errors](https://docs.euler.finance/guides/common-errors) and make sure the transaction builder is up-to-date with your actions (i.e. Swapping/transfer may become outdated if prices/interest rates significantly changed). 23 | -------------------------------------------------------------------------------- /app/ui/transfer.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to transfer assets between sub-accounts on Euler 3 | --- 4 | 5 | # Transfer 6 | 7 | ## About 8 | 9 | Transfer allows users to move deposited and debt assets between sub-account in Euler. User should ensure any borrow positions will have enough collateral assets in the related sub-accounts prior to transferring any assets. 10 | 11 | ## Step-by-step 12 | 13 | #### Transfer ETokens 14 | 15 | 1. Ensure that you have sufficient deposits in the sub-account you are transferring from. 16 | 2. Select the Euler sub-account that you want to transfer from. 17 | 3. Select the Euler sub-account that you want to transfer to. 18 | 4. Select the asset you are interested in. 19 | 5. Enter the amount you wish to transfer: 20 | * Select `Max` to transfer all the selected asset deposits (or maximum amount possible based on your 'from' sub-account positions). 21 | * Select `Safe Max` to transfer enough such that your 'from' Euler sub-account will result in having a health score of 1.25. 22 | 23 | #### Transfer DTokens 24 | 25 | 1. Ensure that you have sufficient debt tokens in the sub-account you are transferring from. 26 | 2. Select the Euler sub-account that you want to transfer from. 27 | 3. Select the Euler sub-account that you want to transfer to. 28 | 4. Select the asset you are interested in. 29 | 5. Enter the amount you wish to transfer: 30 | * Select `Max` to transfer all the selected asset debt (or maximum amount possible based on your 'to' sub-account positions). 31 | * Select `Safe Max` to transfer enough such that your 'to' Euler sub-account will result in having a health score of 1.25 (not supported for self-collateralized loans). 32 | 33 | ## FAQ 34 | 35 | **Can I transfer multiple assets?**\ 36 | ****Yes, you will need to make multiple actions sent to the transaction builder. 37 | -------------------------------------------------------------------------------- /app/ui/withdraw.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to withdraw assets from Euler 3 | --- 4 | 5 | # Withdraw 6 | 7 | ## About 8 | 9 | Users can withdraw assets from Euler at any time, directly to their wallet. Prior to withdraw, users should make sure debts are sufficiently repaid in order to withdraw their intended amount. 10 | 11 | ## Step-by-step 12 | 13 | 1. Click on `Withdraw` in the `Quick Action` menu and select the Euler sub-account that you want to withdraw your tokens from and ensure that you have funds deposited. 14 | 2. Select the asset you are interested in. 15 | 3. Enter the amount you wish to withdraw: 16 | * Select `Max` to withdraw either your full balance or the most that the pool will allow if the pool has less available liquidity than you deposited. 17 | * Select `Safe Max` to withdraw enough such that your Euler sub-account will result in having a health score of 1.25. 18 | * Select `Liquidation` to withdraw enough such that your Euler sub-account will end up at health score 1 (right on the edge of a liquidation). 19 | 20 | ## FAQ 21 | 22 | **I cannot withdraw my assets.**\ 23 | ****Make sure you have enough assets to cover any loans, otherwise please create a support ticket in [Discord](https://discord.gg/CdG97VSYGk). 24 | -------------------------------------------------------------------------------- /app/ui/wrap.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to wrap or unwrap assets in Euler 3 | --- 4 | 5 | # Wrap 6 | 7 | ## About 8 | 9 | Wrap is a versatile function that allows users to convert between wrapped and unwrapped assets. Two of the most common use cases are wrapping/unwrapping Ethereum (ETH) and wrapped Ethereum (WETH) as well as Lido Staked ETH (stETH) and wrapped Lido Staked ETH (wstETH). However, users can also wrap and unwrap their Protected Collateral tokens (pTokens). 10 | 11 | ## Step-by-step 12 | 13 | 1. Ensure that you have sufficient amount of asset in your account. 14 | 2. Select the assets you want to wrap or unwrap to/from. 15 | 3. Enter the amount you wish to wrap or unwrap. 16 | 4. Click the `Wrap` or `Unwrap` button. 17 | 18 | ## FAQ 19 | 20 | **Can I wrap/unwrap other assets?**\ 21 | ****You can only wrap/unwrap the assets listed in the dropdown. 22 | -------------------------------------------------------------------------------- /assets/errors-guide/all-errors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/assets/errors-guide/all-errors.png -------------------------------------------------------------------------------- /assets/errors-guide/open-dev-console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/assets/errors-guide/open-dev-console.png -------------------------------------------------------------------------------- /assets/errors-guide/select-console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/assets/errors-guide/select-console.png -------------------------------------------------------------------------------- /assets/errors-guide/single-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/assets/errors-guide/single-error.png -------------------------------------------------------------------------------- /assets/functional-diagram/functional-diagram.drawio.xml: -------------------------------------------------------------------------------- 1 | 2 | 7V1bc+I4Fv41VO0+JGXLF+CRBDaTLehOJene6UcFC+JtY9G2mcD8+pFsyRdJDg7BlpOZdFXHlmQhf+ei7xxJZGBdb/Y3Edw+L7CHggEwvP3Amg4AMC1nSH7RkkNWMgZWVrCOfI81Kgoe/D8RKzRY6c73UFxpmGAcJP62WrjEYYiWSaUMRhF+qTZb4aD6qVu4RlLBwxIGcun/fC95zkpHjlGU/4b89TP/ZNNgNRvIG7OC+Bl6+KVUZM0G1nWEcZJdbfbXKKDgcVyy5/5TU5sPLEJh0uSBw9U9vvu1DRd/ztF/vyfW7TwML+yslz9gsGMvzAabHDgCL89+gh62cEnvX4iUB9bVc7IJyJ1JLmG8zXBf+XtEPuqK9YiiBO1rh2rmABDNQXiDkuhAmuRqwzBjSmPa7P6lJAJW9FxCn5dBJvR13nOBC7lg0LwBJqufMAEBJkczTECCaQGjnyiJB8ANyIdfPUXkak2vthHeH3oBolkF0RprBtGUQESP+CcKPxCGpqsZQ6ef9iq4NaDbXt1+wiS4NaBbm4YSTN5Hs0gw1O3VDAkW5BGmxW5xlDzjNQ5hMCtKryK8Cz0KydQgd0WbOcZbBt7/UZIcGG2EuwRXoSVoRYff2fPpzQ96c+nw2+m+XDk9sLtsrHSAr+NP3gfvoiV65cXHWbsERmuUHHP7sjwjFMDE/6M6jrNLZyxp+MPsy3R2L8mMkNgtvdxtgskywRHBiuqpTwjzHD6h4A7HfuLjkDR5wkmCN6UGk8Bf04oECwaAd0ngh+g6p/DGeYxApEcKG7AUNuC2ZgPy1D7bo+UHciP2SLcbkSnm5eVlH6FytHtcOWiZ7QIU9QEsy6mCZelmQqYcCD88fr2f3MwkuKqT0hHw2sDKaoYVaA2rfrJry3CqBqhdp/pJr8FYwEk3vTZlfn17v+gFVCMBKu0+fSRBde/HPxcwhOt+eHbb7BtkMrflhGuFyTuVAXN/7TCvuIjToGJCGpjD7T5Fh9dznnZ3//X329kD74+ML+syq5XEQVBNqhKIk4gEktc4oEx6GuKQRj0rPwiEIsio85JIAZVJN+fUG9/z0pBJJfLqjHUGIYus0JBlPFbI2GpLxnyqa0PGt18eZ/dfJnOZpS++Tr/NC+kXFX87fbCESMtVGH23CiFHWt9CP34hrw+M75YsMhzBZYDid3vQsqwGwFo59B/TtlJ59iMJnNS46U87vngINPtiToBeY0Q8w7AK0H5CF/DS5IzHLqfLAMaxv0yhg1EiF5ekU9VzKgKWKCKMo5wbKtJBPwalvFFNbgjt/aT0GLn7UaopHqI3LeST8lXQowmlkVo5SsLPFyvL0s8LG6ee2GfcYT/1tUz7HLvqFBxRrbJXZU8VmiV15Aod2WJHGRRSR6mK5i/+Dq2VA2m+IqOfb+Wo9mXpBciRtNdbtLSnxYEqlj4Tc1l8mz/eXlCO+oM0+4et5P7ErU6LqvWlbtlKC4mCOiJSTzjqKMoZEB8JAQMPq7VZnZxx0AC450eki2yxhMyFFIlWhWBUhTDWLQQ5l/GNGHoUHPxw/bn0fzgWJmlDN/aqpIj+6Vn0E6ZuHbVkHZVwetN6gBiE9EpNR67AjmwZftWCaWsTI++4b2oqeFKg25ytBvPZJ1JTYUEMOLrVVM42bXsT8ohzDzB1K2uvkkAsmWOWUzl5Yqf9ZI6lll1nOZphVTlOztFIWmYIHbWco7Ea7ND+RB5QyIgBV7MHtOWJeoHYzm/9LlDM+mjf4m3LE8bc/7XzPZiGgz2ETPvGL1ueNR7S5Zz+YaV9ydtW7PxK9xnqx8od9s0U5XT1DSavGMKQwNJDxPRbopyyvg0JDwt6srdQBEy/OarSu2fK8T/cfrmZz+Sk/j9ZfykOEr20ImjvNOvvqOKgN6qFU6MWBOWgqYSVcVWjAAoM6k9YgGNHLNSRF+gs9Gq8jF4TojG1ujAuDTByJVVyFKrEy94ZtFk82OFZ0lODNmlnsS10VBO0EXWBh1KzLW0Q1w8YCKbHB1w3LrG9Nay0JxfZCISn+XDwahWjVqJMp8Fx6TWxl22tv2LH1OETb2681Y8BcfVSwQfyTQCd7Ae3FaeHbm8kYE4Ov0HTCeAVmb2aYlGFyq2hxW2uhNb1ZD6fTh4nfYdsX4WrhOCwUwTl6LnmtNq78BMyPp6DRp6tyviMwJPVfMveKYibig22nZq4I5t4mWIUtBJt/OS7D++UB9hOZxpOiTAYFcIw7I4wHCUCVj4zd0QEhHWoPJh+KxEwpTWCloiAQDhs8wgREFd6zJ4QAVeVbj4Td/dQgNYwQR+Ww3dskQ04fN0yC1Mz8qaAM7luLNcRFNsVPXfjvbGCC8iTHWe2XHusdjV14xLbC5Rfo+Wqou6OKbzot01FElSpfe3N7w2OdL4flVcE8voSaLdcR07X9SmccY7C1W04I2896V04UwNZX8IZeY/Zhw9nXkdcezjDP0xB3+ItDBvRN/DKmVCaeZ9Mp/cl+pb1W0PfThas07Fg65w176bhTvr2BNtgHitxZbZS4cH4OUXfrCJNy+9gkqAoTEuAURzZ418GCU6KWzlhbp0iu+7R6aJNmivsUzHFXUFNaW7tKaeOthe5Z1jCq3MYu5CY+s/HCPqBH67vYAQ3iu9LTFsl1VaLeP2A6Jb505f3+uh5juy2EL8bVDGZmKr1XXFx43xOp8Hu2y6dTiWkz0+zvuVoayWe78pVgabRvF6fJp4ek1xR4y2Twulss2HS7Ww+TXW2ocUcVuGcaOkt3RQQwmCBvR35kJMd2JkyXxUzOf79gLpz0Y1tpe4QeJ75Mhx++pCp4YUiHuowE+acShHETJjtNDOnt2bCRE4jfe32kfZub3LYR78YZ5nP4IV9W6v0RzZ5s7HFBoG/jdG76cY4/VHRjbE7tOCZ6IawmcxUnDUBXUY4w/rQ9RSpgc8pNSCSRO1ik9es3yM2q1ZsR7IY7FPo5B2tn+C/yPuSFzKEX/9OuzLS2X4FN35wyB7Z4BDHmeTz+oINGIwMGHTP4AXb/jdJhwGjRMkTBoTOX1f/doRDUKWl6R9GyO84yk6KMymZ0msqLoci6RDhHGtr5m25Ip3UDSi6yYSZ19D/KPykgAnV4WLlbbL3pw3oXS5esYKCQ6/Ncpfp8Hi/vEUxmEzW+WC4vdJGJYul9anN0vLUammJmY85tdy0yMnKcuvlPXMLprVlGy7qMzuujo5ZcxNh5FW5HAr7dqiF5y2HhdyMQ6kDauy8PDP4QnqlR5jhK+uIA8jL16WPF5Ukvc01pVxY1V/WTlL0ZvnBj+V8bbsa2FiKrGC3zhec1fnan3POHIqrkopDZd2K7egmizeJzfmcYhMDKNV6VrdiU22SPV1s7ucUmyVkf2zFd/OdSWwDNhmVosdiGrJmfwE= -------------------------------------------------------------------------------- /assets/functional-diagram/functional-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/euler-xyz/euler-docs/ef6baa89beed6dadb644f51d0dded8fa591ffa2b/assets/functional-diagram/functional-diagram.png -------------------------------------------------------------------------------- /developers/chainlink-support.md: -------------------------------------------------------------------------------- 1 | # Chainlink support on Euler 2 | 3 | Euler, to fulfill its role of being a permissionless protocol, lets users activate a lending market for any asset that has a WETH pair on Uniswap v3. To achieve that, Euler uses Uniswap v3 time-weighted average price (TWAP) as its main pricing oracle. However, this core dependency on Uniswap comes with its limitations. Currently on Euler, it is not possible to list an asset that does not have a WETH pair on Uniswap v3. The tiers of the assets in the protocol (collateral, cross, isolated) rely on the Uniswap oracle strength and the risks associated. Moreover, bringing the TWAP to Euler is a relatively expensive operation in terms of gas usage, and using Chainlink may be preferable on various L2 chains. Hence, it has been decided to extend the pricing types supported on Euler and include Chainlink oracles as the pricing source. 4 | 5 | Chainlink is the most used data provider in the industry. It has a very good reputation and provides secure pricing feeds that are used by lending protocol industry leaders like Aave, Compound and others. Integration with Chainlink on Euler will bring a reduction of the protocol's dependency on Uniswap. It will lower the oracle manipulation risks for those assets that have very little liquidity in WETH pair on Uniswap v3. Also, for all the assets that will have the Chainlink oracle set as a price source, it will reduce the gas usage for all the operations that require price fetching. 6 | 7 | 8 | ## Contracts changes 9 | 10 | In order to integrate with Chainlink, several contract modules on Euler require to be upgraded. The integration is a non-breaking change, meaning that all the pricing types that existed on Euler until now, should still be supported. 11 | 12 | ### `Constants.sol` 13 | 14 | A new pricing type of `PRICINGTYPE__CHAINLINK` is introduced. 15 | 16 | ### `Events.sol` 17 | 18 | A new `GovSetChainlinkPriceFeed()` event is introduced. It will be emitted when the governance decides to configure a Chainlink oracle address for a given underlying asset. 19 | 20 | ### `Storage.sol` 21 | 22 | `chainlinkPriceFeedLookup` is added to store the Chainlink oracle addresses for given underlying assets. 23 | 24 | ### `Governance.sol` 25 | 26 | `setChainlinkPriceFeed()` is added to configure a Chainlink oracle address for a given underlying asset. It has to be called first before the pricing type for the asset is changed to Chainlink. As WETH is a reference asset on Euler, only ETH quote types will be supported. Hence, it is sufficient to store only the address of the oracle and there is no need to store the decimals (they will always be 18 for all asset/ETH price feeds). 27 | 28 | `setPricingConfig()` is modified to support setting the pricing type of a given underlying asset to `PRICINGTYPE__CHAINLINK`. As already mentioned, `setChainlinkPriceFeed()` must be called first. Worth noting is the fact that even though `PRICINGTYPE__CHAINLINK` is configured, pricing parameters will still be pointing to the Uniswap pool fee which TWAP will be used as a fallback oracle in case Chainlink oracle becomes stale. However, if 0 passed as a `newPricingParameter`, there will be no Uniswap fallback pool configured. 29 | 30 | ### `Markets.sol` 31 | 32 | `getChainlinkPriceFeedConfig()` view method is added to easily read the Chainlink oracle configured for a given asset. 33 | 34 | Moreover, natspec documentation was modified to reflect the addition of a new pricing type and the way pricing parameters are interpreted within the system. 35 | 36 | ### `RiskManager.sol` 37 | 38 | `RiskManager.sol` contains the most significant changes to the system. The `getPriceInternal()` function was updated to support `PRICINGTYPE__CHAINLINK`. It calls a new function `callChainlinkLatestAnswer()` that calls the Chainlink oracle's `latestAnswer()` function to get the current price. `callChainlinkLatestAnswer()` fetches the price and implements the verification of staleness in the same way Aave does. Although it calls the `latestAnswer()`, which is marked as deprecated, the answer is validated and if less than or equal to 0 the transaction will either be reverted with `e/unable-to-get-the-price` error or Uniswap price will be fetched if pool fee previously configured. The highest supported price in the Euler system is `1e36` hence the returned price is limited if greater. 39 | 40 | Important to note is the fact that up to now the system has been relying on TWAP hence `twap` and `twapPeriod` were returned by `getPriceInternal()`. Now, because the price reported by Chainlink is the current price, the returned `twap` represents the current price and `twapPeriod` period returned is always 0. Also for `PRICINGTYPE__CHAINLINK`, `getPriceFull()` returns current Chainlink price both for `twap` and `currPrice`. 41 | 42 | - Aave defending use of `latestAnswer()` function: https://github.com/aave/aave-v3-core/issues/292 43 | - Open Zeppelin guideline: https://blog.openzeppelin.com/secure-smart-contract-guidelines-the-dangers-of-price-oracles/ 44 | 45 | 46 | ## Additional considerations 47 | 48 | In the light of the recent incident of minimum value circuit breaker triggered for Chainlink LUNA/USD price feed, we are hesitant whether the way Aave handles the Chainlink prices is best. Other approaches that can be explored. None of them, however, guarantees quick detection of price staleness. 49 | 50 | The incident references: 51 | - https://twitter.com/Hacxyk/status/1524891329141960704?t=GV9g9OX10ET6VUra4YvqYw&s=19 52 | - https://ambcrypto.com/chainlink-how-a-price-discrepancy-resulted-in-millions-lost-from-defi-protocols/ 53 | 54 | ### Check against min/max value instead of 0 55 | 56 | The fetched price can be checked against the min/max price that can be taken from the Chainlink aggregator contract for a given price feed. As can be read in the incident descriptions, the triggered circuit breaker resulted in serving the price close to min value rather than 0. Therefore, it would not be possible to detect oracle failure. 57 | 58 | Pros: 59 | - greater chance to detect the failure 60 | - transaction cost does not increase significantly 61 | 62 | Cons: 63 | - necessity to store min/max values in the contract storage 64 | - min/max values are stored in the aggregator contract and can change when the aggregator contract is replaced/updated 65 | - comparison against min/max value is not enough, the comparison would have to be against (min + delta)/(max - delta) where delta would have to be an arbitrarily chosen parameter. This is because min and max values are improbable to occur (LUNA/USD price stopped at 0.107 instead 0.1 which was the min value) 66 | 67 | ### Addtional `latestTimestamp()` call 68 | 69 | `latestTimestamp()` can be called in addition to the `latestAnswer()`. The timestamp of the latest answer can be compared against given oracle heartbeat information from the Chainlink website. Such comparison can indicate whether the answer has been updated within the heartbeat period and detect oracle staleness if not. 70 | 71 | Pros: 72 | - greater chance to detect the failure 73 | - transaction cost increases but not significantly 74 | 75 | Cons: 76 | - necessity to store heartbeat in the contract storage 77 | - a long time to detect failure as most oracles have 24h heartbeat 78 | 79 | ### Use of recommended `latestRoundData()` 80 | 81 | `latestRoundData()` returns not only the answer but also other parameters that increase the chance to detect failure. A comparison of returned `roundId` and `answeredInRound` is believed to earlier detect whether the answer is stale as `roundId` is supposed to get larger as the time moves forward. Moreover, the `updatedAt` which is the timestamp of the latest answer can be compared against the given oracle heartbeat, as described above. 82 | 83 | Pros: 84 | - greater chance to detect the failure 85 | - transaction cost increases significantly 86 | 87 | Cons: 88 | - necessity to store heartbeat in the contract storage 89 | - no guarantee that the failure will be detected quickly. When looked into ubiquitous `AccessControlledOffchainAggregator` contract type of Chainlink ([also used for mentioned LUNA/USD price feed](https://bscscan.com/address/0xec72d46011d67a6ac4fa7d3f476fa2049dc807ee#code)) one can notice that `roundId` and `answeredInRound` returned from `latestRoundData()` are duplicates. It gives a false sense of security and makes the comparison useless 90 | 91 | To sum up, it seems like currently there's no way to robustly assume Chainlink price feed failure without comparison against other price sources. -------------------------------------------------------------------------------- /developers/getting-started/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | -------------------------------------------------------------------------------- /developers/getting-started/integration-guide.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Find out how to start working with the Euler smart contracts 3 | --- 4 | 5 | # Contract Integration Guide 6 | 7 | ## Modules 8 | 9 | The Euler protocol is a collection of smart contracts connected together with a module system. Each module handles specific areas of the protocol, so depending on what you want to do, you will interact with several different contract addresses. 10 | 11 | Some modules are global, for example: 12 | 13 | * [markets](https://docs.euler.finance/developers/getting-started/contract-reference#ieulermarkets): Activating markets, enter/exiting markets, and querying various market-related information. 14 | * [exec](https://docs.euler.finance/developers/getting-started/contract-reference#ieulerexec): Batch requests, liquidity deferrals (ie, flash loans) 15 | * [liquidation](https://docs.euler.finance/developers/getting-started/contract-reference#ieulerliquidation): Seizure of assets for users in violation 16 | 17 | Other modules are asset-specific: 18 | 19 | * [eTokens](https://docs.euler.finance/developers/getting-started/contract-reference#ieuleretoken): ERC20-compatible tokens that represent assets 20 | * [dTokens](https://docs.euler.finance/developers/getting-started/contract-reference#ieulerdtoken): ERC20-compatible tokens that represent liabilities 21 | 22 | ## Deposit and withdraw 23 | 24 | In order to invest an asset to earn interest, you need to `deposit` into an eToken. 25 | 26 | ```javascript 27 | // Approve the main euler contract to pull your tokens: 28 | IERC20(underlying).approve(EULER_MAINNET, type(uint).max); 29 | 30 | // Use the markets module: 31 | IEulerMarkets markets = IEulerMarkets(EULER_MAINNET_MARKETS); 32 | 33 | // Get the eToken address using the markets module: 34 | IEulerEToken eToken = IEulerEToken(markets.underlyingToEToken(underlying)); 35 | 36 | // Deposit 5.25 underlying tokens (assuming 18 decimal places) 37 | // The "0" argument refers to the sub-account you are depositing to. 38 | eToken.deposit(0, 5.25e18); 39 | 40 | eToken.balanceOf(address(this)); 41 | // -> internal book-keeping value that doesn't increase over time 42 | 43 | eToken.balanceOfUnderlying(address(this)); 44 | // -> 5.25e18 45 | // ... but check back next block to see it go up (assuming there are borrowers) 46 | 47 | // Later on, withdraw your initial deposit and all earned interest: 48 | eToken.withdraw(0, type(uint).max); 49 | ``` 50 | 51 | ## Borrow and repay 52 | 53 | If you would like to borrow an asset, you must have sufficient collateral, and be "entered" into the collateral's market. 54 | 55 | ```javascript 56 | // Use the markets module: 57 | IEulerMarkets markets = IEulerMarkets(EULER_MAINNET_MARKETS); 58 | 59 | // Approve, get eToken addr, and deposit: 60 | IERC20(collateral).approve(EULER_MAINNET, type(uint).max); 61 | IEulerEToken collateralEToken = IEulerEToken(markets.underlyingToEToken(collateral)); 62 | collateralEToken.deposit(0, 100e18); 63 | 64 | // Enter the collateral market (collateral's address, *not* the eToken address): 65 | markets.enterMarket(0, collateral); 66 | 67 | // Get the dToken address of the borrowed asset: 68 | IEulerDToken borrowedDToken = IEulerDToken(markets.underlyingToDToken(borrowed)); 69 | 70 | // Borrow 2 tokens (assuming 18 decimal places). 71 | // The 2 tokens will be sent to your wallet (ie, address(this)). 72 | // This automatically enters you into the borrowed market. 73 | borrowedDToken.borrow(0, 2e18); 74 | 75 | borrowedDToken.balanceOf(address(this)); 76 | // -> 2e18 77 | // ... but check back next block to see it go up 78 | 79 | // Later on, to repay the 2 tokens plus interest: 80 | IERC20(borrowed).approve(EULER_MAINNET, type(uint).max); 81 | borrowedDToken.repay(0, type(uint).max); 82 | ``` 83 | 84 | ## Flash loans 85 | 86 | Euler has flash loans built-in as an integral component of the protocol. There are three ways to take a flash loan, a low-level Euler-specific way, a way that uses an [EIP-3156](https://eips.ethereum.org/EIPS/eip-3156) compatible flash-loan adaptor, and a gas-efficient direct interface. 87 | 88 | ### Low-level Flash Loans 89 | 90 | The low-level way to take a flash loan is to defer the liquidity check for your account. The Euler contract will call back into your contract, where you can perform operations like `borrow()` without worrying about liquidity violations. As long as your callback leaves the account in a non-violating state, the transaction will complete successfully. 91 | 92 | Since Euler only charges interest for a loan when it is held for a non-zero amount of time, this results in fee-less flash loans. 93 | 94 | Here is an example contract that demonstrates this: 95 | 96 | ```javascript 97 | contract MyFlashLoanContract { 98 | struct MyCallbackData { 99 | uint whatever; 100 | } 101 | 102 | function somethingThatNeedsFlashLoan() { 103 | // Setup whatever data you need 104 | MyCallbackData memory data; 105 | data.whatever = 1234; 106 | 107 | // Disable the liquidity check for "this" and call-back into onDeferredLiquidityCheck: 108 | IExec(exec).deferLiquidityCheck(address(this), abi.encode(data)); 109 | } 110 | 111 | function onDeferredLiquidityCheck(bytes memory encodedData) external override { 112 | MyCallbackData memory data = abi.decode(encodedData, (MyCallbackData)); 113 | 114 | // Borrow 10 tokens (assuming 18 decimals): 115 | 116 | IEulerDToken(borrowedDToken).borrow(0, 10e18); 117 | 118 | // ... do whatever you need with the borrowed tokens ... 119 | 120 | // Repay the 10 tokens: 121 | 122 | IERC20(borrowed).approve(EULER_MAINNET, type(uint).max); 123 | IEulerDToken(borrowedDToken).repay(0, 10e18); 124 | } 125 | } 126 | ``` 127 | 128 | `encodedData` is a pass-through parameter that lets you transfer data to your callback without requiring storage writes. 129 | 130 | ### EIP-3156 Flash Loans 131 | 132 | There is also an adaptor smart contract that exposes Euler's flash loan functionality as an [EIP-3156](https://eips.ethereum.org/EIPS/eip-3156) compatible API. 133 | 134 | The smart contract addresses are: [mainnet](https://etherscan.io/address/0x07df2ad9878F8797B4055230bbAE5C808b8259b3), [goerli](https://goerli.etherscan.io/address/0xA119432BE658449C315E0a1054eab8a9057DE280). 135 | 136 | Examples of how to use the adaptor can be found in the EIP documentation, as well as the [Euler test suite](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/test/FlashLoanAdaptorTest.sol). The fee value is always 0. 137 | 138 | ### Gas-Efficient Direct Flash Loans 139 | 140 | As of [eIP-14](https://forum.euler.finance/t/eip-14-contract-upgrades/305), DTokens also support a `flashLoan` method. In most cases, this is now the recommended way to perform a pure flash loan. It is simpler and consumes less gas than either of the above methods. 141 | 142 | To use this, your contract should implement the `IFlashLoan` interface: 143 | 144 | interface IFlashLoan { 145 | function onFlashLoan(bytes memory data) external; 146 | } 147 | 148 | When you wish to perform a flash loan, your contract should invoke the `flashLoan` function on the DToken that corresponds to the asset you wish to borrow: 149 | 150 | function flashLoan(uint amount, bytes calldata data) external; 151 | 152 | The DToken contract will transfer the requested `amount` of tokens to your contract address (decimals are the same as in the external token contract -- no normalisation needed), and then invoke your contract's `onFlashLoan` function. The `data` parameter you specify is passed to the callback unchanged, which allows you to pass extra data to your contract without requiring expensive storage writes. 153 | 154 | Note that any address could call `onFlashLoan` on your contract at any time. You may want to ensure that `msg.sender` is the Euler contract's address, or use some other kind of authentication scheme. 155 | 156 | Your contract is expected to repay `amount` back to the Euler contract (which will be `msg.sender`) within the `onFlashLoan` function. 157 | 158 | Here is an example: 159 | 160 | import "IEuler.sol"; 161 | 162 | contract MyContract { 163 | function myFunction() external { 164 | require(msg.sender == myAdminAddress, "not allowed"); 165 | IEulerDToken dToken = IEulerDToken(markets.underlyingToDToken(underlying)); 166 | dToken.flashLoan(amount, abi.encode(underlying, amount)); 167 | } 168 | 169 | function onFlashLoan(bytes memory data) external { 170 | require(msg.sender == EulerAddrsMainnet.euler, "not allowed"); 171 | (address underlying, uint amount) = abi.decode(data, (address, uint)); 172 | 173 | // ... 174 | 175 | IERC20(underlying).transfer(msg.sender, amount); // repay 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /developers/getting-started/swap-handlers.md: -------------------------------------------------------------------------------- 1 | # Swap Handlers 2 | 3 | Swap handlers are contracts, external to the Euler platform, which are used by the `SwapHub` module to execute trades through a common API. 4 | The user can select any swap handler when calling a function of the `SwapHub`. The `SwapParams` struct passed to the handler defines a type of trade (exact input vs exact output), requested token amounts and slippage settings. Additional `payload` bytes array can be used to encode off-chain any additional data required by the handler. From the perspective of the `SwapHub` module, the handler is a black box. `SwapHub` transfers tokens required for the trade to the handler before invoking the `executeSwap` function the handlers are expected to expose. `SwapHub` only requires that the resulting balances after calling the handler fall within the user requested bounds. 5 | 6 | Currently, 3 swap handlers are available in the Euler repo: 7 | * Uniswap V3 handler, which executes swaps by calling the functions of the UniswapV3 periphery [SwapRouter](https://github.com/Uniswap/v3-periphery/blob/main/contracts/SwapRouter.sol) 8 | * Uniswap [smart order router](https://github.com/Uniswap/smart-order-router) handler, which executes off-chain encoded split trades on Uniswap V2 and V3 9 | * 1Inch handler, which executes trades quoted by [1Inch Aggregation Protocol API](https://docs.1inch.io/docs/aggregation-protocol/api/swagger) 10 | 11 | ## Combined Handlers 12 | Exact output swaps are most useful when repaying a debt through `SwapHub`'s `swapAndRepay` function. If the user want's to repay the full debt, the exact amount 13 | that needs to be received from the trade is only known during the transaction execution, since debt interest accrues every second. Any off-chain calculated 14 | amount will be outdated by the time the transaction is mined. For that reason, for exact output swaps, the Uniswap Smart Order Router handler and 1Inch handlers, 15 | perform a primary swap defined by the off-chain payload and additionally trade for the remainder (presumably accrued interest) through a secondary swap, directly 16 | on UniswapV2 or V3. They are therefore referenced to as **combined** handlers. 17 | 18 | ## Security Considerations for Swap Handler Developers 19 | Swap handlers are not expected to hold any token balances. They receive input tokens from `SwapHub` and are expected to perform the trade by any means necessary, and return both the output as well as any left-over input. There is a possibility however that the handler might hold some token balances - either because of user mistake or an attempt of a griefing attack. If the handler doesn't account for it, i.e. it simply transfers all balances back unconditionally, it might return an unexpected amount of either input or output token. The consequesces from `SwapHub`'s perspective are different for exact input and exact output swaps: 20 | 21 | 1. Exact input, handler holds output token balance. 22 | 23 | Any additional output returned to SwapHub is credited to the user. 24 | 25 | 2. Exact input, handler holds input token balance. 26 | 27 | `SwapHub` accepts returns of unused input token and credits them to the user, unless the returned amount is higher than what was provided to the handler, in which case it reverts. If the handler holds enough balance, such that after executing the swap, the balance is still larger than what was provided by the `SwapHub`, the transaction would fail. 28 | 29 | 3. Exact output, handler holds output token balance. 30 | 31 | During a regular swap, extra amount will be credited to the user, `swapAndRepay` however will revert with 'repay too much' error. 32 | 33 | 4. Exact output, handler holds input token balance. 34 | 35 | Similar to scenario 2, the only difference being that the amount of input provided by `SwapHub` is the maximum allowed amount consumed by exact output swap. 36 | 37 | In scenarios 2. and 4. there is a possibility of a griefing attack by transferring tokens to the handler. It would be costly however, since the attacker needs to send more input tokens than the swap he wants to disrupt, and the next swap of a bigger size will simply consume his deposit, as a bonus to the user. Euler swap 38 | handlers ignore this possibility. 39 | 40 | Scenario 3. however is different in case of `swapAndRepay`. Even a very small amount of extra output token, a single wei in fact, will revert the transaction. For this reason, current swap handlers don't return the output token to `SwapHub`. Instead, they expect the call to the DEX to designate the Euler contract to be the receiver of the output. 41 | 42 | In case of combined swap handlers, a problem of extra output token in `swapAndRepay` could also occur if the primary swap returns more tokens than expected. The payload for the primary swap is encoded off-chain. Before the transaction is mined, the slippage could cause the trade to yield more than the debt and the transaction would revert. This scenario is accepted, and should be accounted for by the UI. If the transaction fails despite that, it might be actually in the user's favor, because it might mean the market moves in favor of the swapper. -------------------------------------------------------------------------------- /developers/mining.md: -------------------------------------------------------------------------------- 1 | # EUL Token Liquidity Mining 2 | 3 | EUL tokens are issued to users of the protocol who borrow assets, according to a time-weighted record of how long they retain those debts. The goal of this is to increase borrowing utilization of the pools, including for longer-tail assets. This should have the effect of increasing interest rates for depositors in the pool which allow passive investors such as yield aggregators to indirectly benefit from liquidity mining without having to participate themselves. 4 | 5 | Not all assets are eligible for mining rewards, however. A user could activate a custom market of which they control the entire underlying supply, and easily capture all the rewards for that market. Instead, only a subset of markets will receive rewards. This subset is determined by a staking system where participants allocate EUL tokens to the markets they would like to earn rewards on. Each epoch (approximately 2 weeks), the top `N` markets will be selected to earn rewards during the following epoch. The proportion of the total rewards issued for each markets is based on the square root of the number of tokens staked on that market. Both the total EUL distributed and the `N` parameter that controls the number of tokens are controlled by Euler governance. 6 | 7 | ## EulDistributor 8 | 9 | This contract implements a merkle drop. Governance will seed it with an amount of EUL tokens at least necessary to cover the current cumulative distribution, although extra can be pre-committed if desired. It also supports distributing tokens other than EUL, so that token partners can utilize the distribution infrastructure if governance approves. 10 | 11 | The current merkle root as well as the previous merkle root is kept in storage. They are typically (but not necessarily) updated once per epoch. Either root is eligible to claim rewards so as to prevent pending transactions from failing when the root is updated. 12 | 13 | The leaves of the merkle tree are 72 bytes long, preventing interior nodes from being reinterpreted as leaves. 14 | 15 | In its constructor, this contract approves its sister contract `EulStakes` access to its EUL tokens. This is necessary to implement "auto-staking", a feature which allows a user to claim EUL tokens and directly stake them on a market for voting purposes. This allows EOA wallets to do this operation in one transaction and save gas since it doesn't need to transit the user's wallet. 16 | 17 | ## EulStakes 18 | 19 | This contract maintains the record of how much each user has staked on each market, for the purposes of voting. To save gas, the aggregate amount voted on each market is not available on-chain and must be reconstructed from the contract's logs. 20 | 21 | Rather than implementing disjoint staking/unstaking functions, the interface is unified into a compound operation that accepts an array of `StakeOp` commands. Each command can either increase or decrease a user's stake on a market. After applying all the operations, the sum of all modifications is checked. If this amount is positive, that amount of EUL tokens must be transferred *in* to the contract. If negative, that amount is transferred *out* to the user's wallet. If zero, then no tokens are transferred. This allows EOAs to easily deposit/withdraw and rebalance stakes in a single operation. 22 | 23 | In order to implement "auto-staking" described in previous section, `stakeGift` allows somebody to apply a single *deposit* operation on behalf of another "beneficiary" account. 24 | 25 | There is also a `stakePermit` function that applies an EIP-2612 permit message to the EUL contract prior to applying the `StakeOp`s. This allows an EOA to approve the EulStakes contract and perform staking within a single transaction. 26 | -------------------------------------------------------------------------------- /developers/numeric-limits.md: -------------------------------------------------------------------------------- 1 | # Numeric Limits 2 | 3 | ## amounts 4 | 5 | `uint112` 6 | 7 | * Maximum sane amount \(result of balanceOf\) for external tokens 8 | * Uniswap2 limits token amounts to this 9 | * Spec: For an 18 decimal token, more than a million billion tokens \(1e15\) 10 | 11 | ## small amounts 12 | 13 | `uint96` 14 | 15 | * For holding amounts that we don't expect to get quite as large, in particular reserve balances 16 | * Can pack together with an address in a single slot 17 | * Spec: For an 18 decimal token, more than a billion tokens \(1e9\) 18 | 19 | ## debt amounts 20 | 21 | `uint144` 22 | 23 | * Maximum sane amount for debts 24 | * Packs together with an amount in a single storage slot 25 | * Spec: Should hold the maximum possible amount \(uint112\) but scaled by another 9 decimal places \(for the internal debt precision\) 26 | * Actual: 2e16 27 | 28 | ## prices 29 | 30 | * Minimum supported price: 31 | * Fraction: `1e3 / 1e18 = 1e-15` 32 | * Tick: `-345405` 33 | * sqrtPriceX96: `2505418623681149822473` 34 | * Maximum supported price: 35 | * Fraction: `1e33 / 1e18 = 1e15` 36 | * Tick: `345405` 37 | * sqrtPriceX96: `2505410343826649584586222772852783278` 38 | 39 | The supported price range was chosen for the following reason: 40 | 41 | * The maximum price squared fits in a uint256: `6e73 < 1e77` 42 | * Not necessary to use FullMath library 43 | * The maximum supported price times the maximum supported amount fits within a uint256: `5e66 < 1e77` 44 | * Also holds with debt and its extra 9 digits of precision: `5e75 < 1e77` 45 | 46 | ## interestRate 47 | 48 | `int96` 49 | 50 | * "Second Percent Yield" 51 | * Fraction scaled by 1e27 52 | * Example: `10% APR = 1e27 * 0.1 / (86400*365) = 1e27 * 0.000000003170979198376458650 = 3170979198376458650` 53 | * Spec: 1 billion % APR, positive or negative 54 | 55 | ## interestAccumulator 56 | 57 | `uint256` 58 | 59 | * Starts at 1e27, multiplied by \(1e27 + interestRate\) every second 60 | * Spec: 100% APR for 100 years 61 | 62 | ```text 63 | -> 2^256 64 | ~= 1.1579208923e+77 65 | -> 10^27 * (1 + (100/100 / (86400*365)))^(86400*365*100) 66 | ~= 2.6881128798e+70 67 | ``` 68 | 69 | ## moduleId 70 | 71 | `uint32` 72 | 73 | * One per module, so this is way more than needed 74 | * Divided into 3 sections 75 | * <500\_000: Public single-proxy 76 | * > =500\_000 and <1\_000\_000: Public multi-proxy 77 | * > =1\_000\_000: Internal 78 | * Spec: A dozen or so modules, with room to grow in all sections 79 | 80 | ## collateralFactor/borrowFactor 81 | 82 | `uint32` 83 | 84 | * Fraction between 0 and 1, scaled by 2^32 - 1 85 | * Spec: At least 3 decimal places \(overkill\) 86 | 87 | -------------------------------------------------------------------------------- /developers/proxy-protocol.md: -------------------------------------------------------------------------------- 1 | # Proxy Protocol 2 | 3 | Proxies are non-upgradeable stub contracts that have two jobs: 4 | 5 | * Forward method calls from external users to the main Euler contract 6 | * Receive method calls from the main Euler contract and log events as instructed 7 | 8 | Although proxies themselves are non-upgradeable, they integrate with Euler's module system, which does allow for upgrades. 9 | 10 | The following protocols all use custom assembly routines instead of the solidity ABI encoder/decoder. While we don't take this lightly, the measured overhead of keeping this in pure solidity was too high. In order to make up for this otherwise regrettable use of assembly, this document explains the protocols in detail. 11 | 12 | ## Proxy -> Euler 13 | 14 | To the calldata received in a fallback, the proxy prepends the 4-byte selector for `dispatch()` \(`0xe9c4a3ac`\), and appends its view of `msg.sender`: 15 | 16 | ```text 17 | [dispatch() selector (4 bytes)][calldata (N bytes)][msg.sender (20 bytes)] 18 | ``` 19 | 20 | This data is then passed to the Euler contract with a `CALL` \(not `DELEGATECALL`\). 21 | 22 | ## Euler -> module 23 | 24 | In the `dispatch()` method, the Euler contract looks up _its_ view of `msg.sender`, which corresponds to the proxy address. 25 | 26 | The presumed proxy address is then looked up in the `trustedSenders` mapping, which must exist otherwise the call is reverted. It is determined to exist by having a non-zero entry in the `moduleId` field \(modules must have non-zero IDs\). 27 | 28 | The only way a proxy address can be added to `trustedSenders` is if the Euler contract itself creates it \(using the `_createProxy` function in `contracts/Base.sol`\). 29 | 30 | In the case of a single-proxy module, the same storage slot in `trustedSenders` will also contain an address for the module's implementation. If not \(ie multi-proxy modules\), then the module implementation must be looked up with an additional lookup in the `moduleLookup` mapping. This is because during an upgrade, single-proxy modules just have to update this one spot, whereas multi-proxy modules would otherwise need to update every corresponding entry in `trustedSenders`. 31 | 32 | At this point we know the message is originating from a legitimate proxy, so the last 20 bytes can be assumed to correspond to an actual `msg.sender` who invoked a proxy. The length of the calldata is checked. It should be at least `4 + 4 + 20` bytes long, which corresponds to: 33 | 34 | * 4 bytes for the `dispatch()` selector. 35 | * 4 bytes for selector used to call the proxy \(non-standard ABI invocations and fallback methods are not supported in modules\). 36 | * 20 bytes for the trailing `msg.sender`. 37 | 38 | The Euler contract then takes the received calldata and strips off the `dispatch()` selector, and then appends _its_ view of `msg.sender` \(`caller()` in assembly\), which corresponds to the proxy's address. This results in the following: 39 | 40 | ```text 41 | [original calldata (N bytes)][original msg.sender (20 bytes)][proxy addr (20 bytes)] 42 | ``` 43 | 44 | This data is then sent to the module implementation with `DELEGATECALL`, so the module implementation code is executing within the storage context of the main Euler contract. 45 | 46 | The module implementation will unpack the original calldata using the solidity ABI decoder, ignoring the trailing 40 bytes. 47 | 48 | Modules are not allowed to access `msg.sender`. Instead, they should use the `unpackTrailingParamMsgSender()` helper in `contracts/BaseModule.sol` which will retrieve the message sender from the trailing calldata. 49 | 50 | When modules need to access the proxy address, there is a composite helper `unpackTrailingParams()` that returns both trailing params. `msg.sender` is still not allowed to be used for this, since modules can be invoked via a batch dispatch, instead of via the proxy. 51 | 52 | ## module -> Proxy 53 | 54 | When a module directly emits a log \(or "event" at the solidity level\) it will happen from the main Euler contract's address. This is fine for many logs, but not in certain cases like when a module is implementing the ERC-20 standard. In these cases it is necessary to emit the log from the address of the proxy itself. 55 | 56 | In order to do this, the Euler contract \(specifically one of the modules\) does a `CALL` to the proxy address. 57 | 58 | When the proxy sees a call to its fallback from the Euler contract \(its creator\), it knows not to re-enter the Euler contract. Instead, it interprets this call as an instruction to issue a log message. This is the format of the calldata: 59 | 60 | ```text 61 | [number of topics as uint8 (1 byte)][topic #i (32 bytes)]{0,4}[extra log data (N bytes)] 62 | ``` 63 | 64 | The proxy unpacks this message and executes the appropriate log instruction, `log0`, `log1`, etc, depending on the number of topics. 65 | 66 | -------------------------------------------------------------------------------- /developers/sdk.md: -------------------------------------------------------------------------------- 1 | # SDK 2 | 3 | [Euler-sdk](https://www.npmjs.com/package/@eulerxyz/euler-sdk) is a JavaScript SDK for the Euler platform. It is used in production in the Euler Dapp and a few other applications, although it's currently considered an alpha software. 4 | 5 | See the [Github repo](https://github.com/euler-xyz/euler-sdk) for docs and examples. 6 | 7 | Please feel free to open a pull request, create an issue in the repo, or reach out to us with feature requests and suggestions in the `#mainnet-development` [Discord](https://discord.gg/CdG97VSYGk) channel. -------------------------------------------------------------------------------- /developers/swap-and-repay.md: -------------------------------------------------------------------------------- 1 | # swapAndRepay Work-Flows 2 | 3 | swapAndRepay is a flexible primitive in the swap and swap-hub modules that allows us to implement several advanced work-flows in a gas-efficient way. It works by using a uniswap "exact output" swap. This output is determined when the transaction is actually mined, so it will not leave any extra dust due to interest that was accrued while the transaction was pending. Some dust may be left in case of tokens with special handling of the balances, like rebasing or fee-on-transfer tokens. 4 | 5 | 6 | ## Un-short, single collateral 7 | 8 | In this case, a user has setup a long/short position. Their account contains only a collateral asset A and a loan in asset B. Typically this is setup by depositing some A, minting B, and then swapping B->A. 9 | 10 | This is the canonical example for swapAndRepay. It simply performs the reverse operation. 11 | 12 | Steps: 13 | 14 | - swapAndRepay A -> B 15 | 16 | 17 | ## Un-short, multiple collaterals 18 | 19 | If the user has multiple collaterals, is possible that any one collateral asset could be insufficient to repay the full debt. This is the case where a user first deposits a *different* collateral asset C, and then mints B and swaps B->A. 20 | 21 | Here we are assuming that the B liability is larger than the A asset, because of interest accruals (if not, the single collateral method is sufficient, and any remaining A can be swapped into C, if desired). 22 | 23 | Steps: 24 | 25 | - swap max A -> B 26 | - burn max B 27 | - swapAndRepay C -> B 28 | 29 | 30 | 31 | ## Un-mine, fully self-collateralised 32 | 33 | "Mining" in this case means a self-collateralised loan, for the purpose of earning EUL tokens. This method is very similar to un-shorting, except that all self-collateralising collateral should be burned first, to minimise swapping fees. 34 | 35 | In this case, the additional collateral that is topping up the self-collateralised loan is in the same asset as the loan, B. 36 | 37 | Steps: 38 | 39 | - max burn B 40 | 41 | 42 | ## Un-mine, different collateral 43 | 44 | In this case, the additional collateral A that is topping up the loan is different than the loan itself, B. 45 | 46 | First we burn to reduce swapping costs. This ensures the swapAndRepay step sees the smallest possible debt outstanding. 47 | 48 | Steps: 49 | 50 | - max burn B 51 | - swapAndRepay A -> B 52 | 53 | 54 | ## Un-mine multiple different collaterals 55 | 56 | If the user has multiple different collaterals then it is possible that any one collateral asset could be insufficient to repay the full debt. Suppose there is one extra collateral C, in addition to collateral A (and self-collateralised asset B). 57 | 58 | Steps: 59 | 60 | - swap C -> B (amount calculated off-chain) 61 | - max burn B (burns both self-collateralised amount and swapped amount from previous step) 62 | - swapAndRepay A -> B 63 | 64 | Notes: 65 | 66 | * A and C are interchangeable here, although the one used in the final step will be the one left with an indeterminate amount after subtracting swapping fees and interest. 67 | 68 | 69 | 70 | ## Swap debt asset 71 | 72 | In this case, a user has collateral A backing a loan in B. The user wishes to convert this loan B to a loan in a new asset C. 73 | 74 | Steps: 75 | 76 | - mint "large" amount of C 77 | - swapAndRepay C -> B 78 | - burn max C 79 | 80 | Notes: 81 | 82 | * The "large" amount of C must be larger than required to pay off the loan in B, including accrued interest while the transaction is pending, and swap fees and slippage. There is no harm in minting a very large amount because any excess will be burned off at no cost. The amount could be the full pool (or maybe 90% in case there are withdrawals while transaction is pending), or could be the value of B adjusted upwards to account for the estimated costs of the above (plus some padding). 83 | * If B is self-collateralised, then "burn max B" should be executed first to reduce the cost of the swap. 84 | * If the user wishes to reduce the size of the debt, then beforehand: 85 | - swap A -> B (amount calculated off-chain) 86 | - burn max B 87 | * If the user wishes to increase the size of the debt, then afterwards: 88 | - borrow C (amount calculated off-chain) 89 | -------------------------------------------------------------------------------- /eul/about.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn more about the protocol-native governance token of Euler 3 | --- 4 | 5 | # About 6 | 7 | ## Introduction 8 | 9 | EUL tokens represent voting powers to effect change over the protocol code. EUL is an ERC20 token that acts as the native governance token of the Euler Protocol. The EUL token address is: `0xd9Fcd98c322942075A5C3860693e9f4f03AAE07b`. 10 | 11 | More information about EUL can be found on [Etherscan](https://etherscan.io/token/0xd9fcd98c322942075a5c3860693e9f4f03aae07b), [CoinMarketCap](https://coinmarketcap.com/currencies/euler-finance/) or [CoinGecko](https://www.coingecko.com/en/coins/euler). 12 | 13 | ## Breakdown 14 | 15 | The total supply of EUL is 27,182,818 (in homage to Euler’s number, [e](https://en.wikipedia.org/wiki/E\_\(mathematical\_constant\))). The initial four-year breakdown of the EUL total supply is as follows: 16 | 17 | * **25%** (6,795,705 EUL) to users of the Euler protocol over 4 years (see [Distribution](distribution.md)). 18 | * **1%** (271,828 EUL) to all users who deposited or borrowed assets on Euler during its soft launch (see [Epoch0](distribution-1.md#epoch-0)). 19 | * **13.83%** (3,759,791 EUL) to the Euler Treasury, unlocked (see [Treasury](../euler-governance/treasury.md)). 20 | * **25.85%** (7,026,759 EUL) to Euler Labs shareholders, with an 18 month linear unlock schedule starting on 01/01/2022. 21 | * **9.67%** (2,628,170 EUL) to partners of EulerDAO, with an 18 month linear unlock schedule starting on 01/01/2022. 22 | * **4%** (1,087,313 EUL) to Encode, an early project incubator, with a linear 30 month unlock schedule starting on 01/01/2022. 23 | * **20.65%** (5,613,252 EUL) to employees, advisors and consultants of Euler Labs. Co-founders with a 48 month linear unlock schedule starting on 01/01/2022. All others with individual agreements. 24 | 25 | Here is the breakdown: 26 | 27 | ![](<../.gitbook/assets/image (3).png>) 28 | 29 | The unlock schedule for different groups is as follows: 30 | 31 | ![](<../.gitbook/assets/image (5).png>) 32 | 33 | Note that the initial allocations may be subject to change as the ecosystem evolves. As EUL is distributed to users of the protocol they may see fit to vote to alter the EUL Distribution, for example. 34 | 35 | The total supply of EUL is fixed for the first 4 years, after which EUL token holders may enact a governance proposal to inflate the supply by a maximum 2.718% per year. In that scenario, newly minted EUL will enter circulation via the [Treasury](../euler-governance/treasury.md). 36 | 37 | ## Circulating Supply 38 | 39 | The approximate schedule for the circulating supply of EUL is shown below. 40 | 41 | ![](../.gitbook/assets/image.png) 42 | 43 | ## 44 | -------------------------------------------------------------------------------- /eul/distribution-1.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn more about the phases of the EUL Distribution Programme 3 | --- 4 | 5 | # Epochs 6 | 7 | ## Introduction 8 | 9 | The EUL Distribution Programme has two phases. Epoch 0, in which governance tokens were distributed to early protocol users retroactively; and Epoch 1-96, in which governance tokens are distributed on an ongoing basis to active users of the protocol. 10 | 11 | ## Epoch 0 12 | 13 | Epoch 0 covers the 3 month period from 26/11/2021 to 21/03/2022 during which Euler protocol was in a soft-launch mode. Users were experimenting with the protocol in a risk-minimised manner. 14 | 15 | ### Implementation 16 | 17 | **Lenders** and **borrowers** using the protocol during this period were allocated a share of 1% of the total supply of EUL as a one-off retroactive distribution. 18 | 19 | The distribution took place as follows: 20 | 21 | 1. A snapshot of all users on the protocol was taken at block 14,430,000. 22 | 2. A total of 271,828 EUL (1% of the total supply) was distributed to anyone interacting with the protocol upto that point. 23 | 3. The distribution amount per address was calculated as follows: 24 | * 2/3 of the issuance was distributed proportionally based on the time-weighted\* average USD value of the deposits and borrows in the mentioned time frame. 25 | * 1/3 of the total issuance is distributed evenly amongst all the unique addresses that interacted with the protocol in the mentioned time frame. 26 | 27 | _\*For simplicity, the accrued interest on deposits and borrows was neglected._ 28 | 29 | In conclusion, 3407 unique addresses received at least 26.59 EUL tokens plus an individual amount proportional to the time-weighted average USD value of their deposits and borrows. See [here](https://docs.google.com/spreadsheets/d/1jTECkKiMDMvj1UdaU0AEFfhW8IN0SiBfkNFYpTdWIfo/edit#gid=0) for the final allocations. 30 | 31 | ## Epochs 1-96 32 | 33 | Epochs 1-96 cover the period from 21/03/2022 to 17/12/2025 during which Euler will progressively decentralise. 34 | 35 | ### Initial Implementation 36 | 37 | **Borrowers** using the protocol during this period will be allocated EUL via a rolling merkle distribution. The amount distributed each epoch will follow a non-linear schedule (see below). 38 | 39 | Within each market, borrowers will receive an EUL distribution proportional to their time-weighted borrowing on that market. The amount of EUL allocated to each market every epoch will be determined by EUL token holders (see [Gauges](https://app.gitbook.com/o/-MJloiaY-UMc3SjaxzA6/s/-MJlqpE4apPrZurt7BNr/\~/changes/8TZLu5aIjb41difegSzr/governance/gauges)). 40 | 41 | Users will be able to claim their EUL governance tokens after an epoch has completed by using the 'Claim' button at [https://app.euler.finance/](https://app.euler.finance/). 42 | 43 | ### Updates 44 | 45 | #### [eIP 24](https://snapshot.org/#/eulerdao.eth/proposal/0x7e65ffa930507d9116ebc83663000ade6ff93fc452f437a3e95d755ccc324f93) 46 | 47 | The DAO voted to alter the initial EUL Distribution Programme. Beginning epoch 18, the DAO began allocating a fixed amount of 40,000 EUL each epoch to the [Gauges](https://app.gitbook.com/o/-MJloiaY-UMc3SjaxzA6/s/-MJlqpE4apPrZurt7BNr/\~/changes/8TZLu5aIjb41difegSzr/governance/gauges) to be voted on each epoch by existing EUL token holders, with an additional 15,000 EUL allocated evenly to lenders of USDC, USDT, and WETH for a trial period of 6 epochs. 48 | 49 | #### [eIP29](https://snapshot.org/#/eulerdao.eth/proposal/0x8f046317b789af0de687334356a63005c2e213beb446ff620e43e5f356020c3e) 50 | 51 | Creation of an Euler boosted USDC/DAI/USDT pool that is allocated 5,000 EUL as voting incentives every two weeks. This would run for a trial period of three months. 52 | 53 | #### [eIP51](https://snapshot.org/#/eulerdao.eth/proposal/0x551f9e6f3fba50a0fc2c69e361f7a81979189aa7f0ed923a1873bd578896942b) 54 | 55 | Proposal to change distribution as follows: 56 | 57 | * 9,000 EUL per epoch to stakers of WETH market. 58 | * 5,000 EUL per epoch to stakers of USDC market. 59 | * 1,000 EUL per epoch to stakers of USDT market. 60 | * 8,000 EUL per epoch via gauges to borrowers on each of USDC, WETH, and WStETH 61 | * 8,000 EUL per epoch shared proportionally among assets with Chainlink oracle 62 | 63 | ### Schedule 64 | 65 | The following table outlines the block numbers for previous and forthcoming epochs. 66 | 67 | | Epoch | Block Number | EUL Distribution | 68 | | ----- | -------------- | ---------------- | 69 | | 0 | 14,430,000 | 271,828.18 | 70 | | 1 | 14,530,000 | 36,915.69 | 71 | | 2 | 14,630,000 | 37,673.39 | 72 | | 3 | 14,730,000 | 38,531.30 | 73 | | 4 | 14,830,000 | 39,501.78 | 74 | | 5 | 14,930,000 | 40,598.43 | 75 | | 6 | 15,030,000 | 41,836.14 | 76 | | 7 | 15,130,000 | 43,231.14 | 77 | | 8 | 15,230,000 | 44,800.97 | 78 | | 9 | 15,330,000 | 46,564.39 | 79 | | 10 | 15,430,000 | 48,541.27 | 80 | | 11 | 15,530,000 | 50,752.38 | 81 | | 12 | 15,630,000 | 53,219.03 | 82 | | 13 | 15,730,000 | 55,962.62 | 83 | | 14 | 15,830,000 | 59,004.03 | 84 | | 15 | 15,930,000 | 62,362.78 | 85 | | 16 | 16,030,000 | 66,056.03 | 86 | | 17 | 16,130,000 | 70,097.30 | 87 | | 18 | 16,230,000 | eIP24 | 88 | | 19 | 16,330,000 | 55000 | 89 | | 20 | 16,430,000 | 55000 | 90 | | 21 | 16,530,000 | 55000 | 91 | | 22 | 16,630,000 | 55000 | 92 | | 23 | 16,730,000 | 55000 | 93 | | 24 | 16,830,000 | eIP29 & eIP51 | 94 | | 25 | 16,930,000 | 52000 | 95 | | 26 | 17,030,000 | 52000 | 96 | | 27 | 17,130,000 | 52000 | 97 | | 28 | 17,230,000 | 52000 | 98 | | 29 | 17,330,000 | 47000 | 99 | | 30 | 17,430,000 | 47000 | 100 | | 31 | 17,530,000 | 47000 | 101 | | 32 | 17,630,000 | 47000 | 102 | | 33 | 17,730,000 | 47000 | 103 | | 34 | 17,830,000 | 47000 | 104 | | 35 | 17,930,000 | 47000 | 105 | | 36 | 18,030,000 | 47000 | 106 | | 37 | 18,130,000 | 47000 | 107 | | 38 | 18,230,000 | 47000 | 108 | | 39 | 18,330,000 | 47000 | 109 | | 40 | 18,430,000 | 47000 | 110 | | 41 | 18,530,000 | 47000 | 111 | | 42 | 18,630,000 | 47000 | 112 | | 43 | 18,730,000 | 47000 | 113 | | 44 | 18,830,000 | 47000 | 114 | | 45 | 18,930,000 | 47000 | 115 | | 46 | 19,030,000 | 47000 | 116 | | 47 | 19,130,000 | 47000 | 117 | | 48 | 19,230,000 | 47000 | 118 | | 49 | 19,330,000 | 47000 | 119 | | 50 | 19,430,000 | 47000 | 120 | | 51 | 19,530,000 | 47000 | 121 | | 52 | 19,630,000 | 47000 | 122 | | 53 | 19,730,000 | 47000 | 123 | | 54 | 19,830,000 | 47000 | 124 | | 55 | 19,930,000 | 47000 | 125 | | 56 | 20,030,000 | 47000 | 126 | | 57 | 20,130,000 | 47000 | 127 | | 58 | 20,230,000 | 47000 | 128 | | 59 | 20,330,000 | 47000 | 129 | | 60 | 20,430,000 | 47000 | 130 | | 61 | 20,530,000 | 47000 | 131 | | 62 | 20,630,000 | 47000 | 132 | | 63 | 20,730,000 | 47000 | 133 | | 64 | 20,830,000 | 47000 | 134 | | 65 | 20,930,000 | 47000 | 135 | | 66 | 21,030,000 | 47000 | 136 | | 67 | 21,130,000 | 47000 | 137 | | 68 | 21,230,000 | 47000 | 138 | | 69 | 21,330,000 | 47000 | 139 | | 70 | 21,430,000 | 47000 | 140 | | 71 | 21,530,000 | 47000 | 141 | | 72 | 21,630,000 | 47000 | 142 | | 73 | 21,730,000 | 47000 | 143 | | 74 | 21,830,000 | 47000 | 144 | | 75 | 21,930,000 | 47000 | 145 | | 76 | 22,030,000 | 47000 | 146 | | 77 | 22,130,000 | 47000 | 147 | | 78 | 22,230,000 | 47000 | 148 | | 79 | 22,330,000 | 47000 | 149 | | 80 | 22,430,000 | 47000 | 150 | | 81 | 22,530,000 | 47000 | 151 | | 82 | 22,630,000 | 47000 | 152 | | 83 | 22,730,000 | 47000 | 153 | | 84 | 22,830,000 | 47000 | 154 | | 85 | 22,930,000 | 47000 | 155 | | 86 | 23,030,000 | 47000 | 156 | | 87 | 23,130,000 | 47000 | 157 | | 88 | 23,230,000 | 47000 | 158 | | 89 | 23,330,000 | 47000 | 159 | | 90 | 23,430,000 | 47000 | 160 | | 91 | 23,530,000 | 47000 | 161 | | 92 | 23,630,000 | 47000 | 162 | | 93 | 23,730,000 | 47000 | 163 | | 94 | 23,830,000 | 47000 | 164 | | 95 | 23,930,000 | 47000 | 165 | | 96 | 24,030,000 | 47000 | 166 | -------------------------------------------------------------------------------- /eul/distribution.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: >- 3 | Learn more about how EUL is distributed to protocol users to decentralise 4 | governance 5 | --- 6 | 7 | # Distribution 8 | 9 | 10 | ## Introduction 11 | 12 | 13 | In order to progressively decentralise governance of the Euler Protocol, EUL will be distibuted to protocol users over a period of (approx) 4 years. See how much EUL is being distributed today [here](https://app.euler.finance/gauges). 14 | 15 | The distribution programme is broken down into cycles called [epochs](distribution-1.md).On Euler, you can be eligible to receive EUL by either staking your lending positions ([eTokens](https://docs.euler.finance/developers/getting-started/architecture#etoken)) to Euler staking contract or by borrowing one of the incentivized assets, which have been determined either by governance or by the staking [gauge ](gauges.md)system. 16 | 17 | ## How it Works 18 | 19 | 20 | The amount of EUL each borrower receives is proportional to the time-weighted amount of debt they held of an asset within the epoch. For example, if 50 EUL are to be distributed to the DAI market in epoch 3, and if Alice borrows 10 DAI for 1 day, and Bob borrows 5 DAI for 2 days, then at the end of the epoch, and after the merkle-root update (typically takes a few hours), they will both be able to claim an equal share of 25 EUL. 21 | 22 | The same logic applies to the lenders that stake their eTokens to one of the Euler staking contracts. For example, if 50 EUL are to be distributed to the USDC staking pool in epoch 3, and if Alice stakes 10 eUSDC for 1 day, and Bob stakes 5 eUSDC for 2 days, they will both be able to claim an equal share of 25 EUL at any time. 23 | 24 | 25 | 26 | ## How to Claim 27 | 28 | Users with an EUL distribution allocation can navigate to the rop right of the UI and click the 'Claim' button. That will open a dialogue box, showing a user's projected EUL distribution after the current epoch has completed. This will tick up second-by-second as a user accrues more time-weighted borrowing. The pending balance below that shows EUL tokens already distributed to the user but which remain in the distribution smart contract unclaimed. Users can click the Claim button in the bottom right of the dialogue to transfer those tokens to their wallet. 29 | 30 | ![](<../../.gitbook/assets/claim2 (1).png>) 31 | 32 | -------------------------------------------------------------------------------- /eul/gauges.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: >- 3 | Learn about how Euler enables community-selected markets to receive a 4 | governance token distribution 5 | --- 6 | 7 | # Gauges 8 | 9 | ## Introduction 10 | 11 | The Euler community helps to determine which markets receive an EUL distribution through the use of staking gauges. EUL token holders can visit the [Gauge](https://app.euler.finance/gauges) page on the app UI and stake their tokens against a particular market to indicate their preference for that market receiving an EUL distribution in future epochs. 12 | 13 | ## Good to know 14 | 15 | As it stands, users cannot vote on DAO proposals if they participate in gauge voting. Only users with EUL can direct further EUL emissions. You can remove your EUL at any point from the gauge to distribute further EUL emissions. 16 | 17 | For an emissions schedule of EUL, please see the [Epochs page.](distribution-1.md) 18 | 19 | -------------------------------------------------------------------------------- /eul/staking.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: >- 3 | Learn about how Euler rewards different assets with lending incentives 4 | --- 5 | 6 | # Staking on Euler 7 | 8 | 9 | 10 | Staking on Euler is based on Synthetix’s staking contracts. This is an overhaul to Euler’s gauge system, which thanks to [eIP51](https://snapshot.org/#/eulerdao.eth/proposal/0x551f9e6f3fba50a0fc2c69e361f7a81979189aa7f0ed923a1873bd578896942b) is modified from its previous iteration coming into effect with the arrival of [Epoch 24.](https://docs.euler.finance/eul/distribution-1) 11 | 12 | To stake an asset and receive some of the EUL being distributed, users should stake their [eTokens](https://docs.euler.finance/developers/getting-started/architecture#etoken-less-than-greater-than-dtoken-symmetry) into the staking contract. 13 | 14 | Should you please, you can immediately unstake your tokens at any time and the accrued EUL earnings will be instantly claimable. There is no lockup period for this staking process. 15 | 16 | According to [eIP51](https://snapshot.org/#/eulerdao.eth/proposal/0x551f9e6f3fba50a0fc2c69e361f7a81979189aa7f0ed923a1873bd578896942b), the DAO has made the decision to keep the staking rewards program running indefinitely, unless another vote is held to terminate the program. The staking contracts will receive EUL tokens distributed in the following manner: 17 | 18 | * 9,000 EUL per epoch to stakers of WETH market. 19 | * 5,000 EUL per epoch to stakers of USDC market. 20 | * 1,000 EUL per epoch to stakers of USDT market. 21 | 22 | 23 | 24 | 25 | 26 | ## Considerations 27 | 28 | 29 | 30 | While these eTokens are held in the staking contract, users should be aware that they cannot collateralise loans. You cannot borrow against tokens that are earning these EUL in the staking contract. 31 | 32 | 33 | 34 | Make sure when depositing assets into the staking contract that if you have any outstanding liabilities, they are adequately collateralised AFTER you have deposited your USDC/USDT/WETH. Your account will be flagged for [liquidation](https://docs.euler.finance/getting-started/white-paper#liquidations) otherwise. 35 | 36 | 37 | -------------------------------------------------------------------------------- /euler-governance/addresses.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Smart contract addresses for Euler Governance (On-Chain) 3 | --- 4 | 5 | # Addresses 6 | 7 | ## Networks 8 | 9 | The EulerDAO is currently deployed to the following networks: 10 | 11 | ### Mainnet 12 | 13 | | Contract | Address | Etherscan | Source Code | 14 | | -------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- | 15 | | EUL | `0xd9Fcd98c322942075A5C3860693e9f4f03AAE07b` | [Etherscan](https://etherscan.io/address/0xd9Fcd98c322942075A5C3860693e9f4f03AAE07b) | [GitHub](https://github.com/euler-xyz/euler-governance/blob/master/contracts/governance/Eul.sol) | 16 | | Governance | `0xd8E2114f6bCbaee83CDEB1bD6650a28BBcF144D5` | [Etherscan](https://etherscan.io/address/0xd8E2114f6bCbaee83CDEB1bD6650a28BBcF144D5) | [GitHub](https://github.com/euler-xyz/euler-governance/blob/master/contracts/governance/Governance.sol) | 17 | | Timelock Controller | `0xd4Ee8939a537D943a4E46E7Ae04069C9451d724F` | [Etherscan](https://etherscan.io/address/0xd4Ee8939a537D943a4E46E7Ae04069C9451d724F) | [GitHub](https://github.com/euler-xyz/euler-governance/blob/master/contracts/governance/TimelockController.sol) | 18 | | Stub Target Contract | `0x8233f21dda26229c8b0586c3c2521be5da0e6328` | [Etherscan](https://etherscan.io/address/0x8233f21dda26229c8b0586c3c2521be5da0e6328) | [GitHub](https://github.com/euler-xyz/euler-governance/blob/master/contracts/governance/StubEulerGovernance.sol) | 19 | 20 | ### Rinkeby 21 | 22 | | Contract | Address | Etherscan | Source Code | 23 | | -------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | 24 | | EUL | `0xe013C993A77Cdd1aC0d8c1B15a6eFf95EB36c8c6` | [Etherscan](https://rinkeby.etherscan.io/address/0xe013C993A77Cdd1aC0d8c1B15a6eFf95EB36c8c6) | [GitHub](https://github.com/euler-xyz/euler-governance/blob/master/contracts/governance/Eul.sol) | 25 | | Governance | `0x681E9cf95e26c6C2cEF09fdc476C7f8De6AFf2D5` | [Etherscan](https://rinkeby.etherscan.io/address/0x681E9cf95e26c6C2cEF09fdc476C7f8De6AFf2D5) | [GitHub](https://github.com/euler-xyz/euler-governance/blob/master/contracts/governance/Governance.sol) | 26 | | Timelock Controller | `0x16fBC769237cE17830799e6faD9d53536c3B8389` | [Etherscan](https://rinkeby.etherscan.io/address/0x16fBC769237cE17830799e6faD9d53536c3B8389) | [GitHub](https://github.com/euler-xyz/euler-governance/blob/master/contracts/governance/TimelockController.sol) | 27 | | Stub Target Contract | `0x57848100bc077161805fdDcF6D9bA15D4aab06d8` | [Etherscan](https://rinkeby.etherscan.io/address/0x57848100bc077161805fdDcF6D9bA15D4aab06d8) | [GitHub](https://github.com/euler-xyz/euler-governance/blob/master/contracts/governance/StubEulerGovernance.sol) | 28 | -------------------------------------------------------------------------------- /euler-governance/getting-started/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ## Introduction 4 | 5 | The code for Euler Protocol is controlled by a decentralised community through on-chain governance on the Ethereum network. The community are holders of a protocol-native governance token called [EUL ](broken-reference/)(pronounced 'oil'), which enables the community to effect change over the Euler Protocol code. Tokens can be used to propose upgrades to the protocol or vote on the proposals of others. 6 | 7 | ## Protocol Code 8 | 9 | Governance can vote to effect change over the Euler Protocol for parameters such as: 10 | 11 | 1. **Default isolated** tier borrow **factor** 12 | 2. **Collateral** and **borrow factors** of specific assets 13 | 3. Inclusion of an asset in the **cross** and **collateral tiers** 14 | 4. Change in choice of **risk parameters** and general **methodology** 15 | 16 | *** 17 | 18 | On-Chain governance, allows unique features such as delegated voting and proposition powers, as well as protocol (and governance configuration) updates via a time lock executor. This ensures the protocol can adapt to evolving market conditions, as well as upgrade core parts of the protocol over time. 19 | 20 | On the other hand, for off-chain governance, there is no code to review or implement as such. It is mainly a call for the Euler Foundation to carry out an action. Issue a grant, or pay a bill, for example. Thus mainly used to aid Euler in making difficult decisions in collaboration with the community. 21 | 22 | Euler protocol uses the [Tally](https://www.tally.xyz/governance/eip155:1:0xd8E2114f6bCbaee83CDEB1bD6650a28BBcF144D5) governance interface for on-chain voting. [Snapshot](https://snapshot.org/#/eulerdao.eth/proposal/0x3b4b7e79c40df6860e7d612bdccc4969753e283dfd84673dc5fc4d201abcb317) on the other hand is an interface use for off-chain or 'gasless' voting. 23 | 24 | ## Process 25 | 26 | The [General Governance Process](https://forum.euler.finance/t/welcome-to-the-euler-governance-forum/7) is documented on the Governance Forum. 27 | 28 | The flow of the governance process is as follows: 29 | 30 | 1. Discuss the idea/draft proposal in the [Euler Discord](https://discord.gg/CdG97VSYGk) #governance channel 31 | 2. Draft & create a [RFC (Request For Comment) Proposal](https://forum.euler.finance/c/rfc-request-for-comment/11) on Governance forum for further feedbacks 32 | 3. Contact a forum moderator to create a [eIP (Euler Improvement Proposal)](https://forum.euler.finance/c/eip/5) on the Governance forum 33 | 4. eIP created on [Snapshot](https://snapshot.org/#/eulerdao.eth) (off-chain voting)​ 34 | 35 | This is a necessary step for all types of proposals, and execution will be carried out by Euler Foundation if the proposal is successful. 36 | 5. _Optional step — eIP created on_ [_Tally_](https://www.tally.xyz/governance/eip155:1:0xd8E2114f6bCbaee83CDEB1bD6650a28BBcF144D5) _(on-chain voting)_ 37 | 38 | _If and only if the proposal includes changes to the smart contract, the proposal will be voted on Tally after Snapshot voting. Execution will be targeting Euler protocol smart contract if the proposal is successful._ 39 | 40 | It is noteworthy that not all off-chain proposals that are either binding or non-binding on the protocols smart contracts will end up having an on-chain proposal depending on the outcome of the off-chain 'gas-less' voting and for gas cost savings. On the other hand, not all on-chain proposals will require an off-chain counterpart. 41 | 42 | Depending on the outcome of an off-chain voting process, an on-chain proposal might be created which will be executed against a target protocol smart contract if successful. 43 | 44 | If an off-chain proposal requires an on-chain proposal that will be executed against a protocol smart contract, then the general flow could be as follows: 45 | 46 | Creation of a formal Idea/Proposal on Governance forum for discussion → Proposal created on Snapshot (off-chain proposal creation) → Off-Chain Voting → (if on-chain governance is required) eIP (Euler Improvement Proposal) creation on Governance forum by forum moderator → eIP created on Tally (on-chain proposal creation) → On-Chain Voting (and Execution on target Euler protocol smart contract if successful). 47 | 48 | ### Idea 49 | 50 | A great place to start a discussion on a potential governance proposal is the idea section on the forum website. If you feel confident that your idea is relevant to the community and is well-formulated, head over to the Governance Forum to begin a discussion with the community around your idea (following the process described on the [forum](https://forum.euler.finance/t/welcome-to-the-euler-governance-forum/7)). 51 | 52 | Once a discussion / commenting begins around your idea, be proactive with the community and be open to suggestions. It typically takes a week for the request for comments to mature before it becomes an eIP. 53 | 54 | ### Governance Proposal 55 | 56 | If the discussion is well-formulated and the community has a clear understanding of the proposal and supports your idea, (for on-chain proposals) it will be moved by a moderator to the governance category as an eIP: Euler Improvement Proposal. Once the proposal has an eIP, an on or off-chain proposal can be created on the [Tally governance dashboard](https://www.tally.xyz/governance/eip155:1:0xd8E2114f6bCbaee83CDEB1bD6650a28BBcF144D5) or on the [Snapshot governance dashboard](https://snapshot.org/#/eulerdao.eth/proposal/0x3b4b7e79c40df6860e7d612bdccc4969753e283dfd84673dc5fc4d201abcb317). 57 | 58 | A Tally or Snapshot proposal does not always need to be created by the original eIP author / proposer, it can be posted by someone else or by on of the delegates in case the minimum threshold of EUL is not being met. 59 | 60 | A good governance proposal example can be found here: [eIP: Promote WBTC to collateral tier 3](https://forum.euler.finance/t/eip-1-promote-wbtc-to-collateral-tier/27). 61 | 62 | Stay updated by subscribing to the [community newsletter](https://newsletter.euler.finance/) and follow the [Twitter Page](https://twitter.com/eulerfinance)! 63 | -------------------------------------------------------------------------------- /euler-governance/governance-parameters.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn more about the Euler Governance smart contract parameters 3 | --- 4 | 5 | # Parameters 6 | 7 | ## Introduction 8 | 9 | This page outlines the governance parameters for both on-chain and off-chain governance. 10 | 11 | ### Tally (On-Chain) Governance Parameters 12 | 13 | This section outlines the governance parameters for the Euler Governance smart contracts (managed via [Tally](https://www.tally.xyz/governance/eip155:1:0xd8E2114f6bCbaee83CDEB1bD6650a28BBcF144D5)). All parameters are displayed in Table 1 below. 14 | 15 | Execution Delay, Voting Delay and Voting Period are based on the assumption of a 15 seconds block creation time on the Ethereum Mainnet. 16 | 17 | The governance smart contract inherits functionality from the OpenZeppelin [GovernorSettings.sol module](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/governance/extensions/GovernorSettings.sol) allowing Voting Delay, Voting Period and Proposal Threshold to be updated through an on-chain governance proposal and voting process. 18 | 19 | **Table 1** Euler On-Chain Governance Parameters 20 | 21 | | Parameter | Value | 22 | | ------------------ | ----------------------- | 23 | | Voting Delay | 11520 blocks (2 days) | 24 | | Voting Period | 17280 blocks (3 days) | 25 | | Execution Delay | 172800 seconds (2 days) | 26 | | Quorum Numerator | 3% of EUL Supply | 27 | | Proposal Threshold | 75,000 EUL | 28 | 29 | When a governance proposal is created, it enters a 2-day review period (i.e., Voting Delay), after which voting weights are recorded and voting begins. 30 | 31 | Voting lasts for 3 days (i.e., Voting Period); once the voting period is over, if quorum was reached (enough voting power participated) and the majority voted in favour, the proposal is considered successful and can proceed to be executed 2 days (48 hours) later (i.e., Execution Delay). 32 | 33 | Addresses delegated at least 75,000 EUL can create governance proposals having met the Proposal Threshold. 34 | 35 | The image below depicts the on-chain governance phases and durations for each phase: 36 | 37 | ![](../.gitbook/governance/governance\_process.png) 38 | 39 | ### Snapshot (Off-Chain) Governance Parameters 40 | 41 | This section outlines the governance parameters for off-chain governance (managed via [Snapshot](https://snapshot.org/#/eulerdao.eth/proposal/0x3b4b7e79c40df6860e7d612bdccc4969753e283dfd84673dc5fc4d201abcb317)). All parameters are displayed in Table 2 below. 42 | 43 | **Table 2** Euler Off-Chain Governance Parameters 44 | 45 | | Parameter | Value | 46 | | ------------------ | --------- | 47 | | Voting Period | 6 days | 48 | | Quorum | 1,000 EUL | 49 | | Proposal Threshold | 50 EUL | 50 | 51 | There is no voting delay or execution delay for the off-chain governance process, given there is no direct effect on the protocol's smart contracts. 52 | 53 | Addresses holding or delegated at least 50 EUL can create governance proposals having met the Proposal Threshold. With regard to voting power, the delegated voting power or EUL balance at the proposal creation block number is counted towards voting power. The [Snapshot voting strategies](https://docs.snapshot.org/strategies/what-is-a-strategy) enabled are `erc20-balance-of` and `erc20-votes`. 54 | -------------------------------------------------------------------------------- /euler-governance/grants.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about how to receive a grant for contributing to EulerDAO 3 | --- 4 | 5 | # Grants 6 | 7 | ## Introduction 8 | 9 | To encourage developers to build on top of Euler protocol and help integrate it into the wider DeFi ecosystem, a portion of the Euler [Treasury ](treasury.md)will be allocated to a Grants programme. The purpose of the grants is to foster the growth of Euler protocol by establishing a culture of community-driven development, where individuals making improvements to the Euler Protocol get a say in its future. 10 | -------------------------------------------------------------------------------- /euler-governance/how-to/README.md: -------------------------------------------------------------------------------- 1 | # How To 2 | 3 | Use the navigation bar on the left side to find guides for all the primary actions and functions required for governance. 4 | -------------------------------------------------------------------------------- /euler-governance/how-to/create-a-tally-on-chain-proposal/README.md: -------------------------------------------------------------------------------- 1 | # Create a Tally (On-Chain) Proposal 2 | 3 | ## About 4 | 5 | On-Chain governance actions (proposal, voting, etc.) for the Euler protocol can be done via the [Tally](./#tally) governance dashboard (described below). It is only required for proposals proposing changes to the smart contracts. 6 | 7 | Tally is a web-based governance application focused on enabling on-chain governance. The Tally governance web application [provides transparency around the governance of various DeFi protocols, e.g., Compound, Uniswap, etc.](https://docs.tally.xyz/) bringing all of the proposals and voting for these protocols under a shared user interface. 8 | 9 | Tally empowers user owned governance through a voting dashboard, governance tooling, and real time research and analysis. Users can use the app to review data on governance systems, active and prior proposals, and individual delegates or token holders. The platform also enabled direct on-chain voting and vote delegation, helping users put their governance insights into action. Through integration with the Euler governance smart contract, Euler token holders can connect their wallets and create proposals, vote, delegate voting power to a community member, discover other delegates in the community, and more. 10 | 11 | The [Euler Governance Dashboard](https://www.tally.xyz/governance/eip155:1:0xd8E2114f6bCbaee83CDEB1bD6650a28BBcF144D5) can be accessed on Tally. The guide below demonstrates how to created an on-chain governance proposal on this dashboard. 12 | 13 | ## Step-by-step 14 | 15 | Now that you have created a proposal using [proposal.euler.finance](https://proposal.euler.finance/) and it has passed off-chain voting on Snapshot, you are ready to make a proposal on Tally for on-chain voting. 16 | 17 | 1\. Visit the [Euler on-chain governance dashboard](https://www.tally.xyz/governance/eip155:1:0xd8E2114f6bCbaee83CDEB1bD6650a28BBcF144D5) on Tally and connect your wallet where you have EUL voting power. 18 | 19 | ⚠️ _You CANNOT vote if you have not delegated your token., You have to either delegate your token power to yourself or a delegate in order to vote in governance. Self-delegate or delegate to others_ [_here_](https://app.euler.finance/delegates)_._ 20 | 21 | 2\. To create a new proposal, click on `Create New Proposal` from the DAO home page on Tally as shown in the top right corner in the image below. 22 | 23 | ![](../../../.gitbook/governance/dao\_1\_tally\_2.png) 24 | 25 | This will then open up the proposal creation dialog taking users through the required steps to create an on-chain proposal. In the initial step / screen, it will check that the user has enough voting power to meet the proposal threshold specified within the governance smart contract. 26 | 27 | ![](../../../.gitbook/governance/new\_proposal\_1.png) 28 | 29 | 3\. The `Continue` button shown above will become active if the connected wallet has the reqired voting power that meets the proposal threshold. Upon clicking continue, you will be presented with a form to input the proposal name and add a short description as shown below. 30 | 31 | ![](../../../.gitbook/governance/new\_proposal\_2.png) 32 | 33 | 4\. Users will need to add the actions to be executed should the proposal become successful or receive majority of vote in support. In this step, users can specify the target smart contract address (this should be the \[stub governance smart contract address -]\(https://etherscan.io/address/0x8233f21dda26229c8b0586c3c2521be5da0e6328 `0x8233f21dda26229c8b0586c3c2521be5da0e6328`) for phase one of the governance launch), smart contract function and required function parameters (the hex data for your proposal created on [proposal.euler.finance](https://proposal.euler.finance/)). Up to a maximum of 10 actions can be added in a single proposal. 34 | 35 | You do not need to upload smart contract ABI file as it will be automatically imported from the verified contract on etherscan. 36 | 37 | ![](../../../.gitbook/governance/new\_proposal\_3.png) 38 | 39 | 5\. The following page will then be the review page allowing the user to review and confirm that the specified actions are correct: 40 | 41 | ![](../../../.gitbook/governance/new\_proposal\_review.png) 42 | 43 | Once confirmed, the proposal will then be created on-chain and if successful, Tally will display the proposal page with the description and status as it progresses (e.g., pending, active, succeeded, queued, executed). 44 | 45 |
46 | 47 | Full Tally documentation can be accessed online at: [Tally](https://docs.withtally.com). The documentation describes how to navigate the web app, voting and delegation and creating a Tally account. 48 | -------------------------------------------------------------------------------- /euler-governance/how-to/create-a-tally-on-chain-proposal/create-a-snapshot-off-chain-proposal.md: -------------------------------------------------------------------------------- 1 | # Create a Snapshot (Off-Chain) Proposal 2 | 3 | ## About 4 | 5 | Off-chain governance actions (proposal, voting, etc.) for the Euler protocol can be done via the [Snapshot](create-a-snapshot-off-chain-proposal.md#snapshot) governance dashboard (described below). For off-chain governance, there is no code to review or implement as such. It is mainly a call for the Euler Foundation to carry out an action. Issue a grant, or pay a bill, for example. Thus mainly used to aid Euler in making difficult decisions in collaboration with the community. 6 | 7 | [Snapshot](https://snapshot.org/#/) is an off-chain, 'gasless', multi-governance community polling dashboard used by a number of decentralised finance projects including the likes of Aave and Balancer. 8 | 9 | It provides a simple interface to create governance proposals and lets users vote on them by connecting their wallets and the governance tokens contained within. However, the actual voting process is conducted off-chain to save on gas costs and complexity to enable community members 'signal' their preferences on proposals before any on-chain actions or governance process. 10 | 11 | The [Euler Governance Dashbaord](https://snapshot.org/#/eulerdao.eth) can be accessed on Snapshot. 12 | 13 | 14 | 15 | ## Step-by-step 16 | 17 | 1\. Navigate to the [Euler](https://snapshot.org/#/eulerdao.eth) home page on Snapshot and connect your wallet where you have EUL voting power. You should see the Euler space home page as shown below. 18 | 19 | ⚠️ _You CANNOT vote if you have not delegated your token., You have to either delegate your token power to yourself or a delegate in order to vote in governance. Self-delegate or delegate to others_ [_here_](https://app.euler.finance/delegates)_._ 20 | 21 | ![](../../../.gitbook/governance/snapshot-home.png) 22 | 23 | 2\. Click on `New proposal` on the left hand side of the window of the Euler space home page (shown above). It should open up the new proposal form for you to complete which looks like this: 24 | 25 | ![](../../../.gitbook/governance/snapshot-new-proposal.png) 26 | 27 | It will also check your connected wallet for voting power and let you know the current proposal threshold. 28 | 29 | 3\. Enter the proposal title. 30 | 31 | 4\. Enter the proposal description (it can be formatted using markdown) and you can also enter a link at the bottom pointing to your proposal on the Euler Governance Forum on Discourse. 32 | 33 | 5\. Click on `Continue` after previewing your proposal and go to the `Actions` box and select the voting type and start date of your proposal (end date will be shown based on the current voting period settings). The proposal creation block number is the snapshot where the voting power of voters will be counted. 34 | 35 | 6\. Click on `Publish` and your proposal will be created. You will be prompted by Metamask to sign a transaction which is free and the proposal will then become active on Snapshot. 36 | 37 | 38 | 39 | Full Snapshot documentation can be accessed via the [Snapshot documentation site](https://docs.snapshot.org). 40 | -------------------------------------------------------------------------------- /euler-governance/how-to/delegate-voting-power.md: -------------------------------------------------------------------------------- 1 | # Delegate Voting Power 2 | 3 | 🚨 _If you wish to have a say in governance, you need to delegate your voting power to yourself or someone in the community. Without performing this action, you will not have any voting power which means being unable to create proposals or vote on Snapshot (off-chain) and Tally (on-chain)._ 🚨 4 | 5 | ## About 6 | 7 | In summary, delegates are token holders that have completed a one-time setup process (executing the delegate function of the token to delegate another user or the token holder themselves to enable the governor contract to determine their voting power). Once you become a delegate, you can vote on active proposals, and create proposals if you have enough voting power. If you choose not to directly vote on proposals, you can pass your voting power on to a delegate as well. 8 | 9 | The delegate sections below describe the delegation using the EUL token smart contract and via the Tally Governance Dashboard. 10 | 11 | Delegate votes from the sender to a delegatee. Users can delegate to 1 address at a time, and the number of votes added to the delegatee’s vote count is equivalent to the balance of EUL in the user’s account. Votes are delegated from the current block and onward, until the sender delegates again, or transfers their EUL. Delegation can be carried out via the smart contract function described below or via the Tally user interface. 12 | 13 | ## Step-by-step 14 | 15 | Voting power delegation can be done via Etherscan, Tally (On-Chain) Governance dashboard or programmatically. 16 | 17 | ### Etherscan 18 | 19 | 1\. Visit the [EUL token page](https://etherscan.io/address/0xd9fcd98c322942075a5c3860693e9f4f03aae07b) on Etherscan (shown below). 20 | 21 |
22 | 23 | 2\. Click on `Contract` (shown below) to view the EUL token smart contract code and interact with the contract via etherscan. 24 | 25 |
26 | 27 | 3\. Click on `Write Contract` (shown below). 28 | 29 |
30 | 31 | 4\. Click `Connect to Web3` to connect your Metamask wallet which will be used to confirm the delegate transaction. Once connected, you should see your wallet connect on etherscan as shown below. 32 | 33 |
34 | 35 | 5\. Click on `3. delegate` to expand the delegatee address input text field. 36 | 37 |
38 | 39 | 6\. Enter the address you wish to delegate your voting power to. This can be your wallet address if you are self-delegating or another wallet address (i.e., a community member or one of the active delegates on the [delegates list](https://app.euler.finance/delegates). 40 | 41 | 7\. Click on the blue `Write` button directly under the delegatee address text field. 42 | 43 | 8\. Finally, regardless of whether you are delegating to yourself or delegating to a delegate, you will be required to confirm the transaction in your Metamask wallet and this transaction will cost gas. 44 | 45 |
46 | 47 | To check the address you are currently delegated to, you can click on the `Read Contract` tab next to the `Write Contract` tab and you will be presented with the window below. 48 | 49 |
50 | 51 | Click on `10. delegates` (shown below) and paste your address in the text field and click on `Query` and it should show the address you have set as a delegate. If it shows the zero address, (i.e., 0x0000000000000000000000000000000000000000) then it implies you have not delegated to your wallet or to another address. 52 | 53 | You can also check your current voting power. 54 | 55 | To do this, click on `14. getVotes` (shown below) and paste your address in the text field and click on `Query`. If you have self-delegated, your voting power should be equal to the number of tokens you hold. If you have not self-delegated, or if you have delegated to another address, the query will return zero voting power. 56 | 57 |
58 | 59 | ### Tally (On-Chain) Governance Dashboard 60 | 61 | 1\. Visit the [Euler on-chain governance dashboard](https://www.tally.xyz/governance/eip155:1:0xd8E2114f6bCbaee83CDEB1bD6650a28BBcF144D5) on Tally and connect your wallet where you hold EUL tokens. 62 | 63 | ![](../../.gitbook/governance/connect\_wallet.png) 64 | 65 | 2\. Click on `Delegate vote` at the top right corner of the screen. 66 | 67 | 3\. A pop-up window will appear with two options as shown below, i.e., Delegate to self or Delegate to an address. You can then choose on of these options from the pop up window, either to delegate to yourself or to another wallet address (i.e., a community member or one of the active delegates on the [delegates list](https://app.euler.finance/delegates)). By delegating to self, you retain your voting power. Next time there is an active proposal, you can choose to vote in any way you choose. 68 | 69 | ![](../../.gitbook/governance/delegate\_to\_self.png) 70 | 71 | If you choose to delegate to an address or delegate, the following screen will be shown instead where you can enter the address you wish to delegate your voting power to. 72 | 73 | ![](../../.gitbook/governance/delegate\_to\_other\_address.png) 74 | 75 | This will not transfer any of your EUL tokens to the delegate, but rather only delegate all your voting power, i.e., you will be voting via a delegate or proxy who will be voting on your behalf or representing you at the polls! 76 | 77 | You can always change the delegate later on or delegate to yourself again. This helps to ensure that there is a good degree of participation from the community on on-chain governance proposals voting. 78 | 79 | 4\. Finally, regardless of whether you are delegating to yourself or delegating to a delegate, you will be required to confirm the transaction in your Metamask wallet and this transaction will cost gas. 80 | 81 | ![](../../.gitbook/governance/delegate\_to\_self\_metamask.png) 82 | 83 | To recap, delegates are token holders that have completed a one-time setup process. Once you become a delegate, you can then vote on active proposals, and create proposals if you have enough voting power. If you choose not to directly vote on proposals, you can pass your voting power on to a delegate as we have seen. 84 | 85 | #### 86 | 87 | ### Programmatically 88 | 89 | For developers who wish to interact with the EUL token smart contract directly, the EUL contract has a delegate function defined with examples on how to interact with it shown below. 90 | 91 | ``` 92 | function delegate(address delegatee) 93 | ``` 94 | 95 | * `delegatee`: The address the sender wishes to delegate their votes to. 96 | * `msg.sender`: The address of the EUL token holder that is attempting to delegate their votes. 97 | * `RETURN`: No return. 98 | 99 | #### Solidity 100 | 101 | ``` 102 | EUL eul = EUL(0x123...); // contract address 103 | eul.delegate(delegateeAddress); 104 | ``` 105 | 106 | #### Web3.js 107 | 108 | ``` 109 | const tx = await eul.methods.delegate(delegateeAddress).send({ from: sender }); 110 | ``` 111 | -------------------------------------------------------------------------------- /euler-governance/how-to/join-the-forum.md: -------------------------------------------------------------------------------- 1 | # Join the Forum 2 | 3 | ## About 4 | 5 | This [Euler Forum](https://forum.euler.finance) is dedicated to discussions on Euler governance. Relevant topics include: 6 | 7 | * Governance proposals 8 | * Proposal discussions 9 | * Site feedback 10 | * Risk assessments 11 | 12 | Joining the forum helps members of the community to keep up to date with the latest discussions within the community around governance proposals as well as engage in the comments section or create your own proposals. 13 | 14 | To access the forum, simply navigate to [forum.euler.finance](https://forum.euler.finance). You will need to register an account in order to have full access to the features, e.g., replying to posts and proposals or creating a new proposal for others to comment on. 15 | 16 | If you need technical help, or want a place for more general discussion, visit the official [Euler Discord](https://discord.gg/cNg9NhWs). 17 | 18 | ## Step-by-step 19 | 20 | The steps below describe how to join the forum. 21 | 22 | 1. Click on the `Sign Up` button at top right corner of the form home page. 23 | 2. Complete the account creation form which will pop up upon clicking `Sign Up`. 24 | 3. Once completed, click on `Create your account` 25 | -------------------------------------------------------------------------------- /euler-governance/how-to/vote-on-snapshot-off-chain.md: -------------------------------------------------------------------------------- 1 | # Vote on Snapshot (Off-Chain) 2 | 3 | ## About 4 | 5 | This guide describes how to cast a vote on a proposal (off-chain) created on Snapshot. 6 | 7 | ## Step-by-step 8 | 9 | 1\. Navigate to the [Euler](https://snapshot.org/#/eulerdao.eth) home page on Snapshot and connect your wallet where you have EUL voting power. 10 | 11 | ⚠️ _You CANNOT vote if you have not delegated your token., You have to either delegate your token power to yourself or a delegate in order to vote in governance. Self-delegate or delegate to others_ [_here_](https://app.euler.finance/delegates)_._ 12 | 13 | 2\. Click on an active proposal of your choice to view more details and see the voting options (as well as existing votes). 14 | 15 | ![](../../.gitbook/governance/snapshot-proposal.png) 16 | 17 | Scrolling down on the page, you will see the current votes, voters (votes and voting power) and the options available for voting. 18 | 19 | 3\. Select an option to vote on, and your voting power will be displayed and you will be prompted by Metamask to sign a transaction which is free. 20 | 21 | ![](../../.gitbook/governance/snapshot-vote.png) 22 | 23 | Full Snapshot documentation can be accessed via the [Snapshot documentation site](https://docs.snapshot.org). 24 | -------------------------------------------------------------------------------- /euler-governance/how-to/vote-on-tally-on-chain.md: -------------------------------------------------------------------------------- 1 | # Vote on Tally (On-Chain) 2 | 3 | ## About 4 | 5 | This guide describes how to cast a vote on a proposal (on-chain) created on Tally. 6 | 7 | ## Step-by-step 8 | 9 | 1\. Visit the [Euler on-chain governance dashboard](https://www.tally.xyz/governance/eip155:1:0xd8E2114f6bCbaee83CDEB1bD6650a28BBcF144D5) on Tally and connect your wallet where you have EUL voting power. 10 | 11 | ⚠️ _You CANNOT vote if you have not delegated your token., You have to either delegate your token power to yourself or a delegate in order to vote in governance. Self-delegate or delegate to others_ [_here_](https://app.euler.finance/delegates)_._ 12 | 13 | 2\. Click on an active proposal of your choice. 14 | 15 | 3\. Click on `Vote` 16 | 17 | 4\. When voting, voters have the option to vote for or against a proposal or an abstain vote as shown below. Voters also have the option of casting a vote with or without a comment for the community. 18 | 19 |
20 | 21 | 5\. You will be asked to confirm the vote transaction in your wallet after clicking `Submit`. 22 | 23 | Full Tally documentation can be accessed online at: [Tally](https://docs.withtally.com). The documentation describes how to navigate the web app, voting and delegation and creating a Tally account. 24 | -------------------------------------------------------------------------------- /euler-governance/how-to/write-a-proposal.md: -------------------------------------------------------------------------------- 1 | # Write a Proposal 2 | 3 | ### About 4 | 5 | This guide describes how to get started with writing a governance proposal, firstly on the forum followed by a proposal on Snapshot (off-chain) or Tally (on-chain). 6 | 7 | ### Step-by-step 8 | 9 | *** 10 | 11 | The Request for Comment (RFC) section on the forum is the first step in creating a governance proposal. Head over to the [RFC section](https://forum.euler.finance/c/rfc-request-for-comment/11) on the [Euler Governance Forum](https://forum.euler.finance) to create a new proposal. Make sure it’s well-formulated, be proactive with the community, engage with their comments, and be open to suggestions. 12 | 13 | For consistency, the following proposal structure is advised: 14 | 15 | ### Proposal Structure 16 | 17 | * **Title:** \[Enter Proposal Title] 18 | * **Author(s):** \[enter name(s) of associated authors] 19 | * **Related Discussions:** \[paste link here] 20 | * **Submission Date:** \[Enter Date] 21 | 22 | **Body Paragraphs/Sections:** 23 | 24 | * **Simple Summary**: Give the community a TL;DR on your proposal; no more than 2-3 sentences. 25 | * **Abstract**: Introduce and expand on the proposal. Highlight key points on how the proposal will improve stakeholder/token holder experience, protocol performance, and the overall implementation process. 26 | * **Motivation**: What problems will this proposal address/solve? What’s the value-add? 27 | * **Specification**: Answer key relevant question to the protocol. 28 | 29 | 1. What is the link between the eIP author and the asset? 30 | 2. Provide a brief description of the asset 31 | 3. How is the asset primarily used? 32 | 4. Explain why the eIP would benefit Euler’s ecosystem? 33 | 5. Where does the asset trade? 34 | 6. What are the volumes and market capitalisation? 35 | 7. What is the liquidity like in the Uniswap V3 liquidity pool versus ETH? 36 | 8. What security/auditing reports have been done? 37 | 38 | * **Implementation**: Present the implementation of the proposal using [proposal transaction generation tool](https://proposal.euler.finance/). 39 | * **Risk Assessment**: Give evaluation of the risk parameters involved with the proposal 40 | 41 | 1. Oracle grading 42 | 2. Decentralisation 43 | 3. Volatility 44 | 4. Liquidity 45 | 5. Smart Contract Risk 46 | 47 | * **Voting**: Define what a “yes” and “no” vote entails. If there are any Snapshot votes or forum polls associated with this proposal, please attach them. 48 | * **Relevant Links**: If you used Euler’s oracle grading tool or other tools/references please add it here, eg. ‘Oracle grading tool: [https://oracle.euler.finance/](https://oracle.euler.finance/)’ 49 | 50 | _A good governance proposal example can be found here:_ [eIP: Promote WBTC to collateral tier](https://forum.euler.finance/t/eip-1-promote-wbtc-to-collateral-tier/27) 51 | 52 | 2\. Governance Proposal (on-chain or off-chain) 53 | 54 | If the RFC is well-formulated and the community has a clear understanding of the proposal and supports your RFC, it will be moved by a mod to the governance category as an **eIP: Euler Improvement Proposal**. Please note that it usually takes a week (7 days) for a proposal to be moved from RFC to the eIP stage. Once an eIP has been assigned, the proposal can then be created on Snapshot or Tally using this eIP. 55 | 56 | A Snapshot or Tally proposal does not always need to be posted by the original eIP author, it can be posted by someone else or one of the delegates in case the minimum threshold of EUL is not being met. The proposal on Snapshot or Tally should always have the link to the eIP attached. The parameters of the poll (Yes, No, different options for values) need to mirror the options discussed in the eIP. 57 | 58 | Proposals that are rejected due to invalidity or insufficient support can be resubmitted. Approved proposals with sufficient support via governance/voting will be implemented by the Euler Foundation. 59 | 60 | ### 61 | -------------------------------------------------------------------------------- /euler-governance/treasury.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn more about the Euler Treasury 3 | --- 4 | 5 | # Treasury 6 | 7 | ## Introduction 8 | 9 | All newly created EUL tokens enter circulation initially via a smart contract called the Euler Treasury. The treasury is managed by EUL token holders through on-chain and off-chain governance procedures and overseen by the Euler Foundation. 10 | 11 | ## Address 12 | 13 | The address for the treasury is: `0xcAD001c30E96765aC90307669d578219D4fb1DCe`. 14 | 15 | It can be viewed on Etherscan [here](https://etherscan.io/address/0xcAD001c30E96765aC90307669d578219D4fb1DCe). 16 | 17 | ## Multisig 18 | 19 | The wallet holding treasury assets is a [Gnosis Safe](https://gnosis-safe.io/) MultiSig smart contract wallet. A MultiSig wallet requires multiple private key signatures to authorise transactions. In the case of the Euler Treasury, 4 out 9 signatures are required for every transaction. 20 | 21 | The identity of the signers of the MultiSig cannot be revealed, for obvious security reasons. However, signers come from a pool of 6 different organisations and, through their contract with the Euler Foundation, are obliged to carry out the wishes of the Euler DAO. 22 | 23 | The MultiSig, along with its signers, are can be viewed publicly here: 24 | 25 | [https://gnosis-safe.io/app/eth:0xcAD001c30E96765aC90307669d578219D4fb1DCe/home](https://gnosis-safe.io/app/eth:0xcAD001c30E96765aC90307669d578219D4fb1DCe/home).\ 26 | -------------------------------------------------------------------------------- /euler-protocol/addresses.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Smart contract addresses for Euler 3 | --- 4 | 5 | # Addresses 6 | 7 | Besides Euler, the smart contracts are upgradeable via Governance which will be controlled by EUL token holders (i.e., the implementation contracts will be upgraded periodically). Hence, for contract interaction, please use the proxy smart contract addresses. 8 | 9 | For example, using [web3.js](https://web3js.readthedocs.io/en/v1.2.11/web3-eth-contract.html) to interact with the Markets contract, we use the Markets contract ABI but set the Markets contract proxy address as the target contract: 10 | 11 | ```javascript 12 | const markets = new Contract(MarketsABI, Markets_Proxy_Address); // proxy address 13 | ``` 14 | 15 | ## Networks 16 | The Euler protocol is currently deployed to the following networks: 17 | 18 | 19 | ### Mainnet 20 | 21 | | Contract | Proxy Address | Etherscan (Proxy) | Etherscan (Implementation) | Source Code | 22 | |-------|------|------|------|------| 23 | | Euler | 0x27182842E098f60e3D576794A5bFFb0777E025d3 | | [Etherscan](https://etherscan.io/address/0x27182842E098f60e3D576794A5bFFb0777E025d3) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/Euler.sol) | 24 | | Markets | 0x3520d5a913427E6F0D6A83E07ccD4A4da316e4d3 | [Etherscan](https://etherscan.io/address/0x3520d5a913427E6F0D6A83E07ccD4A4da316e4d3) | [Etherscan](https://etherscan.io/address/0xE5d0A7A3ad358792Ba037cB6eE375FfDe7Ba2Cd1) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/modules/Markets.sol) | 25 | | Liquidation | 0xf43ce1d09050BAfd6980dD43Cde2aB9F18C85b34 | [Etherscan](https://etherscan.io/address/0xf43ce1d09050BAfd6980dD43Cde2aB9F18C85b34) | [Etherscan](https://etherscan.io/address/0xAed37a234cc880a9e3D9Fd9022013eE0A419493e) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/modules/Liquidation.sol) | 26 | | Exec | 0x59828FdF7ee634AaaD3f58B19fDBa3b03E2D9d80 | [Etherscan](https://etherscan.io/address/0x59828FdF7ee634AaaD3f58B19fDBa3b03E2D9d80) | [Etherscan](https://etherscan.io/address/0x14cBaC4eC5673DEFD3968693ebA994F07F8436D2) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/modules/Exec.sol) | 27 | | Swap | 0x7123C8cBBD76c5C7fCC9f7150f23179bec0bA341 | [Etherscan](https://etherscan.io/address/0x7123C8cBBD76c5C7fCC9f7150f23179bec0bA341) | [Etherscan](https://etherscan.io/address/0xf40e8314143B4CF1764CCCd22588a8794a00d8Ca) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/modules/Swap.sol) | 28 | | SwapHub | 0x542ACC8E1db037d6008587aBfB1B7fB44014c629 | [Etherscan](https://etherscan.io/address/0x7123C8cBBD76c5C7fCC9f7150f23179bec0bA341) | [Etherscan](https://etherscan.io/address/0x542ACC8E1db037d6008587aBfB1B7fB44014c629) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/modules/SwapHub.sol) | 29 | | Governance | 0xAF68CFba29D0e15490236A5631cA9497e035CD39 | [Etherscan](https://etherscan.io/address/0xAF68CFba29D0e15490236A5631cA9497e035CD39) | [Etherscan](https://etherscan.io/address/0x554ee3d9ed7E9ec21E186c7dd636430669812f73) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/modules/Governance.sol) | 30 | | EulerSimpleLens | 0xAF68CFba29D0e15490236A5631cA9497e035CD39 | | [Etherscan](https://etherscan.io/address/0x5077B7642abF198b4a5b7C4BdCE4f03016C7089C) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/views/EulerSimpleLens.sol) | 31 | 32 | ### Goerli 33 | 34 | | Contract | Proxy Address | Etherscan (Proxy) | Etherscan (Implementation) | Source Code | 35 | |-------|------|------|------|------| 36 | | Euler | 0x931172BB95549d0f29e10ae2D079ABA3C63318B3 | | [Etherscan](https://goerli.etherscan.io/address/0x931172BB95549d0f29e10ae2D079ABA3C63318B3) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/Euler.sol) | 37 | | Markets | 0x3EbC39b84B1F856fAFE9803A9e1Eae7Da016Da36 | [Etherscan](https://goerli.etherscan.io/address/0x3EbC39b84B1F856fAFE9803A9e1Eae7Da016Da36) | [Etherscan](https://goerli.etherscan.io/address/0xeE28839fde1e462C8e0b80DE618cB98dB3c017F8) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/modules/Markets.sol) | 38 | | Liquidation | 0x66326c072283feE63E1C3feF9BD024F8697EC1BB | [Etherscan](https://goerli.etherscan.io/address/0x66326c072283feE63E1C3feF9BD024F8697EC1BB) | [Etherscan](https://goerli.etherscan.io/address/0x849f5CC81d12887BC0e4e42D8C87AbA896bDCAC0) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/modules/Liquidation.sol) | 39 | | Exec | 0x4b62EB6797526491eEf6eF36D3B9960E5d66C394 | [Etherscan](https://goerli.etherscan.io/address/0x4b62EB6797526491eEf6eF36D3B9960E5d66C394) | [Etherscan](https://goerli.etherscan.io/address/0x6C933044542d6cAF8927E516B9A99632697bD4C0) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/modules/Exec.sol) | 40 | | Swap | 0xA0AAb1Ddd165cE80AE2b9bC9bBE3b6EEFBB2300c | [Etherscan](https://goerli.etherscan.io/address/0xA0AAb1Ddd165cE80AE2b9bC9bBE3b6EEFBB2300c) | [Etherscan](https://goerli.etherscan.io/address/0x034FCa46b265b4805e00E109A5ABA3E976625B1D) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/modules/Swap.sol) | 41 | | Governance | 0x496A8344497875D0D805167874f2f938aEa15600 | [Etherscan](https://goerli.etherscan.io/address/0x496A8344497875D0D805167874f2f938aEa15600) | [Etherscan](https://goerli.etherscan.io/address/0xc9314acCF0d3754A38DdE280D24c51D280C33D16) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/modules/Governance.sol) | 42 | | ERC20 Token Faucet | 0x1215396CB53774dCE60978d7237F32042cF3a1db | | [Etherscan](https://goerli.etherscan.io/address/0x1215396CB53774dCE60978d7237F32042cF3a1db) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/smart-contract-deployments/contracts/test/TestERC20TokenFaucet.sol) | 43 | | EulerSimpleLens | 0x62626a0f051B547b3182e55D1Eba667138790D8D | | [Etherscan](https://goerli.etherscan.io/address/0x62626a0f051B547b3182e55D1Eba667138790D8D) | [GitHub](https://github.com/euler-xyz/euler-contracts/blob/master/contracts/views/EulerSimpleLens.sol) | 44 | 45 | 46 | _Note: the Governance smart contract is currently used for our risk-guarded launch (Phase 1 of the mainnet launch) while we build up to community-led governance in Phase 2._ 47 | -------------------------------------------------------------------------------- /euler-protocol/eulers-default-parameters/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: All of these parameters may be amended by governance 3 | --- 4 | 5 | # Parameters 6 | 7 | ## Borrow Factor 8 | 9 | When someone activates a lending market on Euler for an asset XYZ, it is by default an isolated tier asset and its **borrow factor is 0.28**. 10 | 11 | This means that if you lend USDC (Collateral Factor of 0.90) and borrow XYZ at Default Borrow Factor (Borrow Factor of 0.28), your effective factor is approximately 0.25 (0.90 x 0.28). 12 | 13 | Consequently, when borrowing default assets, you are required to be at minimum 4x overcollateralised. The factor is even more conservative if you borrow against an asset with a lower collateral factor. 14 | 15 | Conservative overcollateralisation is intended to prevent bad debts. 16 | 17 | For example, suppose the borrowed asset XYZ sharply skyrockets in price, causing a user's health factor to dip below 1, which means he is subject to liquidation. For the liquidator to be incentivised to liquidate the user, he needs to receive an attractive liquidation bonus in terms of the violator's lent assets. If there are simply not enough lent assets to back the bonus, a liquidator will choose not to liquidate. This leads to bad debts. 18 | 19 | Alternatively, someone could manipulate XYZ pricing lower to be able to borrow a lot more XYZ than normally possible. Eventually, the price gets arbitraged and normalises, which leads to the health factor dipping below 1. Since the position is heavily overcollateralised, there is still enough collateral backing the loan, and hence liquidators are incentivised to repay the debts. 20 | 21 | For more info on collateral and borrow factors, check out our risk docs: [https://docs.euler.finance/risk-framework/collateral-and-borrow-factors](https://docs.euler.finance/risk-framework/collateral-and-borrow-factors) 22 | 23 | ## Reserve Factor 24 | 25 | The **default reserve factor is set at 23%**. 26 | 27 | This means that for every $1 of interest paid by borrowers on an XYZ asset, 23c is paid into the reserve pool of XYZ while the remaining 77c are paid to lenders of XYZ. These reserves may later be used to repay the bad debts that accrue in the pool. 28 | 29 | While a higher reserve factor would in theory help accumulate more substantial reserves to backstop the Euler lending pools, at some point it would discourage lenders as they'll receive too little interest. 30 | 31 | Alternatively, a reserve factor that's too low is a lost opportunity to build reserves and hence trust with lenders. 32 | 33 | We think a reserve factor of 23% is a perfect balance between building reserves and encouraging lending, especially given our generous EUL distribution scheme that will run in the first few years of Euler protocol's existence. 34 | 35 | ## Interest Rate Model 36 | 37 | While we eventually plan to move to a reactive interest rate model that will optimise for utilisation, we start off with a standard kink model. The default kink model is the "small cap" model and its parameters are: 38 | 39 | 1. Base IR: **0%** (APY when utilisation is 0%) 40 | 2. Kink IR: **10%** (APY when utilisation is exactly Kink%) 41 | 3. Max IR: **300%** (APY when utilisation is 100%) 42 | 4. Kink%: **50%** (Percent utilisation where kink occurs) 43 | 44 | Given the default assets and their respective utilisation can be extremely volatile, it's important that the lenders aren't constantly exposed to withdrawal risk. 45 | 46 | To that end, should utilisation sharply rise beyond the Kink%, high Max IR makes borrowing too expensive to maintain and hence lowers the withdrawal risk 47 | 48 | ## Pricing Parameters 49 | 50 | ### Uniswap3 Pool Fee-Level 51 | 52 | The default uniswap3 pool fee-level is the **first existing of 0.3%, 0.05%, 1%**. 53 | 54 | In order to retrieve asset prices, Euler uses Uniswap3's Time-Weighted Average Price (TWAP) for the pair XYZ/WETH, where XYZ is the asset in question and WETH is the reference asset. Since Uniswap3 supports multiple pools for the same pair which differ by fee-level, which pool to actually query needs to be configured on a per-asset basis. 55 | 56 | Although in theory pools should converge to similar prices due to arbitrage, this is not always the case. For example, when a pool has insufficient liquidity to be profitable for arbitrage bots. Additionally, the amount of liquidity has an impact on the cost of price manipulation. 57 | 58 | In order to be promoted up a tier, a review of the configured pool fee must be conducted. In some cases, extra "full-range liquidity" must be added to increase the cost of price manipulation. 59 | 60 | ### TWAP Length 61 | 62 | The **default TWAP length is set at 30 minutes.** 63 | 64 | Euler uses Uniswap v3 TWAPs as the pricing oracle for all assets and debts on Euler. 65 | 66 | As explained in our [whitepaper](https://docs.euler.finance/getting-started/white-paper#twap), a TWAP is essentially a moving average of trades that occurred in a given Uniswap v3 pool. The intention for using TWAPs is that it makes price manipulations prohibitively expensive the longer the TWAP window is. 67 | 68 | However, a TWAP that's too long causes a significant lag between last-traded price on Uniswap and the TWAP, leading to risks of bad debt. 69 | 70 | For eg, a user deposits ETH as collateral and borrows XYZ token. Imagine that the user's XYZ debt swells to $70 worth, and he's subject to liquidation. A liquidator would have to take on some of that XYZ debt and repay it. 71 | 72 | However, recall that while the debt is priced in TWAP terms, a liquidator would need to buy XYZ on the market to repay that debt. If the market price of his debt is $120, the liquidator would be buying high on the market to receive a smaller amount of TWAP-priced assets of the violator plus liquidation bonus. 73 | 74 | Hence, when the TWAP - Market Price spread become significantly large due to the TWAP lag, a liquidation may be uneconomical. 75 | 76 | Alternatively, a TWAP that's too short means it becomes a lot cheaper to manipulate asset prices. For example, one could artificially pump a collateral asset's price to be able to borrow a disproportionate amount of XYZ tokens and run away with them. 77 | 78 | Check out this paper written by Michael Bentley on cost of attacking TWAP pricing: [https://github.com/euler-xyz/uni-v3-twap-manipulation/blob/master/cost-of-attack.pdf](https://github.com/euler-xyz/uni-v3-twap-manipulation/blob/master/cost-of-attack.pdf) 79 | 80 | Additionally, have a look at this blog post by Seraphim on possible attacks involving oracle manipulation and how Euler is preventing them: [https://blog.euler.finance/risks-in-crypto-a-lending-protocol-perspective-376e19c1d01a](https://blog.euler.finance/risks-in-crypto-a-lending-protocol-perspective-376e19c1d01a) 81 | 82 | ### Uniswap Observation Cardinality 83 | 84 | The **minimum uniswap3 cardinality is 10**. When a market is activated, the cardinality of the uniswap3 pool that will be used for pricing is increased to this value, if it is currently below it. 85 | 86 | In order to maintain the TWAP, each Uniswap3 pool needs to keep a historical record of accumulated prices at previous points in time. Each record is called an observation, and their number is called the observation cardinality. Unfortunately, reserving the storage for these records costs gas. 87 | 88 | The larger the cardinality, the longer the possible TWAP window. If a swap is executed every block, the longest TWAP that is possible is the cardinality times the average block time over the last N blocks. 89 | 90 | On Euler, if it is not possible to retrieve a TWAP of the configured length, then the oldest available price is used instead. This means that the protocol can always be interacted with, and prevents some types of attacks that aim to prevent liquidation. However, it also means that the cardinality is an important security parameter for a pool. 91 | 92 | This low minimum value ensures that activating a market is not too expensive. However, since a larger cardinality is required to ensure a longer TWAP window, in order for an asset to be promoted to a higher tier, a larger value cardinality will be required, typically 144 or higher. 93 | 94 | ## Liquidation Parameters 95 | 96 | ### Target Health Factor 97 | 98 | The **default target health factor is 1.25**. 99 | 100 | When a user is in violation due to his risk-adjusted liabilities exceeding his risk-adjusted collateral, his health factor dips below 1. However, should a liquidator come in, he may only take enough debt and assets from the violator to shift his health factor to 1.25. 101 | 102 | This is feature is called soft liquidating [as described in the whitepaper](https://docs.euler.finance/getting-started/white-paper#soft-liquidations), and it creates a much better borrowing experience than on other protocols where 50% of your debt is liquidated. 103 | 104 | Nevertheless, had we set the target health factor to 1.00, we would have run into the risk of making liquidations uneconomic. Namely, the size of debt being repaid, and the consequent reward may be too small to incentivise a liquidator. 105 | 106 | Similarly, in a volatile market, being restored to 1.00 means a user may quickly dip below 1.00 again and again, which implied higher gas fees for liquidators and ever-decreasing rewards. 107 | 108 | We think 1.25 is a good trade-off between a good borrowing experience and well-incentivised liquidations. 109 | 110 | ### Maximum Liquidation Discount 111 | 112 | The **default maximum liquidation discount is set at 20%.** 113 | 114 | When a user is subject to liquidation, some of his debt (dTokens) and assets (eTokens) are transferred to the liquidator, which leads to the health score shifting to 1.25. 115 | 116 | However, to incentivise the liquidator to do this work, he receives the eTokens at a discount. Another way of thinking about the discount is receiving a bonus on top of the asset value. 117 | 118 | Let's imagine a simple example without liquidation surcharges and boosters (explained in this page below): assume a user's health factor is 0.90. This implies a liquidation discount of 10% (1 - 0.90). Hence, for taking on $100 worth of dTokens, a liquidator receives $110 worth of eTokens. 119 | 120 | If the discount is too low, a liquidator may be discouraged from conducting the liquidation. Alternatively, a discount that's too high means borrowers are giving away too much of their assets to liquidators. This also creates a risk of never going back to 1.25 health score, as every liquidation decreases the amount of assets a user has. 121 | 122 | Hence, a liquidation discount has an upper ceiling of 20% to improve the borrowers' experience. 123 | 124 | ### Liquidation Surcharge 125 | 126 | The **default liquidation surcharge is set at 2%.** 127 | 128 | Whenever a liquidator takes on someone's debt, they need to repay 2% more than originally taken from the violator. To compensate him for that, the violator pays the liquidator an additional 2% of his lent assets. 129 | 130 | This is intended to do two things: 131 | 132 | 1. The surcharge accumulates in the reserve pool, and hence every liquidation makes the pool healthier. The more volatile an asset, the more often liquidations occur, and the bigger the pool is. 133 | 2. Discourage malicious self-liquidation strategies. Due to the surcharge, every self-liquidation ends up being net negative. 134 | 135 | ### Liquidation Booster Ceiling and Slope 136 | 137 | The **default liquidation booster is ceiling and slope are set at 2.5% and 2x respectively.** 138 | 139 | To incentivise liquidators to lend, they may be more competitive than their peers should they lend through Euler. 140 | 141 | For example, if a user's health score is at 0.90 and value of risk-adjusted debt is $1,000, the implied liquidation discount is 10% (1 - Health Score). However, due to slippage and gas fees, liquidators are only profitable at an 11% discount. 142 | 143 | At the same time, a liquidator that supplied $1,000 risk-adjusted collateral can be 2x more competitive than the rest of the market with a ceiling of 2.5%. Should he take on the user's debt at a 10% discount, he will actually receive a more generous 12.5% discount (2.5% booster + 10% liquidation discount). 144 | 145 | How did we arrive at that number? The **total liquidation discount** is calculated the following way: 146 | 147 | $$ 148 | TotalLiqDiscount = (1-HealthFactor)*LiqBooster + LiqSurcharge 149 | $$ 150 | 151 | $$ 152 | LiqBooster = 1 + 2 * \frac{min(RADV, RASAL)}{RADV} 153 | $$ 154 | 155 | RASAL = Risk-adjusted supplied assets by the liquidator 156 | 157 | RADV = Risk-adjusted debt by the violator 158 | 159 | _LiqSurcharge is explained above in this page and in this example is assumed to be 0 for simplicity's sake._ 160 | 161 | **2x is the liquidation booster slope**. 162 | 163 | **The Liquidation Booster is subject to a 2.5% ceiling.** 164 | 165 | The reasoning behind setting the ceiling at 2.5% is the same as the 20% maximum liquidation discount: preventing the borrowers from overpaying when being liquidated. The 2x slope, on the other hand, is intended to make the liquidators gradually more competitive the more assets they deposit, but not outrageously more competitive to avoid the creation of monopolies. 166 | -------------------------------------------------------------------------------- /euler-protocol/eulers-default-parameters/list-of-assets.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Find information about interest rates and their parameters on Euler 3 | --- 4 | 5 | # Interest Rates 6 | 7 | ## Introduction 8 | 9 | While we eventually plan to move to a reactive interest rate model that will optimise for utilisation, we start off with a standard kink model. The parameters of our kink model are: 10 | 11 | 1. Base IR (APY when utilisation is 0%) 12 | 2. Kink IR (APY when utilisation is exactly Kink%) 13 | 3. Max IR (APY when utilisation is 100%) 14 | 4. Kink% (Percent utilisation where kink occurs) 15 | 16 | The main consideration is maintaining target utilisation (typically at Kink%). 17 | 18 | 19 | 20 | | Asset | Base IR % | Kink IR % | Max IR % | Kink % | 21 | |-------|------|-------|-------|-------| 22 | | 1INCH | 0.00| 20.00 | 300.00 | 80.00 | 23 | | AAVE | 0.00| 20.00 | 300.00 | 80.00 | 24 | | AGEUR | 0.00| 4.00 | 100.00 | 80.00 | 25 | | ALCX | 0.00| 10.00 | 300.00 | 50.00 | 26 | | ANT | 0.00| 10.00 | 300.00 | 50.00 | 27 | | APE | 0.00| 10.00 | 300.00 | 50.00 | 28 | | AURA| 0.00| 10.00 | 300.00 | 50.00 | 29 | | AXS | 0.00| 20.00 | 300.00 | 80.00 | 30 | | BABL | 0.00| 10.00 | 300.00 | 50.00 | 31 | | BADGER | 0.00| 10.00 | 300.00 | 50.00 | 32 | | BAL | 0.00| 20.00 | 300.00 | 80.00 | 33 | | BANK | 0.00| 10.00 | 300.00 | 50.00 | 34 | | BaoUSD | 0.00| 10.00 | 300.00 | 50.00 | 35 | | BED | 0.00| 10.00 | 300.00 | 50.00 | 36 | | BRIGHT | 0.00| 10.00 | 300.00 | 50.00 | 37 | | BUSD | 0.00| 20.00 | 300.00 | 80.00 | 38 | | CADC | 0.00| 10.00 | 300.00 | 50.00 | 39 | | CARD | 0.00| 10.00 | 300.00 | 50.00 | 40 | | cbETH | 0.00| 8.00 | 200.00 | 80.00 | 41 | | cETH| 0.00| 10.00 | 300.00 | 50.00 | 42 | | CNV | 0.00| 10.00 | 300.00 | 50.00 | 43 | | COMP | 0.00| 20.00 | 300.00 | 80.00 | 44 | | CRV | 0.00| 20.00 | 300.00 | 80.00 | 45 | | CTX | 0.00| 10.00 | 300.00 | 50.00 | 46 | | CVX | 0.00| 20.00 | 300.00 | 80.00 | 47 | | CVXCRV | 0.00| 10.00 | 300.00 | 50.00 | 48 | | DAI | 0.00| 4.00 | 100.00 | 80.00 | 49 | | DFI | 0.00| 10.00 | 300.00 | 50.00 | 50 | | DFX | 0.00| 10.00 | 300.00 | 50.00 | 51 | | DPI | 0.00| 10.00 | 300.00 | 50.00 | 52 | | DPX | 0.00| 10.00 | 300.00 | 50.00 | 53 | | DYDX | 0.00| 10.00 | 300.00 | 50.00 | 54 | | ENJ | 0.00| 10.00 | 300.00 | 50.00 | 55 | | ENS | 0.00| 20.00 | 300.00 | 80.00 | 56 | | ETH2X-FLI | 0.00| 10.00 | 300.00 | 50.00 | 57 | | EUL| 0.00| 10.00 | 300.00 | 50.00 | 58 | | EXRD | 0.00| 10.00 | 300.00 | 50.00 | 59 | | FIAT | 0.00| 10.00 | 300.00 | 50.00 | 60 | | FLOAT | 0.00| 10.00 | 300.00 | 50.00 | 61 | | FLX | 0.00| 10.00 | 300.00 | 50.00 | 62 | | FNT | 0.00| 10.00 | 300.00 | 50.00 | 63 | | FPIS | 0.00| 10.00 | 300.00 | 50.00 | 64 | | FRAX | 0.00| 20.00 | 300.00 | 80.00 | 65 | | FTT | 0.00| 10.00 | 300.00 | 50.00 | 66 | | FXS | 0.00| 10.00 | 300.00 | 50.00 | 67 | | GAMMA | 0.00| 10.00 | 300.00 | 50.00 | 68 | | GFI | 0.00| 10.00 | 300.00 | 50.00 | 69 | | GOHM | 0.00| 10.00 | 300.00 | 50.00 | 70 | | GRT | 0.00| 10.00 | 300.00 | 50.00 | 71 | | GTC | 0.00| 10.00 | 300.00 | 50.00 | 72 | | GUSD | 0.00| 10.00 | 300.00 | 50.00 | 73 | | HMT | 0.00| 10.00 | 300.00 | 50.00 | 74 | | HOP | 0.00| 10.00 | 300.00 | 50.00 | 75 | | IDLE | 0.00| 10.00 | 300.00 | 50.00 | 76 | | ILV | 0.00| 10.00 | 300.00 | 50.00 | 77 | | IMX | 0.00| 10.00 | 300.00 | 50.00 | 78 | | INDEX | 0.00| 10.00 | 300.00 | 50.00 | 79 | | IPT | 0.00| 10.00 | 300.00 | 50.00 | 80 | | KP3R | 0.00| 10.00 | 300.00 | 50.00 | 81 | | LDO | 0.00| 20.00 | 300.00 | 80.00 | 82 | | LINK | 0.00| 20.00 | 300.00 | 80.00 | 83 | | LOOKS | 0.00| 10.00 | 300.00 | 50.00 | 84 | | LQTY | 0.00| 10.00 | 300.00 | 50.00 | 85 | | LRC | 0.00| 10.00 | 300.00 | 50.00 | 86 | | LUSD | 0.00| 4.00 | 100.00 | 80.00 | 87 | | LYXE | 0.00| 10.00 | 300.00 | 50.00 | 88 | | MATIC | 0.00| 20.00 | 300.00 | 80.00 | 89 | | MILADY | 0.00| 10.00 | 300.00 | 50.00 | 90 | | MIM | 0.00| 20.00 | 300.00 | 80.00 | 91 | | MKR | 0.00| 20.00 | 300.00 | 80.00 | 92 | | MPL | 0.00| 10.00 | 300.00 | 50.00 | 93 | | MTA | 0.00| 10.00 | 300.00 | 50.00 | 94 | | MVI | 0.00| 10.00 | 300.00 | 50.00 | 95 | | NEXO | 0.00| 10.00 | 300.00 | 50.00 | 96 | | NMR | 0.00| 10.00 | 300.00 | 50.00 | 97 | | OGN | 0.00| 10.00 | 300.00 | 50.00 | 98 | | OHM | 5.00| 20.00 | 300.00 | 80.00 | 99 | | OS | 0.00| 10.00 | 300.00 | 50.00 | 100 | | OSQTH | 0.00| 20.00 | 300.00 | 80.00 | 101 | | PERP | 0.00| 20.00 | 300.00 | 80.00 | 102 | | PUNK | 0.00| 10.00 | 300.00 | 50.00 | 103 | | QNT | 0.00| 10.00 | 300.00 | 50.00 | 104 | | QSP | 0.00| 10.00 | 300.00 | 50.00 | 105 | | RAD | 0.00| 10.00 | 300.00 | 50.00 | 106 | | RAI | 0.00| 20.00 | 300.00 | 80.00 | 107 | | RBN | 0.00| 20.00 | 300.00 | 80.00 | 108 | | RENDOGE | 0.00| 10.00 | 300.00 | 50.00 | 109 | | REQ | 0.00| 10.00 | 300.00 | 50.00 | 110 | | RETH | 0.00| 10.00 | 300.00 | 50.00 | 111 | | RLC | 0.00| 10.00 | 300.00 | 50.00 | 112 | | RNDR | 0.00| 10.00 | 300.00 | 50.00 | 113 | | RPL | 0.00| 10.00 | 300.00 | 50.00 | 114 | | SDL | 0.00| 10.00 | 300.00 | 50.00 | 115 | | SETH2 | 0.00| 10.00 | 300.00 | 50.00 | 116 | | SHIB | 0.00| 20.00 | 300.00 | 80.00 | 117 | | SLP | 0.00| 10.00 | 300.00 | 50.00 | 118 | | SNX | 0.00| 20.00 | 300.00 | 80.00 | 119 | | SOCKS | 0.00| 10.00 | 300.00 | 50.00 | 120 | | SOS | 0.00| 10.00 | 300.00 | 50.00 | 121 | | SSV | 0.00| 10.00 | 300.00 | 50.00 | 122 | | stETH | * | 4.00 | 100.00 | 80.00 | 123 | | STG | 0.00| 10.00 | 300.00 | 50.00 | 124 | | SUSD | 0.00| 10.00 | 300.00 | 50.00 | 125 | | SWISE | 0.00| 10.00 | 300.00 | 50.00 | 126 | | TCR | 0.00| 10.00 | 300.00 | 50.00 | 127 | | TON | 0.00| 10.00 | 300.00 | 50.00 | 128 | | TONCOIN| 0.00| 10.00 | 300.00 | 50.00 | 129 | | TORN | 0.00| 10.00 | 300.00 | 50.00 | 130 | | TRDL | 0.00| 10.00 | 300.00 | 50.00 | 131 | | TRYB | 0.00| 10.00 | 300.00 | 50.00 | 132 | | TSUKA| 0.00| 10.00 | 300.00 | 50.00 | 133 | | UBI | 0.00| 10.00 | 300.00 | 50.00 | 134 | | UNI | 0.00| 20.00 | 300.00 | 80.00 | 135 | | USDC | 0.00| 4.00 | 100.00 | 80.00 | 136 | | USDT | 0.00| 7.00 | 200.00 | 80.00 | 137 | | VEGA | 0.00| 10.00 | 300.00 | 50.00 | 138 | | WAMPL | 0.00| 10.00 | 300.00 | 50.00 | 139 | | WBTC | 0.00| 8.00 | 200.00 | 80.00 | 140 | | WETH | 0.00| 4.00 | 100.00 | 80.00 | 141 | | WILD | 0.00| 10.00 | 300.00 | 50.00 | 142 | | WNXM | 0.00| 10.00 | 300.00 | 50.00 | 143 | | WOO | 0.00| 10.00 | 300.00 | 50.00 | 144 | | WSTETH | 0.00| 8.00 | 200.00 | 80.00 | 145 | | XCN | 0.00| 10.00 | 300.00 | 50.00 | 146 | | XMON | 0.00| 10.00 | 300.00 | 50.00 | 147 | | YFI | 0.00| 20.00 | 300.00 | 80.00 | 148 | | YVBOOST | 0.00| 10.00 | 300.00 | 50.00 | 149 | 150 | **stETH (current Lido staking APY)* 151 | -------------------------------------------------------------------------------- /euler-protocol/eulers-default-parameters/risk-factors-list.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Find information about the risk factors for each asset on Euler 3 | --- 4 | 5 | # Risk Factors 6 | 7 | ## Introduction 8 | 9 | This page outlines the main risk parameters on Euler, as determined by [governance](broken-reference). All parameters are displayed in Table 1 below. 10 | 11 | **Table 1** | Collateral, borrow, and reserve factor parameter settings on Euler\_.\_ 12 | 13 | | Token | collateralFactor | borrowFactor | reserveFactor | borrowIsolated | crossBorrow | InterestRateModel | Uniswap V3 fee tier (%) | 14 | |-------|------|-------|-------|------|-------|-------|------| 15 | | RAD | 0| 0.28 | 0 | true | false | Default | 0.3 | 16 | | USDT | 0.9| 0.94 | 0.05 | false | true | USDT | Chainlink | 17 | | WSTETH | 0.85| 0.89 | 0.1 | false | true | Mega | Chainlink | 18 | | STETH | 0.87| 0.91 | 0.1 | false | true | Lido | Chainlink | 19 | | LUSD | 0| 0.7 | 0.15 | false | true | Stable | Chainlink | 20 | | FLX | 0| 2.5e-10 | 0.23 | true | false | Default | 0.3 | 21 | | ALCX | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 22 | | ANT | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 23 | | APE | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 24 | | BABL | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 25 | | BADGER | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 26 | | BANK | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 27 | | BED | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 28 | | BRIGHT | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 29 | | CARD | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 30 | | CNV | 0| 0.28 | 0.23 | true | false | Default | 1 | 31 | | CTX | 0| 0.28 | 0.23 | true | false | Default | 1 | 32 | | CVXCRV | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 33 | | DFI | 0| 0.28 | 0.23 | true | false | Default | 1 | 34 | | DPI | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 35 | | DPX | 0| 0.28 | 0.23 | true | false | Default | 1 | 36 | | DYDX | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 37 | | ENJ | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 38 | | ETH2X-FLI | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 39 | | EXRD | 0| 0.28 | 0.23 | true | false | Default | 1 | 40 | | FLOAT | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 41 | | FNT | 0| 0.28 | 0.23 | true | false | Default | 1 | 42 | | FPIS | 0| 0.28 | 0.23 | true | false | Default | 1 | 43 | | FTT | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 44 | | FXS | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 45 | | GAMMA | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 46 | | GFI | 0| 0.28 | 0.23 | true | false | Default | 1 | 47 | | GOHM | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 48 | | GRT | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 49 | | GTC | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 50 | | GUSD | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 51 | | IDLE | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 52 | | ILV | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 53 | | IMX | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 54 | | INDEX | 0| 0.28 | 0.23 | true | false | Default | 1 | 55 | | KP3R | 0| 0.28 | 0.23 | true | false | Default | 1 | 56 | | LOOKS | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 57 | | LQTY | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 58 | | LRC | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 59 | | LYXE | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 60 | | MPL | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 61 | | MTA | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 62 | | MVI | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 63 | | NEXO | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 64 | | NMR | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 65 | | OGN | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 66 | | OS | 0| 0.28 | 0.23 | true | false | Default | 1 | 67 | | QNT | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 68 | | QSP | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 69 | | RENDOGE | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 70 | | REQ | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 71 | | RETH | 0| 0.28 | 0.23 | true | false | Default | 0.05 | 72 | | RLC | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 73 | | RNDR | 0| 0.28 | 0.23 | true | false | Default | 1 | 74 | | RPL | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 75 | | SETH2 | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 76 | | SLP | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 77 | | SOCKS | 0| 0.28 | 0.23 | true | false | Default | 1 | 78 | | SOS | 0| 0.28 | 0.23 | true | false | Default | 1 | 79 | | SSV | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 80 | | STG | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 81 | | SUSD | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 82 | | TCR | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 83 | | TON | 0| 0.28 | 0.23 | true | false | Default | 1 | 84 | | TORN | 0| 0.28 | 0.23 | true | false | Default | 1 | 85 | | TRDL | 0| 0.28 | 0.23 | true | false | Default | 1 | 86 | | TRYB | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 87 | | UBI | 0| 0.28 | 0.23 | true | false | Default | 1 | 88 | | VEGA | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 89 | | WAMPL | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 90 | | WILD | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 91 | | WNXM | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 92 | | WOO | 0| 0.28 | 0.23 | true | false | Default | 0.3 | 93 | | XCN | 0| 0.28 | 0.23 | true | false | Default | Chainlink | 94 | | XMON | 0| 0.28 | 0.23 | true | false | Default | 1 | 95 | | YVBOOST | 0| 0.28 | 0.23 | true | false | Default | 1 | 96 | | AGEUR | 0| 0.5 | 0.23 | false | true | Stable | 0.05 | 97 | | CVX | 0| 0.5 | 0.23 | false | true | Major | Chainlink | 98 | | OHM | 0| 0.5 | 0.23 | true | false | OHM | Chainlink | 99 | | PERP | 0| 0.5 | 0.23 | false | true | Major | Chainlink | 100 | | RBN | 0| 0.5 | 0.23 | false | true | Major | 1 | 101 | | SHIB | 0| 0.5 | 0.23 | false | true | Major | Chainlink | 102 | | OSQTH | 0| 0.56 | 0.23 | false | true | Major | 0.3 | 103 | | AXS | 0| 0.66 | 0.23 | false | true | Major | Chainlink | 104 | | ENS | 0| 0.66 | 0.23 | false | true | Major | Chainlink | 105 | | MATIC | 0| 0.66 | 0.23 | false | true | Major | Chainlink | 106 | | MKR | 0| 0.66 | 0.23 | false | true | Major | Chainlink | 107 | | 1INCH | 0| 0.7 | 0.23 | true | false | Major | Chainlink | 108 | | AAVE | 0| 0.7 | 0.23 | true | false | Major | Chainlink | 109 | | BAL | 0| 0.7 | 0.23 | true | false | Major | Chainlink | 110 | | BUSD | 0| 0.7 | 0.23 | true | false | Major | Chainlink | 111 | | COMP | 0| 0.7 | 0.23 | true | false | Major | Chainlink | 112 | | CRV | 0| 0.7 | 0.23 | true | false | Major | Chainlink | 113 | | FRAX | 0| 0.7 | 0.23 | true | false | Major | Chainlink | 114 | | LDO | 0| 0.7 | 0.23 | true | false | Major | Chainlink | 115 | | MIM | 0| 0.7 | 0.23 | true | false | Major | Chainlink | 116 | | RAI | 0| 0.7 | 0.23 | true | false | Major | Chainlink | 117 | | SNX | 0| 0.7 | 0.23 | true | false | Major | Chainlink | 118 | | YFI | 0| 0.7 | 0.23 | true | false | Major | Chainlink | 119 | | LINK | 0| 0.76 | 0.23 | false | true | Major | Chainlink | 120 | | UNI | 0| 0.76 | 0.23 | false | true | Major | Chainlink | 121 | | DAI | 0.85| 0.88 | 0.23 | false | true | Stable | Chainlink | 122 | | WBTC | 0.88| 0.91 | 0.23 | false | true | Mega | Chainlink | 123 | | WETH | 0.88| 0.91 | 0.23 | false | true | Default | Pegged | 124 | | USDC | 0.9| 0.94 | 0.23 | false | true | Stable | Chainlink | 125 | 126 | 127 | _Note: the Collateral Factor of the lent asset(s) is multiplied by the Borrow Factor of the borrowed asset(s) to arrive at the final factor._ 128 | 129 | _For example, if you lend 1,000 USD worth of USDC, you can borrow UNI in line with a final factor of 0.648 (0.90 x 0.72). Hence, 648 USD worth of UNI._ 130 | 131 | _Alternatively, if you lend 500 USD worth of USDC and 500 USD worth of WETH, your risk-adjusted collateral value is (500 x 0.90) + (500 x 0.88) = 890 USD. If you were to borrow UNI, you could borrow 890 x 0.72 = 640.8 USD worth of UNI._ 132 | 133 | _Note that if you borrowed less UNI, for example 500 USD worth, you could still borrow additional UNI or a cross tier asset like LINK against your risk-adjusted collateral before hitting the threshold._ 134 | 135 | _Lastly, please note that the risk factors list will be periodically updated. If a token/market is activated on the DApp but not listed, please check back later for an updated list._ 136 | -------------------------------------------------------------------------------- /euler-protocol/getting-started/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | -------------------------------------------------------------------------------- /euler-protocol/getting-started/methodology/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn more about how risk parameters on Euler are determined 3 | --- 4 | 5 | # Methodology 6 | 7 | ## I**ntroduction** 8 | 9 | The Euler risk framework aims to do two things: 10 | 11 | 1. **Maximise** capital efficiency through borrowing and lending **activity**; and 12 | 2. **Minimise** risk and the probability of **bad debts.** 13 | 14 | To achieve this, a methodology to stress test individual assets as well as simulate a portfolio of assets in tail risk scenarios. 15 | 16 | ## Methodology 17 | 18 | **Ranking** all available ERC20 tokens according to risk parameters: 19 | 20 | 1. Smart Contract Risk 21 | 2. Centralisation 22 | 3. Volatility 23 | 4. Liquidity 24 | 25 | Additionally, assessing **Oracle Risk** 26 | 27 | In order to **arrive** at: 28 | 29 | 1. **Collateral** Factor 30 | 2. **Borrow** Factor 31 | 3. **Cross Tier** Factor 32 | 33 | **Simulate** risk scenarios to maximise borrowing and lending activity and minimise bad debts 34 | 35 | **Update** factors and methodology through governance 36 | -------------------------------------------------------------------------------- /euler-protocol/getting-started/methodology/collateral-and-borrow-factors.md: -------------------------------------------------------------------------------- 1 | # Collateral and Borrow Factor Methodology 2 | 3 | On Euler, we use a two-sided approach to estimate risks of borrowing any tokens versus any given collateral. These risks are encapsulated in asset-specific collateral factors (as on Compound) and borrow factors (an Euler innovation). 4 | 5 | Consequently, collateral factor reflects the risk of the asset that’s being used as collateral, whilst borrow factors reflect risks of the asset that’s being borrowed. 6 | 7 | ### **Collateral Assets** 8 | 9 | When it comes to quality of collateral, it is of paramount importance that it ranks very high in our index list. 10 | 11 | An illiquid collateral asset can be exploited by causing a price surge to allow a malicious user to borrow an inflated amount of tokens without an incentive to return them. 12 | 13 | Alternatively, a collateral asset that’s collapsing in price and is experiencing high slippage makes it uneconomical for liquidators to close positions, leading to bad debts. This scenario is more systemic, which is why only the highest quality assets can become eligible collaterals. 14 | 15 | ### **Borrowed Assets** 16 | 17 | While borrowed assets are less systemic than collateral assets, they also have specific risks. 18 | 19 | For example, a borrowed token price that triples in a matter of seconds versus its collateral means there’s no incentive for the borrower to return the token, which results in bad debt. This is why the borrow factor should reflect the volatility and liquidity of the asset. 20 | 21 | Alternatively, crashing a borrowed asset's price allows a malicious actor to borrow more tokens than normally possible. This attack can happen if there's not enough liquidity overall, especially if liquidity is too concentrated around a tiny range. 22 | -------------------------------------------------------------------------------- /euler-protocol/getting-started/methodology/oracle-rating.md: -------------------------------------------------------------------------------- 1 | # Oracle Rating 2 | 3 | ## **What is an oracle?** 4 | 5 | Within the context of pricing, an oracle is an on-chain API for price. Differently put, it simply tells you what the price of an asset is at a given time. 6 | 7 | ## Oracle Risk 8 | 9 | While we think Uniswap's oracles are best suited for our permissionless lending protocol, depositing into an Euler pool backed by illiquid liquidity pools on Uniswap can lead to devastating results. 10 | 11 | For instance, inflating the value of a collateral allows the attacker to borrow an inflated amount of tokens, leading to bad debt. This is the most systemic and widespread attack on lending protocols. 12 | 13 | Alternatively, if the Uniswap V3 oracle of the borrowed asset is manipulated to the upside, the attack could trigger liquidations and sweep borrowers' collateral. 14 | 15 | Even more of concern is when the attacker can manipulate the asset pricing to the downside. Hypothetically, if the price drops to almost zero, the attacker only needs a small amount of collateral to borrow the entire pool and run away with a hefty profit. 16 | 17 | ## Euler’s Oracle Risk Grading System 18 | 19 | In order to assess an oracle's safety, our team have developed a tool to calculate the cost of moving a given Uniswap v3 TWAP: [oracle.euler.finance](https://oracle.euler.finance/). 20 | 21 | Using the tool, we can calculate the cost of moving the TWAP by 20.89% (minimum required to break even on highest-quality assets) up and down over 1 and 2 blocks: 22 | 23 | ![](../../../.gitbook/assets/uniweth.JPG) 24 | 25 | Then, we take the minimum of these 4 values: $469.63 million and assign a rating to it according to this table: 26 | 27 | ![](<../../../.gitbook/assets/image (4) (1).png>) 28 | 29 | Consequently, UNI/WETH pool safety is deemed **high** as the minimum cost of attack up and down over 1-2 blocks is > $50 million. 30 | 31 | This is displayed on the front-end page of the respective lending pool: 32 | 33 | ![](<../../../.gitbook/assets/usdc rating2.png>) 34 | 35 | _**Keep in mind that this is merely an indicative tool and we bear no responsibility for loss of funds.**_ 36 | 37 | ## **How to Improve the Oracle Rating?** 38 | 39 | If you are a project that wants to improve its token's oracle rating and be eligible for higher borrow and collateral factors, it's crucial to _**provide full-range liquidity to the XYZ/WETH pair on Uniswap V3.**_ 40 | 41 | By **full-range liquidity** we mean providing liquidity **from the lowest tick all the way to the highest tick** without any gaps in between. 42 | 43 | A good example is [METIS/WETH](https://info.uniswap.org/#/pools/0x1c98562a2fab5af19d8fb3291a36ac3c618835d9): 44 | 45 | ![](<../../../.gitbook/assets/image (3) (1).png>) 46 | 47 | A suboptimal scenario is [HEGIC/WETH](https://info.uniswap.org/#/pools/0xf2c3bd0328bdb6106d34a3bd0df0ef744551cc82), where liquidity is uber-concentrated: 48 | 49 | ![](<../../../.gitbook/assets/image (2).png>) 50 | 51 | Check out this [video ](https://www.youtube.com/watch?v=snwUwj3QQ7M\&t=1s\&ab\_channel=EulerFinance)going through different manipulation scenarios for a more in-depth explanation: 52 | 53 | It's important to note **that even a small amount of fully-spread liquidity can significantly increase the cost of attack**. For eg, the[ IDLE/WETH](https://info.uniswap.org/#/pools/0x79e42a2bb91a0f9118e2b5231958c1eaefce390c) pool has a mere $52k TVL, yet the minimum cost of attack is a whopping $115 million: 54 | 55 | ![T](<../../../.gitbook/assets/image (4).png>) 56 | 57 | ## References 58 | 59 | Check out this blog post written by Darek explaining the oracle tool: [https://blog.euler.finance/uniswap-oracle-attack-simulator-42d18adf65af](https://blog.euler.finance/uniswap-oracle-attack-simulator-42d18adf65af) 60 | 61 | Check out Michael's paper on how even a small amount of full-range liquidity can make an attack incredibly costly: [https://github.com/euler-xyz/uni-v3-twap-manipulation/blob/master/cost-of-attack.pdf](https://github.com/euler-xyz/uni-v3-twap-manipulation/blob/master/cost-of-attack.pdf) 62 | -------------------------------------------------------------------------------- /euler-protocol/getting-started/methodology/ranking-assets.md: -------------------------------------------------------------------------------- 1 | # Ranking Assets 2 | 3 | ## **Scale** 4 | 5 | Each risk parameter goes from 0 (highest risk) to 1 (lowest risk). The combination of risk parameters results in a comprehensive index for a given digital asset, which also goes from 0 to 1. 6 | 7 | ## **Risk Parameters** 8 | 9 | ### **Smart Contract Risk** 10 | 11 | Smart contract risk parameter can either be 0, 0.5 or 1. 12 | 13 | It is arguably the biggest tail risk, as a badly written smart contract can result in hacks and stolen money, leading to catastrophic collapse in price. 14 | 15 | We assess this by checking **whether the protocol was audited**, the **number of days the protocol has been functioning without hacks** and deeper research if needed (for promoting up the tiers). 16 | 17 | ### **Centralisation** 18 | 19 | Centralisation parameter can go from 0 to 1. 20 | 21 | It measures whether a small number of holders have undue influence over the token. For example, a founder with 70% ownership of the tokenomics pie and flexible vesting period can oversupply the market with tokens, leading to an abrupt sell-off. Alternatively, a whale holding a large chunk of tokens can easily pass deleterious changes through governance. 22 | 23 | This risk can be measured by estimating the **median size of token amount per holder**. When the ownership structure isn’t transparent, we will employ forensic due diligence. 24 | 25 | ### **Volatility** 26 | 27 | Volatility parameter can go from 0 to 1. 28 | 29 | All other things equal, an asset with 100% realised volatility is more likely to cause a liquidation than an asset with a 10% realised volatility. Hence, less volatile assets should have more favourable borrowing and collateral factors. 30 | 31 | This parameter can be measured via **realised** (and implied, if available) **volatility**, with emphasis on downside risk for collaterals and upside risk for borrowed assets. 32 | 33 | ### **Liquidity** 34 | 35 | Liquidity parameter can go from 0 to 1. 36 | 37 | An asset with 100 mil USD daily turnover is easier to buy and sell versus an asset with only 1 mil USD turnover, all other things being equal. 38 | 39 | This is particularly important for liquidators that receive collateral assets at discount for repaying borrowed tokens, as they typically immediately sell that collateral. If they’re unable to sell that collateral and/or buy the borrowed asset at a decent price given a liquidator discount, then they do not have the incentive to liquidate. This leads to bad debts, which we need to minimise. 40 | 41 | Measuring liquidity can be done by **estimating historical slippage** caused by a certain amount of volume. 42 | 43 | It's important to note that we are estimating the liquidity **vs ETH on Uniswap v3**, as an existing ETH market on Uniswap v3 is a prerequisite to being activated on Euler and our oracles are based on Uniswap v3 TWAPs. 44 | 45 | This means that even if a token has very high liquidity on Uniswap v2, it wouldn't necessarily have a high borrow factor if liquidity is low on Uniswap v3. 46 | -------------------------------------------------------------------------------- /euler-protocol/getting-started/methodology/tiers.md: -------------------------------------------------------------------------------- 1 | # Tier Methodology 2 | 3 | Euler assets fall into three different tiers: isolated, cross and collateral tiers. 4 | 5 | ### **Isolated Tier** 6 | 7 | **Isolated tier** assets are available for ordinary lending and borrowing, but they cannot be used as collateral to borrow other assets, and they can only be borrowed in isolation. What this means is that they cannot be borrowed alongside other assets using the same pool of collateral. For example, if a user has USDC and DAI as collateral, and they want to borrow isolation-tier asset ABC, then they can only borrow ABC. If they later want to borrow another token, XYZ, then they can only do so using a separate account on Euler. 8 | 9 | Governance allows to promote assets to cross and collateral tiers, but also to alter borrow factors. However, there will be a default borrow factor for all assets listed in the isolated tier. 10 | 11 | ### **Cross Tier** 12 | 13 | **Cross tier** assets are available for ordinary lending and borrowing, and cannot be used as collateral to borrow other assets, but they can be borrowed alongside other assets. For example, if a user has USDC and DAI as collateral, and they want to borrow cross-tier assets ABC and XYZ, then they can do so from a single account on Euler. 14 | 15 | ### Collateral Tier 16 | 17 | **Collateral tier** assets are available for ordinary lending and borrowing, cross-borrowing, and they can be used as collateral. For example, a user can deposit collateral assets DAI and USDC, and use them to borrow collateral assets UNI and LINK, all from a single account. \ 18 | -------------------------------------------------------------------------------- /euler-protocol/getting-started/simulation-environment.md: -------------------------------------------------------------------------------- 1 | # Simulation Environment 2 | 3 | To make sure we minimise bad debts whilst maximising activity, we stress-test liquidation scenarios by simulating tail risk events on individual assets as well as on portfolios of assets to estimate bad debt risk. 4 | 5 | ### Example: One asset 6 | 7 | For instance, if our index list shows that a token jumped from 250th to 30th place and was able to maintain that position for a sufficient amount of time, we may simulate activity versus bad debts as a share of total loans given different borrow factors. As a result, we may improve the borrow factor from 0.28 to 0.35. 8 | 9 | ### Example: Portfolio of assets 10 | 11 | Alternatively, we can simulate a more complicated environment with 50 tokens from the lower quartile as borrowed assets backed uniformly by 4 collateral assets (3 of them time-tested and 1 proposed new collateral) in high volatility situations. By simulating tail risk scenarios, we can assess the worst-case scenario for the protocol and decide whether inclusion of the collateral asset is appropriate.\ 12 | -------------------------------------------------------------------------------- /getting-started/introduction.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: A brief introduction to Euler 3 | --- 4 | 5 | # Introduction 6 | 7 | Euler is a non-custodial permissionless lending protocol on Ethereum that helps users to earn interest on their crypto assets or hedge against volatile markets without the need for a trusted third-party. 8 | 9 | Euler protocol features a number of innovations not seen before in DeFi, including permissionless lending markets, reactive interest rates, protected collateral, MEV-resistant liquidations, multi-collateral stability pools, and much more. For more information, read the [White Paper](white-paper.md). 10 | -------------------------------------------------------------------------------- /getting-started/quick-links.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Quick access to everything you need to know about Euler 3 | --- 4 | 5 | # Quick Links 6 | 7 | **Websites**\ 8 | [Website](https://www.euler.finance/#/)\ 9 | [DApp](https://app.euler.finance/) 10 | 11 | **Governance**\ 12 | ****[Forum](https://forum.euler.finance/)\ 13 | [Off-chain (Snapshot)](https://snapshot.org/#/eulerdao.eth)\ 14 | [On-chain (WithTally)](https://www.tally.xyz/governance/eip155:1:0xd8E2114f6bCbaee83CDEB1bD6650a28BBcF144D5) 15 | 16 | **EUL**\ 17 | [Etherscan](https://etherscan.io/token/0xd9fcd98c322942075a5c3860693e9f4f03aae07b)\ 18 | [CoinMarketCap](https://coinmarketcap.com/currencies/euler-finance/)\ 19 | [CoinGecko](https://www.coingecko.com/en/coins/euler)\ 20 | [Messari](https://messari.io/asset/euler/charts) 21 | 22 | **DEX**\ 23 | [Balancer (EUL/WETH)](https://app.balancer.fi/#/pool/0x8fe054748fc5c8ee50ab8860409a4e9e760e13f4000200000000000000000328)\ 24 | [Uniswap v2 (EUL/WETH)](https://v2.info.uniswap.org/pair/0xe96c108da71dbdb2aa1056bc55c3a073061a2fa1)\ 25 | [Uniswap v3 (EUL/WETH)\ 26 | ](https://info.uniswap.org/#/pools/0xb003df4b243f938132e8cadbeb237abc5a889fb4)[Uniswap v3 (EUL/USDC)](https://info.uniswap.org/#/pools/0x175cc167a320623c6e7f23a41f99e5bb696e3f34) 27 | 28 | **Social**\ 29 | [Twitter](https://twitter.com/eulerfinance)\ 30 | [Discord](https://t.co/yqSIrrJfWi?amp=1)\ 31 | [Telegram](https://t.me/eulerfinance\_official)\ 32 | [Telegram Announcements](https://t.me/eulerfinance) 33 | 34 | **Security**\ 35 | [Immunefi Bug Bounty](https://immunefi.com/bounty/euler/)\ 36 | [Report A Bug](mailto:security@euler.xyz) 37 | 38 | **Content**\ 39 | [Blog](https://blog.euler.finance/)\ 40 | [Newsletter](https://newsletter.euler.finance/) 41 | 42 | **Videos**\ 43 | [YouTube](https://www.youtube.com/channel/UCoeP9dvbKoL17nqkNnUJBkg) 44 | 45 | **Dashboards**\ 46 | [Tokenterminal](https://www.tokenterminal.com/terminal/projects/euler)\ 47 | [DefiLlama](https://defillama.com/protocol/euler)\ 48 | [Zerion](https://zerion.io/)\ 49 | [DeBank](https://debank.com/projects/euler)\ 50 | [Ape Board](https://apeboard.finance/)\ 51 | [DeFiYield](https://defiyield.app/dashboard) 52 | 53 | **Dune Analytics**\ 54 | By [ShippooorDAO](https://dune.xyz/shippooordao/Euler-Finance-Dashboard)\ 55 | By [altooptimo.eth](https://dune.com/altooptimo/Euler-Finance) 56 | 57 | **** 58 | -------------------------------------------------------------------------------- /languages/community-translations.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Read the Euler white paper in different languages. 3 | --- 4 | 5 | # Community Translations 6 | 7 | Members from the Euler community have translated the white paper into a number of other languages below. These are not hosted by official channels nor fully verified for word-for-word accuracy, but they may be used as reference to better understand the white paper. 8 | 9 | Community translators' efforts are greatly appreciated! Feel free to submit other translations to the Euler community [Discord](https://discord.com/invite/vyaufngA7n). 10 | 11 | **Korean**: [https://m.blog.naver.com/PostView.naver?blogId=ahrmina\&logNo=222627632140\&proxyReferer=](https://m.blog.naver.com/PostView.naver?blogId=ahrmina\&logNo=222627632140\&proxyReferer=) 12 | 13 | **Japanese**: [https://www.notion.so/Euler-Whitepaper-Japanese-044d74772b3541c58ba9b644c27e6b7c](https://www.notion.so/Euler-Whitepaper-Japanese-044d74772b3541c58ba9b644c27e6b7c) 14 | 15 | **Russian**: [https://gitbook-guru.gitbook.io/euler/white-paper](https://gitbook-guru.gitbook.io/euler/white-paper) 16 | 17 | **Ukrainian**: [https://medium.com/@nina\_b33/white-paper-ed9cfb390c2](https://medium.com/@nina\_b33/white-paper-ed9cfb390c2) 18 | -------------------------------------------------------------------------------- /legal/privacyPolicy.md: -------------------------------------------------------------------------------- 1 | # Privacy 2 | ## Privacy Policy 3 | This Privacy Policy describes the policies of The Euler Foundation, 4 | 4th Floor, Harbour Place, 103 South Church Street, P.O. Box 10240, 5 | Grand Cayman KY1-1002, George Town, Cayman Islands on the 6 | collection, use and disclosure of your information that we collect 7 | when you use our website ([euler.finance](https://www.euler.finance/) or [app.euler.finance](https://app.euler.finance/)) (the “Service”). By accessing or using the Service, you are 8 | consenting to the collection, use and disclosure of your information 9 | in accordance with this Privacy Policy. If you do not consent to the 10 | same, please do not access or use the Service. 11 | 12 | We may modify this Privacy Policy at any time without any prior 13 | notice to you and will post the revised Privacy Policy on the 14 | Service. The revised Policy will be effective 180 days from when the 15 | revised Policy is posted in the Service and your continued access or 16 | use of the Service after such time will constitute your acceptance 17 | of the revised Privacy Policy. We therefore recommend that you 18 | periodically review this page. 19 | 20 | ### How We Use Your Information 21 | 22 | We will use the information that we collect about you for the 23 | following purposes: 24 | 25 | * Marketing/ Promotional 26 | * Customer feedback collection 27 | * Support 28 | 29 | If we want to use your information for any other purpose, we will 30 | ask you for consent and will use your information only on receiving 31 | your consent and then, only for the purpose(s) for which grant 32 | consent unless we are required to do otherwise by law. 33 | 34 | ### How We Share Your Information 35 | 36 | We will not transfer your personal information to any third party 37 | without seeking your consent, except in limited circumstances as 38 | described below: 39 | 40 | * Analytics 41 | * Data collection & process 42 | 43 | We require such third party’s to use the personal information we 44 | transfer to them only for the purpose for which it was transferred 45 | and not to retain it for longer than is required for fulfilling the 46 | said purpose. 47 | 48 | We may also disclose your personal information for the following: 49 | (1) to comply with applicable law, regulation, court order or other 50 | legal process; (2) to enforce your agreements with us, including 51 | this Privacy Policy; or (3) to respond to claims that your use of 52 | the Service violates any third-party rights. If the Service or our 53 | company is merged or acquired with another company, your information 54 | will be one of the assets that is transferred to the new owner. 55 | 56 | ### Your Rights 57 | 58 | Depending on the law that applies, you may have a right to access 59 | and rectify or erase your personal data or receive a copy of your 60 | personal data, restrict or object to the active processing of your 61 | data, ask us to share (port) your personal information to another 62 | entity, withdraw any consent you provided to us to process your 63 | data, a right to lodge a complaint with a statutory authority and 64 | such other rights as may be relevant under applicable laws. To 65 | exercise these rights, you can write to us at [contact@euler.foundation](mailto:contact@euler.foundation). 66 | We will respond to your request in accordance with applicable law. 67 | 68 | You may opt-out of direct marketing communications or the profiling 69 | we carry out for marketing purposes by writing to us at 70 | [contact@euler.foundation(mailto:contact@euler.foundation). 71 | 72 | Do note that if you do not allow us to collect or process the 73 | required personal information or withdraw the consent to process the 74 | same for the required purposes, you may not be able to access or use 75 | the services for which your information was sought. 76 | 77 | ### Cookies 78 | 79 | We do not use cookies. 80 | 81 | ### Security 82 | 83 | The security of your information is important to us and we will use 84 | reasonable security measures to prevent the loss, misuse or 85 | unauthorized alteration of your information under our control. 86 | However, given the inherent risks, we cannot guarantee absolute 87 | security and consequently, we cannot ensure or warrant the security 88 | of any information you transmit to us and you do so at your own 89 | risk. 90 | 91 | ### Grievance 92 | 93 | If you have any queries or concerns about the processing of your 94 | information that is available with us, you may email us at 95 | [contact@euler.foundation](mailto:contact@euler.foundation) 96 | and we will address your concerns in accordance with applicable law. 97 | 98 | *Last updated on: 06-June-2022* 99 | 100 | *Effective date: 06-June-2022* 101 | 102 | -------------------------------------------------------------------------------- /protocol/parameters.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Parameters for each lending market on Euler 3 | --- 4 | 5 | # Parameters 6 | 7 | Coming soon. 8 | 9 | -------------------------------------------------------------------------------- /protocol/tokens.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about the system of tokens used on Euler 3 | --- 4 | 5 | # Tokens 6 | 7 | A variety of token types are used on Euler to give users maximum flexibility in how they manage their positions. The token types are described briefly below. You can find more information about each token type in the white paper [here](tokens.md). 8 | 9 | ## eTokens 10 | 11 | Coming soon. 12 | 13 | ## dTokens 14 | 15 | Coming soon. 16 | 17 | ## pTokens 18 | 19 | Coming soon. 20 | 21 | ## sTokens 22 | 23 | Coming soon. 24 | 25 | ## rTokens 26 | 27 | Coming soon. 28 | 29 | -------------------------------------------------------------------------------- /security/audits.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: View smart contract and UI audits from a number of security partners 3 | --- 4 | 5 | # Audits 6 | 7 | ### Smart Contract Audits 8 | 9 | The Euler protocol has been reviewed and audited by top security firms including: Halborn, Solidified and ZK Labs, Certora and Sherlock. 10 | 11 | #### Omniscia - September 2022 12 | 13 | [Audit Report](https://omniscia.io/reports/euler-finance-swaphub/) 14 | 15 | #### Sherlock - July 2022 16 | 17 | [Audit Report](https://www.hacknote.co/17c261f7d8fWbdml/1821f966f40pJG_t#n_0) 18 | 19 | #### Omniscia - June 2022 20 | 21 | [Audit Report](https://omniscia.io/reports/euler-finance-chainlink-support/) 22 | 23 | #### Omniscia - March 2022 24 | 25 | [Audit Report](https://omniscia.io/euler-merkle-mining-staking/) 26 | 27 | #### Sherlock - December 2021 28 | 29 | **Note**: the EulDistributor contracts audited by Omniscia in the link above were also audited by Trail of Bits in Jun 2022 (see [Audit Report](https://github.com/morphodao/morpho-core-v1/tree/main/audits)) as part of an audit on the Morpho smart contracts. 30 | 31 | #### Sherlock - December 2021 32 | 33 | [Audit Report](https://github.com/euler-xyz/euler-audits/blob/master/smart\_contract\_audits/Euler\_-\_Sherlock\_Report.pdf) 34 | 35 | #### Certora - September 2021 36 | 37 | [Audit Report](https://github.com/euler-xyz/euler-audits/blob/master/smart\_contract\_audits/Formal\_Verification\_Report\_for\_Euler.pdf) 38 | 39 | #### Halborn - May 2021 40 | 41 | [Audit Report](https://github.com/euler-xyz/euler-audits/blob/master/smart\_contract\_audits/Euler\_Smart\_Contract\_Security\_Audit\_Halborn\_v\_1\_1.pdf) 42 | 43 | #### Solidified and ZK Labs - May 2021 44 | 45 | [Audit Report](https://github.com/euler-xyz/euler-audits/blob/master/smart\_contract\_audits/Audit%20Report%20-%20Euler%20-%20\[07.05.2021].pdf) 46 | 47 | ### UI Audits 48 | 49 | #### PenTestPartners.com - June 2022 50 | 51 | [Audit Report](https://github.com/euler-xyz/euler-audits/blob/master/ui\_audits/PenTestPartners\_EulerDApp\_Jun22\_v1\_0.pdf) 52 | -------------------------------------------------------------------------------- /security/bug-bounty.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Discover how to participate in the Euler Bug Bounty programme 3 | --- 4 | 5 | # Bug Bounty 6 | 7 | The Euler protocol smart contracts have gone through several audits, but may still contain implicit or hidden vulnerabilities. 8 | 9 | We strongly encourage the community to undertake their own audits, and will reward individuals who responsibly disclose any vulnerabilities they find. Up to $1m is up for grabs. Start hunting today! 10 | 11 | Bugs can be reported directly [here](mailto:security@euler.xyz) or through DeFi's leading bug bounty platform Immunefi, [here](https://immunefi.com/bounty/euler/). 12 | -------------------------------------------------------------------------------- /security/insurance.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Find information about how users can insure their positions on Euler 3 | --- 4 | 5 | # Insurance 6 | 7 | Euler protocol has access to $10M in smart contract coverage provided by [Sherlock](https://mirror.xyz/0xE400820f3D60d77a3EC8018d44366ed0d334f93C/WWuglPwGDDkGgBlOt1Tz9JbPv6xhQx7lyFEeiXllcDI) as part of a collaborative [partnership](https://blog.euler.finance/euler-partners-with-sherlock-for-decentralized-exploit-protection-32e522baa265). This also includes an audit report and a $1M ImmuneFi bug bounty provided by Sherlock. 8 | 9 | Sherlock's coverage is managed by the protocols/DAO instead of users, while its claims decisions are made by an unbiased 3rd party. 10 | 11 | Read more about Sherlock's insurance program at their [website](https://www.sherlock.xyz/) or in their [documentation](https://docs.sherlock.xyz/faq) for further details. 12 | --------------------------------------------------------------------------------