### Definition and Example of Arbitrage on Curve Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/pools/deposit-faqs.md Defines arbitrage in the context of cryptocurrency markets and Curve, providing an Etherscan transaction example to illustrate how traders profit from price discrepancies. ```APIDOC Arbitrage is the simultaneous buying and selling of, in our case, a token to make a profit. Because cryptocurrency markets can often lack liquidity, there are often opportunities for traders to take advantage of price discrepancies to make a profit which can be helped by protocols like Curve. An example transaction: [**Etherscan**](https://etherscan.io/tx/0x259b7ac1f50554fe5ddcfeea7b4fa90ad70356ddfbbd341289db0dfbf99447f9) In this transaction, someone used Curve and OasisDex and made around $200. This goes back to what was discussed earlier with liquidity pools. The idea is that is you incentivize traders to take advantage of price discrepancies which we all get rewarded for. ``` -------------------------------- ### Understanding Incentivized Pools on Curve Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/pools/deposit-faqs.md Explains the concept of incentivized pools on Curve, where companies provide additional rewards to liquidity providers to help stablecoins maintain their pegs. ```APIDOC Liquidity pools (particularly one without an opportunity cost) are a great way to help stable coins keep their pegs. It makes easy for traders to arb (see question above) when the price slips off the peg which is very important for all the companies and foundations developing stable coins as having a $0.98 stablecoin is never a good look. As a result, some pools on Curve are “incentivized”. That means that on top of trading fees and lending fees, the companies will give rewards to people providing liquidity to the pools with their coins. ``` -------------------------------- ### Understanding Curve Deposit Bonuses Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/pools/deposit-faqs.md Explains the concept of deposit bonuses on Curve, detailing how they are influenced by token price discrepancies and the pool's rebalancing mechanism. ```APIDOC On the screenshot above, you can see GUSD is quite low as it should make up 50% of the total pool because it's a metapool paired against 3crv. So if your plan was to join the gusd-pool, you would ideally deposit GUSD into it. As you can see on the screenshot, you would get an instant 0.0082% bonus for depositing GUSD into the pool. The main reason for this is that GUSD is currently slightly more expensive so if you went to a centralized exchange you might sell it for $1.007 instead of $1. The deposit bonus reflects that. The other reason behind this is that the pools are always trying to balance themselves and go back to equal parts (in this case 50% GUSD) so depositing the coin with the lowest share will get you a deposit bonus. ``` -------------------------------- ### Example Calculation of scrvUSD Yield Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/crvusd/scrvusd.md This example demonstrates how the annual yield for scrvUSD is calculated under different scenarios, considering the circulating supply of crvUSD, total yearly fees, average borrow rate, and the percentage of crvUSD staked in scrvUSD, within DAO-defined minimum and maximum revenue allocation limits. ```Text Parameters: - Timeframe: 1 year - Circulating supply of crvUSD: 100M - crvUSD yearly fees: 10M crvUSD - Average borrow rate: 10% - crvUSD revenue to scrvUSD: 5% min, 50% max Example yield calculation changing the ratio of crvUSD staked in scrvUSD vs crvUSD circulating supply: - 1M staked (1%): 5% of fees ($500k) → 50% yield - 32M staked (32%): 32% of fees ($3.2M) → 10% yield - 60M staked (60%): 50% of fees ($5M) → 8% yield (50% max rev/60% staked) ``` -------------------------------- ### Liquidity Provision Mechanics: Token Splitting on Curve Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/pools/deposit-faqs.md Describes how deposited stablecoins are split among pool tokens on Curve, emphasizing that balances constantly change due to trading and arbitrage. ```APIDOC When you go to the deposit page and deposit one stablecoin, it then gets split between each token in the pool. That’s something you have to keep in mind because if you were to deposit 1000 DAI in the Pool, as per the screenshot below, your balance would be roughly equal to 390.7 GUSD, 120 DAI, 119.8 USDC and 362.6 USDT. Those values change constantly as people trade and arb the price of stable coins. ``` -------------------------------- ### Understanding 'Deposit Wrapped' Option on Curve Metapools Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/pools/deposit-faqs.md Explains the 'deposit wrapped' option for metapools or pools with c-tokens/a-tokens, detailing its purpose for pre-lent tokens and its applicability to basepool tokens like 3Crv. ```APIDOC (This applies to metapools or pools with c-tokens or a-tokens). If you deposit a stablecoin to one of the pools with lending, Curve will automatically wrap your token to a cToken (for Compound) or aToken (for Aave). The option is simply there if you have already previously lent them on Compound or Aave. If your stablecoin is in its original form, you can ignore this option. If you deposit into metapools and you have the corresponding basepool token (for example, 3Crv), you can also use the "deposit wrapped" option to deposit this token. ``` -------------------------------- ### Withdrawal Principles and Bonuses on Curve Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/pools/deposit-faqs.md Clarifies that withdrawal principles mirror deposit bonuses, allowing users to choose their preferred stablecoin while potentially receiving a bonus for withdrawing the largest share. ```APIDOC When you withdraw, the same principle as in the question above applies- but reversed. If you withdraw the stable coin with the biggest share, you would get a bonus but you still choose what stable coin you want to withdraw. ``` -------------------------------- ### Interest Accrual and Compounding on Curve Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/pools/deposit-faqs.md Details the frequency and automatic nature of interest accrual and compounding for Curve pools utilizing lending protocols. ```APIDOC Interests for pools using lending protocols compound every block or 15 seconds or immediately after fees are paid. It’s also compounded automatically. ``` -------------------------------- ### Define URL Redirect Mappings Source: https://github.com/curvedocs/curve-resources/blob/main/overrides/404.html This JavaScript object maps old documentation paths to their new, updated locations. It's used by the client-side redirect logic to guide users to the correct content when they access deprecated URLs. ```JavaScript // Create an object containing all your redirects const redirects = { "/crv-token/crv-basics": "/crv-token/faq", "/crv-token/crv-tokenomics": "/crv-token/supply-distribution", "/lending/about": "/lending/overview", "/lending/loan-creation": "/lending/how-to-borrow", "/lending/supplying-assets": "/lending/how-to-supply", "/crvusd/loan-management": "/crvusd/loan-strategies", "/crvusd/loan-details": "/crvusd/loan-concepts", "/resources/branding": "/glossary-branding/branding", "/resources/glossary": "/glossary-branding/glossary", "/resources/risks/pool": "/risks-security/risks/pool", "/resources/risks/crvusd": "/risks-security/risks/crvusd", "/resources/risks/lending": "/risks-security/risks/lending", "/resources/security": "/risks-security/security", "/governance/fee-collection-distribution": "/vecrv/overview", "/crv-token/claiming-trading-fees": "/vecrv/claiming-trading-fees", "/lending/understanding-lending": "/lending/overview", "/crvusd/loan-details": "/crvusd/loan-concepts", "/factory-pools/creating-a-twocrypto-ng-pool": "/pool-creation/creating-a-cryptoswap-pool", "/factory-pools/creating-a-stableswap-ng-pool": "/pool-creation/creating-a-stableswap-pool", "/base-features/understanding-crypto-pools": "/pools/overview", "/lp/calculating-yield/#base-vapy": "/pools/calculating-yield/#base-vapy", "/lp/calculating-yield": "/pools/calculating-yield" }; ``` -------------------------------- ### Bridge Contract Method: bridge Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/cross-chain/bridging-curve-eco-tokens.md Documentation for the 'bridge' method on a blockchain bridge contract, detailing its required parameters for transferring tokens from an L1 blockchain to Ethereum. ```APIDOC Method: bridge( bridge: ETH amount for the bridge fee (denominated in Ether, quoted amount / 1e18), _amount: Amount of tokens to bridge (in 1e18 format), _receiver: Wallet address to receive the tokens ) ``` -------------------------------- ### Python Dependencies for MkDocs Documentation Project Source: https://github.com/curvedocs/curve-resources/blob/main/requirements.txt This snippet provides a list of Python packages commonly used in an MkDocs project. These packages are typically installed via pip and define the project's build environment for documentation generation, including themes, plugins for features like autolinks, minification, and internationalization, and extensions for Markdown processing. ```Python mkdocs mkdocs-material mkdocs-autolinks-plugin mkdocs-minify-plugin pymdown-extensions mkdocs-git-revision-date-localized-plugin mkdocs-static-i18n ``` -------------------------------- ### scrvUSD Token Contract Addresses Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/cross-chain/bridging-curve-eco-tokens.md Provides the scrvUSD token contract address for Ethereum. ```APIDOC scrvUSD Token Addresses: Ethereum: 0x0655977FEb2f289A4aB78af67BAB0d17aAb84367 ``` -------------------------------- ### Impact of Deposited Coin Choice on Curve Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/pools/deposit-faqs.md Discusses whether the choice of deposited coin matters, highlighting considerations like deposit bonuses and potential slippage for large deposits or low-liquidity pools. ```APIDOC For most typical deposits, it doesn't matter which coin you use - your tokens will automatically get split into the pool proportions. However, there are two important considerations: 1. There's a deposit bonus explained below that can affect your choice. 2. If you're making a large deposit relative to the pool's size or if the pool has low liquidity, depositing a single token could result in unfavorable exchange rates due to slippage. In these cases, it's better to pre-swap your tokens to match the pool's proportions before depositing. For normal-sized deposits into liquid pools, you can comfortably deposit one, some, or all the coins without worrying about it affecting your returns. ``` -------------------------------- ### Curve Resource Contract Addresses Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/cross-chain/bridging-curve-eco-tokens.md Lists various contract addresses associated with Curve resources on different blockchain networks, including Binance Smart Chain, Avalanche, and Fantom. ```APIDOC Binance Smart Chain: 0x0094Ad026643994c8fB2136ec912D508B15fe0E5 Avalanche: 0xA3ea433509F7941df3e33857D9c9f212Ad4A4e64 Fantom: 0x5191946500e75f0A74476F146dF7d386e52961d9 ``` -------------------------------- ### Approve Bridge Contract to Spend Tokens on L1 Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/cross-chain/bridging-curve-eco-tokens.md Explains how to approve the bridge contract to spend a specified amount of tokens on the L1 network before bridging them to Ethereum. This is a prerequisite for the bridging transaction. ```APIDOC Method: approve Description: Approves a specified bridge contract to spend a certain amount of tokens on the L1 network. Parameters: _spender: bridge_contract_address - The contract address of the bridge on the L1 blockchain. _value: token_amount_1e18 (e.g., for 100 crvUSD, enter 100000000000000000000) - The amount of tokens to approve in 1e18 format. ``` -------------------------------- ### Bridge Tokens from L2 to L1 (Ethereum) Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/cross-chain/bridging-curve-eco-tokens.md Details how to use the 'bridge' method on the bridge contract to transfer tokens from an L2 to an L1 blockchain, specifically Ethereum. This involves specifying the ETH amount, token amount, and receiver address. ```APIDOC Method: bridge Description: Initiates the bridging of tokens from an L2 to an L1 blockchain (Ethereum). Parameters: bridge: ETH_amount (denominated in Ether, quoted amount / 1e18) - The ETH amount for the bridge. _amount: token_amount_1e18 (amount of tokens to bridge in 1e18 format) - The amount of tokens to bridge. _receiver: wallet_address - The wallet address to receive the tokens. ``` -------------------------------- ### Quote Bridging Fee on L1 Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/cross-chain/bridging-curve-eco-tokens.md Describes how to use the 'quote' function on the L1 bridge contract to determine the cost of bridging tokens to Ethereum. This quote represents the cost in the L1's gas token, excluding additional gas costs. ```APIDOC Method: quote Description: Determines the bridging cost (in the gas token of the L1 blockchain) for a transaction. Parameters: None Returns: quote_amount (cost in L1 gas token) - The cost of calling the bridge method. ``` -------------------------------- ### Cross-Chain Bridge Contract Addresses Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/cross-chain/bridging-curve-eco-tokens.md Provides a table of bridge contract addresses on Ethereum for various L1 blockchains (Binance Smart Chain, Avalanche, Fantom), facilitating cross-chain token transfers. Each entry includes links to Etherscan for both Ethereum and the respective L1 chain. ```APIDOC Chain: BinanceSmartChain Bridge Address: 0xAE0666C978500f2C05784242B79B08C478Dd999c Links: Ethereum: https://etherscan.io/address/0xAE0666C978500f2C05784242B79B08C478Dd999c BSC: https://bscscan.com/address/0xAE0666C978500f2C05784242B79B08C478Dd999c Chain: Avalanche Bridge Address: 0x26E91B1f142b9bF0bB37e82959bA79D2Aa6b99b8 Links: Ethereum: https://etherscan.io/address/0x26E91B1f142b9bF0bB37e82959bA79D2Aa6b99b8 Avalanche: https://snowscan.xyz/address/0x26E91B1f142b9bF0bB37e82959bA79D2Aa6b99b8 Chain: Fantom Bridge Address: 0x08132eA9b02750E118cF5F5C640B7c46A8E638E8 Links: Ethereum: https://etherscan.io/address/0x08132eA9b02750E118cF5F5C640B7c46A8E638E8 Fantom: https://ftmscout.com/address/0x08132eA9b02750E118cF5F5C640B7c46A8E638E8 ``` -------------------------------- ### CRV Token and Bridge Contract Addresses Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/cross-chain/bridging-curve-eco-tokens.md Provides the CRV token contract addresses for Ethereum, Binance Smart Chain, Avalanche, and Fantom, along with the mirrored bridge contract addresses required for cross-chain transfers between Ethereum and these L1 blockchains. ```APIDOC CRV Token Addresses: Ethereum: 0xD533a949740bb3306d119CC777fa900bA034cd52 Binance Smart Chain: 0x9996D0276612d23b35f90C51EE935520B3d7355B Avalanche: 0xEEbC562d445F4bC13aC75c8caABb438DFae42A1B Fantom: 0xE6c259bc0FCE25b71fE95A00361D3878E16232C3 CRV Bridge Contract Addresses: BinanceSmartChain Bridge: 0xC91113B4Dd89dd20FDEECDAC82477Bc99A840355 (Ethereum, BSC) Avalanche Bridge: 0x5cc0144A511807608eF644c9e99B486124D1cFd6 (Ethereum, Avalanche) Fantom Bridge: 0x7ce8aF75A9180B602445bE230860DDcb4cAc3E42 (Ethereum, Fantom) ``` -------------------------------- ### Approve Token Spending on Etherscan Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/cross-chain/bridging-curve-eco-tokens.md Details the process of approving a bridge contract to spend tokens on behalf of a user via Etherscan's 'Write Contract' interface. This is a prerequisite for bridging tokens and involves calling the 'approve' method on the token's contract. ```APIDOC Method: approve(address _spender, uint256 _value) Description: Approves a specified address to spend a certain amount of tokens. Parameters: _spender (address): The address of the bridge contract to be approved. Value: 0x0A92Fd5271dB1C41564BD01ef6b1a75fC1db4d4f (same for all tokens) _value (uint256): The amount of tokens to approve, in 1e18 format. Example: For 100 crvUSD, enter 100000000000000000000. Action: Click 'Write' and sign the transaction in your wallet. ``` -------------------------------- ### crvUSD Token and Bridge Contract Addresses Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/cross-chain/bridging-curve-eco-tokens.md Provides the crvUSD token contract addresses for Ethereum, Binance Smart Chain, Avalanche, and Fantom, along with the mirrored bridge contract addresses required for cross-chain transfers between Ethereum and these L1 blockchains. ```APIDOC crvUSD Token Addresses: Ethereum: 0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E Binance Smart Chain: 0xe2fb3F127f5450DeE44afe054385d74C392BdeF4 Avalanche: 0xCb7c161602d04C4e8aF1832046EE08AAF96d855D Fantom: 0xD823D2a2B5AF77835e972A0D5B77f5F5A9a003A6 crvUSD Bridge Contract Addresses: BinanceSmartChain Bridge: 0x0A92Fd5271dB1C41564BD01ef6b1a75fC1db4d4f (Ethereum, BSC) Avalanche Bridge: 0x26D01ce989037befd7Ff63837A86e2da32E7D7e2 (Ethereum, Avalanche) Fantom Bridge: 0x76EAfda658C54548B460B3f190386699DE3827d8 (Ethereum, Fantom) ``` -------------------------------- ### Quote Bridging Cost on Etherscan Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/cross-chain/bridging-curve-eco-tokens.md Explains how to use the 'quote' function on the bridge contract via Etherscan's 'Read Contract' interface to determine the ETH cost for calling the bridge method. This quoted amount does not include additional gas costs. ```APIDOC Method: quote() Description: Determines the cost (in ETH) for calling the bridge method in a subsequent step. Return: uint256 (amount in ETH) Note: This amount does not include gas costs, which need to be paid on top of the quoted amount. ``` -------------------------------- ### Curve Lending Market Parameters Reference Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/lending/how-to-borrow.md Defines the key parameters and their descriptions for the Curve lending markets, including various fees, discount factors, and pricing mechanisms that govern loan behavior and liquidity. ```APIDOC LendingMarketParameters: Fee: The current exchange fee for swapping tokens in the AMM. Admin Fee: The percentage of the total fee, which is awarded to veCRV holders. Currently, all fees go to liquidity providers in the AMM (which are the borrowers). Band Width Factor: The band width factor (sometimes denoted as A) defines the density of liquidity and band width. Loan Discount: The percentage used to discount the collateral for calculating the maximum borrowable amount when creating a loan. Liquidation Discount: The percentage used to discount the collateral for calculating the recoverable value upon liquidation at the current market price. Base Price: The base price is the price of the band number 0. Oracle Price: The oracle price is the current price of the collateral as determined by the oracle. The oracle price is used to calculate the collateral's value and the loan's health. ``` -------------------------------- ### Configure Chart.js Tooltip and Initialize Rate Chart Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/lending/create-lending-market.md This JavaScript snippet defines custom tooltip behavior for a Chart.js chart, including filtering datasets and formatting label text to display utilization, borrow APR, and lend APR. It also includes logic to destroy an existing chart instance before creating a new one, ensuring proper chart updates. ```javascript return tooltipItem.datasetIndex === 0; }, enabled: true, backgroundColor: 'rgba(0, 0, 0, 0.7)', bodyColor: '#ffffff', bodyFont: { size: 12, }, borderColor: 'rgba(0, 0, 0, 0.7)', borderWidth: 1, usePointStyle: false, padding: 4, displayColors: false, callbacks: { title: function() { return ''; }, label: function(context) { const utilization = context.parsed.x.toFixed(2); const borrowRate = context.chart.data.datasets[0].data[context.dataIndex].y.toFixed(2); const lendRate = context.chart.data.datasets[1].data[context.dataIndex].y.toFixed(2); return [ `Utilization: ${utilization}%`, `Borrow APR: ${borrowRate}%`, `Lend APR: ${lendRate}%` ]; } } }, }, legend: { position: 'bottom' } } }; if (rateChart) { rateChart.destroy(); } rateChart = new Chart(ctx, config); } ``` -------------------------------- ### OneWay Lending Factory: create Method for Lending Market Deployment with Custom Oracle Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/lending/create-lending-market.md Deploys a new lending market using a custom price oracle. This method requires the address of the custom price oracle contract, along with various market parameters. Parameters like `band_width_factor` are simple numbers, while others like `fee`, `loan_discount`, `liquidation_discount`, and borrow rates are $10^{18}$ scaled numbers. ```APIDOC OneWay Lending Factory: create( price_oracle: address, borrowed_token: address, collateral_token: address, band_width_factor: uint256, fee: uint256, loan_discount: uint256, liquidation_discount: uint256, name: string, min_borrow_rate: uint256 (optional), max_borrow_rate: uint256 (optional) ) Parameters: price_oracle: Address of the custom price oracle contract. borrowed_token: Address of the token to be supplied and borrowed. collateral_token: Address of the token to be used as collateral. band_width_factor: The band width factor (A). Most markets use a value between 10-30. Use lower values for riskier assets. Input as a normal number, e.g., 10 = 10. fee: The AMM swap fee. Most pools use between 0.3-1.5%. Input as a 10^18 number, e.g., 0.06% = 6000000000000000. loan_discount: The amount to discount collateral for calculating maximum LTV. Usually higher than liquidation_discount by 3-4%. Input as a 10^18 number, e.g., 11% = 110000000000000000. liquidation_discount: The amount to discount collateral for health and hard-liquidation calculations. Usually less than loan_discount by 3-4%. Input as a 10^18 number, e.g., 8% = 80000000000000000. name: The name of the market. min_borrow_rate (optional): The minimum borrow rate, as rate/sec. Input as a 10^18 number, e.g., 1% APR = 317097919. max_borrow_rate (optional): The maximum borrow rate, as rate/sec. Input as a 10^18 number, e.g., 80% APR = 25367833587. ``` -------------------------------- ### HTML Structure for Soft-liquidation Applet UI Source: https://github.com/curvedocs/curve-resources/blob/main/docs/en/llamalend/educational/liquidations.md This HTML snippet defines the user interface for the soft-liquidation applet, including input fields for collateral amount and liquidation range, a slider, a canvas for charting, and external script inclusions for Chart.js and a custom liquidations.js file. It uses inline styles for basic layout and functionality integration. ```HTML
| Utilization (%) | Borrow APR (%) | Lend APR (%) | Spread (%) |
|---|---|---|---|
| ${row.utilization} | ${row.borrowAPR} | ${row.lendAPR} | ${row.spread} |