diff --git a/docs/api/subgraph/guides/subgraph-example.md b/docs/api/subgraph/guides/subgraph-example.md index 4c163aa333..67196a2381 100644 --- a/docs/api/subgraph/guides/subgraph-example.md +++ b/docs/api/subgraph/guides/subgraph-example.md @@ -6,7 +6,7 @@ sidebar_position: 3 # Subgraph Query Examples -This doc will teach you how to query Uniswap V3 analytics by writing GraphQL queries on the subgraph. You can fetch data points like : +This doc will teach you how to query Uniswap v3 analytics by writing GraphQL queries on the subgraph. You can fetch data points like : - [collected fees for a position](#general-position-data) - [current liquidity](#pool-data) of a pool @@ -16,7 +16,7 @@ and much more. Below are some example queries. To run a query copy and paste it ## Global Data -Global data refers to data points about the Uniswap v3 protocol as a whole. Some examples of global data points are total value locked in the protocol, total pools deployed, or total transaction counts. Thus, to query global data you must pass in the Uniswap V3 Factory address `0x1F98431c8aD98523631AE4a59f267346ea31F984` and select the desired fields. Reference the full [factory schema](https://github.com/Uniswap/v3-subgraph/blob/main/schema.graphql#L1) to see all possible fields. +Global data refers to data points about the Uniswap v3 protocol as a whole. Some examples of global data points are total value locked in the protocol, total pools deployed, or total transaction counts. Thus, to query global data you must pass in the Uniswap v3 Factory address `0x1F98431c8aD98523631AE4a59f267346ea31F984` and select the desired fields. Reference the full [factory schema](https://github.com/Uniswap/v3-subgraph/blob/main/schema.graphql#L1) to see all possible fields. ### Current Global Data @@ -226,7 +226,7 @@ swaps(orderBy: timestamp, orderDirection: desc, where: ## Token Data -Input the the token contract address to fetch token data. Any token that exists in at least one Uniswap V3 pool can be queried. The output will aggregate data across all v3 pools that include the token. +Input the the token contract address to fetch token data. Any token that exists in at least one Uniswap v3 pool can be queried. The output will aggregate data across all v3 pools that include the token. ### General Token Data diff --git a/docs/api/subgraph/overview.md b/docs/api/subgraph/overview.md index 5228fd5045..744f9e432c 100644 --- a/docs/api/subgraph/overview.md +++ b/docs/api/subgraph/overview.md @@ -15,7 +15,7 @@ Each version of Uniswap has its own dedicated subgraph, and governance contracts Each subgraph has a dedicated endpoint for querying data, as well as a page on [The Graph explorer](https://thegraph.com/explorer) that exposes the schema and available fields to query. -##### V3 (Mainnet) +##### v3 (Mainnet) - [Subgraph](https://thegraph.com/explorer/subgraphs/5zvR82QoaXYFyDEKLZ9t6v9adgnptxYpKpSbxtgVENFV?view=Query&chain=arbitrum-one) - Graphql Endpoint: `https://gateway.thegraph.com/api//subgraphs/id/5zvR82QoaXYFyDEKLZ9t6v9adgnptxYpKpSbxtgVENFV` diff --git a/docs/concepts/governance/07-changelog.md b/docs/archived/07-changelog.md similarity index 98% rename from docs/concepts/governance/07-changelog.md rename to docs/archived/07-changelog.md index b7438578e3..8a0451a2ed 100644 --- a/docs/concepts/governance/07-changelog.md +++ b/docs/archived/07-changelog.md @@ -1,6 +1,7 @@ --- id: changelog title: Changelog +hidden: true --- | Date | Abstract | Transaction | Sybil Reference | diff --git a/docs/concepts/glossary.md b/docs/concepts/glossary.md index da2962d131..056e8874be 100644 --- a/docs/concepts/glossary.md +++ b/docs/concepts/glossary.md @@ -50,7 +50,7 @@ Digital assets that are stored in a Uniswap pool contract, and are able to be tr ## Mid Price -The price between the available buy and sell prices. In Uniswap V1 and V2, this is the ratio of the two ERC20 token reserves. In V3, this is the ratio of the two ERC20 token reserves available within the current active tick. +The price between the available buy and sell prices. In Uniswap v1 and v2, this is the ratio of the two ERC20 token reserves. In V3, this is the ratio of the two ERC20 token reserves available within the current active tick. ## Observation @@ -58,7 +58,7 @@ An instance of historical price and liquidity data of a given pair. ## Pair -A smart contract deployed from a Uniswap V1 or V2 factory contract that enables trading between two ERC20 tokens. Pair contracts are now called Pools in V3. +A smart contract deployed from a Uniswap v1 or v2 factory contract that enables trading between two ERC20 tokens. Pair contracts are now called Pools in v3. ## Periphery diff --git a/docs/concepts/governance/01-overview.md b/docs/concepts/governance/01-overview.md index 5ea48a0f10..fd6a81ce7e 100644 --- a/docs/concepts/governance/01-overview.md +++ b/docs/concepts/governance/01-overview.md @@ -7,10 +7,14 @@ title: Overview [`governance`](https://github.com/Uniswap/governance) + + ## UNI Address `UNI` is deployed at `0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984` on the Ethereum [mainnet](https://etherscan.io/address/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984), and the [Ropsten](https://ropsten.etherscan.io/address/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984), [Rinkeby](https://rinkeby.etherscan.io/address/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984), [Görli](https://goerli.etherscan.io/address/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984), and [Kovan](https://kovan.etherscan.io/address/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984) testnets. It was built from commit [ab22c08](https://github.com/Uniswap/governance/commit/ab22c084bacb2636a1aebf9759890063eb6e4946). diff --git a/docs/concepts/governance/02-process.md b/docs/concepts/governance/02-process.md index b3dbd6e0ae..2654034e05 100644 --- a/docs/concepts/governance/02-process.md +++ b/docs/concepts/governance/02-process.md @@ -13,7 +13,7 @@ Uniswap Governance takes place in several venues. Each serves its own particular A Discourse-hosted forum for governance-related discussion. Community members must register for an account before sharing or liking posts. New members must read 4 topics and a combined 15 posts over the course of at least 10 minutes before they may post themselves. -2. [_Snapshot_](https://snapshot.org/#/uniswapgovernance.eth) +2. [_Snapshot_](https://snapshot.box/#/s:uniswapgovernance.eth) A simple voting interface that allows users to signal sentiment off-chain. Votes on Snapshot are weighted by the number of UNI delegated to the address used to vote. @@ -42,7 +42,7 @@ _Timeframe_: 5 days _Quorum_: 10M UNI -_Form_: [Snapshot Poll](https://snapshot.org/#/uniswapgovernance.eth) +_Form_: [Snapshot Poll](https://snapshot.box/#/s:uniswapgovernance.eth) The purpose of the Temperature Check is to signal community sentiment on a proposal prior to moving towards an onchain vote. @@ -52,7 +52,7 @@ To create a Temperature Check: 2. Create and post this version of the proposal in the [Governance Forum](https://gov.uniswap.org/) with the title “Temperature Check — [Your Title Here]”. Include a link to the RFC post. You will update the post to include a link to the Snapshot poll after you’ve posted that. -3. Create a [Snapshot poll](https://snapshot.org/#/uniswap). The voting options should consist of those which have gained support in the RFC Phase. This poll can be either binary or multiple choice but must include a `No change` option. Set the poll duration to 5 days. Include a link to the Forum Temperature Check post. +3. Create a [Snapshot poll](https://snapshot.box/#/s:uniswapgovernance.eth). The voting options should consist of those which have gained support in the RFC Phase. This poll can be either binary or multiple choice but must include a `No change` option. Set the poll duration to 5 days. Include a link to the Forum Temperature Check post. 4. Update the Forum post with a link to the Snapshot Poll. @@ -90,26 +90,8 @@ Timeframe: 7 days _Quorum_: 40M UNI -Form: [Snapshot Poll](https://snapshot.org/#/uniswap) +Form: [Snapshot Poll](https://snapshot.box/#/s:uniswapgovernance.eth) In the future, the community governance process above may need to undergo additional changes to continue to meet the needs of the Uniswap community. While an onchain vote is not required to change the majority of this process, a clear display of community support and acceptance is important for process changes to have legitimacy. Thus, changes to all off-chain community governance processes should be voted on through an off-chain Snapshot vote. There should be a 7-day voting period and 40M UNI quorum. - -## Governance Glossary - -- **UNI:** An ERC-20 token that designates the weight of a user's voting rights. The more UNI a user has in their wallet, the more weight their delegation or vote on a proposal holds. - -- **Delegation:** UNI holders cannot vote or create proposals until they delegate their voting rights to an address. A UNI holder can delegate to one address at a time, including their own address. Note that delegation does not lock tokens; it simply adds votes to the chosen delegation address. - -- **Proposal:** A proposal is executable code that modifies the governance contract or treasury and how they work. To create a proposal, a user must have at least 0.10% (1M UNI) of all UNI delegated to their address. Proposals are stored in the "proposals" mapping of the Governor smart contract. All proposals are subject to a ~7-day voting period. If the proposer does not maintain their vote weight balance throughout the voting period, anyone may cancel the proposal. - -- **Threshold:** The amount of UNI that must be delegated to an address to take a given action. Currently, the only action with a threshold is posting an onchain vote. - -- **Quorum:** In order for a vote to pass, 4% of all UNI (40M) must vote in favor. Votes against and abstentions do not count towards a quorum. The purpose of the quorum is to ensure that the only measures that pass have adequate voter participation. - -- **Voting:** Users can vote for or against single proposals once they have voting rights delegated to their address. Votes can be cast while a proposal is in the "Active" state. Votes can be submitted immediately using "castVote" or submitted later with "castVoteBySig" (For more info on castVoteBySig and offline signatures, see EIP-712). If the majority of votes (and a 4% quorum of UNI) vote for a proposal, the proposal may be queued in the Timelock. - -- **Voting Period:** Once a proposal has been created, Uniswap community members will have a seven day period (the Voting Period) to cast their votes. - -- **Timelock:** All governance proposals must sit in the Timelock for a minimum of 2 days, after which they can be executed. diff --git a/docs/concepts/governance/05-adversarial-circumstances.md b/docs/concepts/governance/04-adversarial-circumstances.md similarity index 100% rename from docs/concepts/governance/05-adversarial-circumstances.md rename to docs/concepts/governance/04-adversarial-circumstances.md diff --git a/docs/concepts/governance/04-glossary.md b/docs/concepts/governance/05-glossary.md similarity index 100% rename from docs/concepts/governance/04-glossary.md rename to docs/concepts/governance/05-glossary.md diff --git a/docs/concepts/protocol/range-orders.md b/docs/concepts/protocol/range-orders.md index 0d1a6ae313..0cef7fe319 100644 --- a/docs/concepts/protocol/range-orders.md +++ b/docs/concepts/protocol/range-orders.md @@ -8,7 +8,7 @@ Customizable liquidity positions, along with single-sided asset provisioning, al In typical order book markets, anyone can easily set a limit order: to buy or sell an asset at a specific predetermined price, allowing the order to be filled at an indeterminate time in the future. -With Uniswap V3, one can approximate a limit order by providing a single asset as liquidity within a specific range. Like traditional limit orders, range orders may be set with the expectation they will execute at some point in the future, with the target asset available for withdrawal after the spot price has crossed the full range of the order. +With Uniswap v3, one can approximate a limit order by providing a single asset as liquidity within a specific range. Like traditional limit orders, range orders may be set with the expectation they will execute at some point in the future, with the target asset available for withdrawal after the spot price has crossed the full range of the order. Unlike some markets where limit orders may incur fees, the range order maker generates fees while the order is filled. This is due to the range order technically being a form of liquidity provisioning rather than a typical swap. @@ -32,7 +32,7 @@ The nature of AMM design makes some styles of limit orders possible, while other > The Current price of a DAI / ETH pool is 1,500 DAI / ETH. You expect that ETH will rebound after it drops to 1,000 at the next market downturn, so you would like to place a range order swapping DAI to ETH at the price of 1,000 DAI / ETH. This is possible, as the price space below the spot price is denominated in the lower-priced asset, DAI. You can provide DAI at the price of 1,000 DAI / ETH, which will be swapped for ETH when the spot price of ETH drops past 1,000 DAI / ETH. -As the above examples show, in Uniswap V3, the two paired assets in a given pool are separated above and below the spot price, with the higher price asset available above the spot price and the lower-priced asset below. +As the above examples show, in Uniswap v3, the two paired assets in a given pool are separated above and below the spot price, with the higher price asset available above the spot price and the lower-priced asset below. The following examples show limit order styles that are unable to be replicated due to the separation of assets in price space. diff --git a/docs/concepts/research.md b/docs/concepts/research.md index bc23a994c0..2179abb6f9 100644 --- a/docs/concepts/research.md +++ b/docs/concepts/research.md @@ -4,6 +4,60 @@ title: Research sidebar_position: 4 --- +The [Uniswap Foundation](https://www.uniswapfoundation.org/) supports the protocol's growth and decentralization through strategic research initiatives, empowering our community with grants and resources to conduct groundbreaking research and develop practical implementations that advance the frontier DeFi. Featured research from our community: + +# Layer 2 be or Layer not 2 be: Scaling on Uniswap v3 + +Authors: Austin Adams + +> This research paper analyzes how cheaper and faster blockchain networks impact Uniswap v3's performance compared to Ethereum mainnet, revealing that reduced transaction costs lead to better gas-adjusted execution and more efficient capital deployment by liquidity providers. Faster block times and lower costs enable increased arbitrage activity, resulting in higher fee returns for liquidity providers, though there's evidence that 2-second block times may not be optimal compared to a first-come-first-served model. Evidence suggests that many current AMM limitations stem from blockchain constraints rather than protocol design, and these issues can be significantly improved through faster, cheaper transactions. + +- [Layer 2 be or Layer not 2 be: Scaling on Uniswap v3 [Mar 2024]](https://arxiv.org/abs/2403.09494) + +# Who Wins Ethereum Block Building Auctions and Why? + +Authors: Burak Öz, Danning Sui, Thomas Thiery, Florian Matthes + +> The MEV-Boost block auction contributes approximately 90% of all Ethereum blocks. Between October 2023 and March 2024, only three builders produced 80% of them, highlighting the concentration of power within the block builder market. To foster competition and preserve Ethereum's decentralized ethos and censorship-resistance properties, understanding the dominant players' competitive edges is essential. This identifies features that play a significant role in builders' ability to win blocks and earn profits by conducting a comprehensive empirical analysis of MEV-Boost auctions over a six-month period. + +- [Who Wins Ethereum Block Building Auctions and Why? [Jul 2024]](https://arxiv.org/abs/2407.13931) + +# MEV Capture and Decentralization in Execution Tickets + +Authors: Jonah Burian, Davide Crapis, Fahad Saleh + +> Provides an economic model of Execution Tickets and uses it to study the ability of the Ethereum protocol to capture MEV from block construction, demonstrating that Execution Tickets extract all MEV when all buyers are homogeneous, risk neutral and face no capital costs. We also show that MEV capture decreases with risk aversion and capital costs. Moreover, when buyers are heterogeneous, MEV capture can be especially low and a single dominant buyer can extract much of the MEV. This adverse effect can be partially mitigated by the presence of a Proposer Builder Separation (PBS) mechanism, which gives ET buyers access to a market of specialized builders, but in practice centralization vectors still persist. With PBS, ETs are concentrated among those with the highest ex-ante MEV extraction ability and lowest cost of capital. We show how it is possible that large investors that are not builders but have substantial advantage in capital cost can come to dominate the ET market. + +- [MEV Capture and Decentralization in Execution Tickets [Aug 2024]](https://arxiv.org/abs/2408.11255) + +# What Drives Liquidity on Decentralized Exchanges? Evidence from the Uniswap Protocol + +Authors: Alex Evans + +> Geometric mean market makers (G3Ms), such as Uniswap and Balancer, comprise a popular class of automated market makers (AMMs) defined by the following rule: the reserves of the AMM before and after each trade must have the same (weighted) geometric mean. This paper extends several results known for constant-weight G3Ms to the general case of G3Ms with time-varying and potentially stochastic weights. These results include the returns and no-arbitrage prices of liquidity pool (LP) shares that investors receive for supplying liquidity to G3Ms. Using these expressions, we show how to create G3Ms whose LP shares replicate the payoffs of financial derivatives. The resulting hedges are model-independent and exact for derivative contracts whose payoff functions satisfy an elasticity constraint. These strategies allow LP shares to replicate various trading strategies and financial contracts, including standard options. G3Ms are thus shown to be capable of recreating a variety of active trading strategies through passive positions in LP shares. + +- [What Drives Liquidity on Decentralized Exchanges? Evidence from the Uniswap Protocol [Oct 2024]](https://arxiv.org/abs/2410.19107) + +# The Evolution of Decentralized Exchange: Risks, Benefits, and Oversight + +Authors: Campbell R. Harvey, Joel Hasbrouck, Fahad Saleh + +> A decentralized exchange or DEX is an application deployed on a blockchain that allows investors to exchange digital assets at pricing terms determined by a preset exchange rate formula. This technology has several unique features, including accessibility to all investors, transparency of pricing, and simultaneity of execution and settlement. Notably, trading via a DEX is feasible for any asset tokenized on a blockchain. In turn, given that assets such as stocks and bonds could be tokenized easily, it is particularly important to understand the risks posed by DEXs. This paper examines both the benefits and risks to investors from DEXs, explores the role of private and public liquidity pools and analyzes possible regulatory approaches. + +- [The Evolution of Decentralized Exchange: Risks, Benefits, and Oversight [Oct 2024]](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4861942) + + +# Research Initiatives: Get Involved + +- [TLDR (The Latest in DeFi Research):](https://www.thelatestindefi.org/) empowers engineers, academics, and students through research fellowships with grants and expert mentorship, culminating in an annual conference to showcase groundbreaking work. + +- [CBER CtCe (Crafting the Cryptoeconomy):](https://x.com/UniswapFND/status/1859719158763749514) developed to generate and promote practical yet rigorous research in cryptoeconomics by connecting researchers, economists and practitioners through workshops, grants and conferences. + +- [DEX Analytics Portal:](https://dexanalytics.org/) accurate, verified, and ergonomic DEX and Uniswap datasets to save researchers time. + + + \ No newline at end of file diff --git a/docs/concepts/resources.md b/docs/concepts/resources.md index 3dbc7ba096..2b4aa81fb0 100644 --- a/docs/concepts/resources.md +++ b/docs/concepts/resources.md @@ -6,7 +6,7 @@ sidebar_position: 5 This page will be periodically updated with helpful resources for calculations and software design as they are made available. -- [**Uniswap V2 Visualization**](https://www.desmos.com/calculator/j8eppi5vvu) -- [**Uniswap V3 Visualization**](https://www.desmos.com/calculator/q2kxfue441) -- [**Uniswap V3 (Multiple Positions) Visualization**](https://www.desmos.com/calculator/oduetjzfp4) -- [**V2 / V3 Calculations**](https://docs.google.com/spreadsheets/d/1VH-lbF9RDUpVozGeA3BtWwypjW66MjcD1DnOYzcHmzk/edit#gid=0) +- [**Uniswap v2 Visualization**](https://www.desmos.com/calculator/j8eppi5vvu) +- [**Uniswap v3 Visualization**](https://www.desmos.com/calculator/q2kxfue441) +- [**Uniswap v3 (Multiple Positions) Visualization**](https://www.desmos.com/calculator/oduetjzfp4) +- [**v2 / v3 Calculations**](https://docs.google.com/spreadsheets/d/1VH-lbF9RDUpVozGeA3BtWwypjW66MjcD1DnOYzcHmzk/edit#gid=0) diff --git a/docs/concepts/uniswap-protocol.md b/docs/concepts/uniswap-protocol.md index 700c9731ff..c4e6f3b897 100644 --- a/docs/concepts/uniswap-protocol.md +++ b/docs/concepts/uniswap-protocol.md @@ -9,7 +9,7 @@ sidebar_position: 2 The Uniswap protocol is a peer-to-peer[^1] system designed for exchanging cryptocurrencies [(ERC-20 Tokens)](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/) on the [Ethereum](https://ethereum.org/) blockchain. The protocol is implemented as a set of persistent, non-upgradable smart contracts; designed to prioritize censorship resistance, security, self-custody, and to function without any trusted intermediaries who may selectively restrict access. -There are currently three versions of the Uniswap protocol. V1 and V2 are open source and licensed under GPL. V3 is open source with slight modifications, which are viewable [here](https://github.com/Uniswap/uniswap-v3-core/blob/main/LICENSE). Each version of Uniswap, once deployed, will function in perpetuity, with 100% uptime, provided the continued existence of the Ethereum blockchain. +There are currently three versions of the Uniswap protocol. v1 and v2 are open source and licensed under GPL. v3 is open source with slight modifications, which are viewable [here](https://github.com/Uniswap/uniswap-v3-core/blob/main/LICENSE). Each version of Uniswap, once deployed, will function in perpetuity, with 100% uptime, provided the continued existence of the Ethereum blockchain. ## How does the Uniswap protocol compare to a typical market? @@ -35,6 +35,6 @@ The protocol is also immutable, in other words not upgradeable. No party is able For research into the economics of AMMs, game theory, or optimization research, check out our [research](./research.md) page. -For new features implemented in V3 that expand and refine the AMM design, see the [V3 Concepts](./protocol/concentrated-liquidity.md) page. +For new features implemented in v3 that expand and refine the AMM design, see the [v3 Concepts](./protocol/concentrated-liquidity.md) page. [^1]: Ethereum protocols are sometimes referred to as peer-to-contract systems as well. These are similar to a peer-to-peer systems, but with immutable, persistent programs known as smart contracts taking the place of a peer. diff --git a/docs/concepts/what-is-uniswap.md b/docs/concepts/what-is-uniswap.md index 4571035b5e..279d2d5504 100644 --- a/docs/concepts/what-is-uniswap.md +++ b/docs/concepts/what-is-uniswap.md @@ -8,7 +8,8 @@ sidebar_position: 1 To begin, we should make clear the distinctions between the different areas of "Uniswap", some of which may confuse new users. -- **Uniswap Labs**: The company which developed the Uniswap protocol, along with the web interface. -- **The Uniswap Protocol**: A suite of persistent, non-upgradable smart contracts that together create an automated market maker, a protocol that facilitates peer-to-peer market making and swapping of ERC-20 tokens on the Ethereum blockchain. -- **The Uniswap Interface**: A web interface that allows for easy interaction with the Uniswap protocol. The interface is only one of many ways one may interact with the Uniswap protocol. -- **Uniswap Governance**: A governance system for governing the Uniswap Protocol, enabled by the UNI token. +- **[Uniswap Labs](https://x.com/Uniswap)**: The company which developed the Uniswap protocol, along with the web interface. +- **[Uniswap Foundation](https://www.uniswapfoundation.org/)**: A non-profit organization that supports the development of the Uniswap protocol and its DeFi ecosystem. +- **[Uniswap Protocol](https://github.com/Uniswap/contracts)**: A suite of persistent, non-upgradable smart contracts that together create an automated market maker, a protocol that facilitates peer-to-peer market making and swapping of ERC-20 tokens on the Ethereum blockchain. +- **[Uniswap Interface](https://app.uniswap.org/)**: A web interface that allows for easy interaction with the Uniswap protocol. The interface is only one of many ways one may interact with the Uniswap protocol. +- **[Uniswap Governance](https://gov.uniswap.org/)**: A governance system for governing the Uniswap Protocol, enabled by the UNI token. \ No newline at end of file diff --git a/docs/contracts/v1/_category_.json b/docs/contracts/v1/_category_.json index de522263ab..b8c4fe36bf 100644 --- a/docs/contracts/v1/_category_.json +++ b/docs/contracts/v1/_category_.json @@ -1,5 +1,5 @@ { - "label": "V1 Protocol", + "label": "v1 Protocol", "position": 6, "collapsed": true } diff --git a/docs/contracts/v2/_category_.json b/docs/contracts/v2/_category_.json index 56ca4aba58..eb8a914a9c 100644 --- a/docs/contracts/v2/_category_.json +++ b/docs/contracts/v2/_category_.json @@ -1,5 +1,5 @@ { - "label": "V2 Protocol", + "label": "v2 Protocol", "position": 5, "collapsed": true } diff --git a/docs/contracts/v2/overview.md b/docs/contracts/v2/overview.md index 7fe61e7488..7ce6edf132 100644 --- a/docs/contracts/v2/overview.md +++ b/docs/contracts/v2/overview.md @@ -4,24 +4,24 @@ title: Overview sidebar_position: 1 --- -# The Uniswap V2 Smart Contracts +# The Uniswap v2 Smart Contracts -Welcome to the Uniswap protocol V2 docs. +Welcome to the Uniswap protocol v2 docs. -The pages here contain conceptual and technical documentation of the Uniswap V2 protocol. +The pages here contain conceptual and technical documentation of the Uniswap v2 protocol. If you are new to Uniswap, you might want to check out the [Protocol overview](../V2/concepts/protocol-overview/how-uniswap-works) first. -You can also take a look at the V2 Protocol Whitepaper. +You can also take a look at the v2 Protocol Whitepaper. # Developer links -The V2 Uniswap protocol is separated across two repositories +The v2 Uniswap protocol is separated across two repositories - [`uniswap-v2-core`](https://github.com/Uniswap/uniswap-v2-core) - [`uniswap-v2-periphery`](https://github.com/Uniswap/uniswap-v2-periphery) -The V2 SDK, which can assist developers when interacting with the Uniswap V2 Protocol can be found here. +The v2 SDK, which can assist developers when interacting with the Uniswap v2 Protocol can be found here. - [`uniswap-sdk`](https://github.com/Uniswap/uniswap-v2-sdk) - [`uniswap-sdk-core`](https://github.com/Uniswap/uniswap-sdk-core) diff --git a/docs/contracts/v3/_category_.json b/docs/contracts/v3/_category_.json index 99fed98ce4..7b334efaf0 100644 --- a/docs/contracts/v3/_category_.json +++ b/docs/contracts/v3/_category_.json @@ -1,5 +1,5 @@ { - "label": "V3 Protocol", + "label": "v3 Protocol", "position": 2, "collapsed": true } diff --git a/docs/contracts/v3/overview.md b/docs/contracts/v3/overview.md index 13908635e6..2dcf288222 100644 --- a/docs/contracts/v3/overview.md +++ b/docs/contracts/v3/overview.md @@ -4,12 +4,12 @@ title: Overview sidebar_position: 1 --- -# The Uniswap V3 Smart Contracts +# The Uniswap v3 Smart Contracts -Welcome to the Uniswap V3 smart contracts documentation. +Welcome to the Uniswap v3 smart contracts documentation. -The pages here contain guides and technical documentation for the Uniswap V3 Smart Contracts. -You can use these docs to learn about the V3 Protocol Smart Contracts and develop on-chain integrations. +The pages here contain guides and technical documentation for the Uniswap v3 Smart Contracts. +You can use these docs to learn about the v3 Protocol Smart Contracts and develop on-chain integrations. # Guides @@ -23,5 +23,5 @@ For a deeper dive, read through the [technical reference](./reference/overview) # Resources -- [**V3 Core**](https://github.com/Uniswap/v3-core) -- [**V3 Periphery**](https://github.com/Uniswap/v3-periphery) \ No newline at end of file +- [**v3 Core**](https://github.com/Uniswap/v3-core) +- [**v3 Periphery**](https://github.com/Uniswap/v3-periphery) \ No newline at end of file diff --git a/docs/contracts/v3/reference/overview.md b/docs/contracts/v3/reference/overview.md index b9e7cb65c0..cbcb3ba49b 100644 --- a/docs/contracts/v3/reference/overview.md +++ b/docs/contracts/v3/reference/overview.md @@ -4,13 +4,13 @@ title: Overview sidebar_position: 1 --- -Uniswap V3 is a binary smart contract system comprised of many libraries, which together make the Core and Periphery. +Uniswap v3 is a binary smart contract system comprised of many libraries, which together make the Core and Periphery. Core contracts provide fundamental safety guarantees for all parties interacting with Uniswap. They define the logic of pool generation, the pools themselves, and the interactions involving the respective assets therein. Periphery contracts interact with one or more Core contracts but are not part of the core. They are designed to provide methods of interacting with the core that increase clarity and user safety. -External calls will primarily call the periphery interfaces. Externally available functions are all viewable in the reference documentation. Internal functions are viewable on the Uniswap V3 Github repo. +External calls will primarily call the periphery interfaces. Externally available functions are all viewable in the reference documentation. Internal functions are viewable on the Uniswap v3 Github repo. ## Core diff --git a/docs/contracts/v4/_category_.json b/docs/contracts/v4/_category_.json index 93b9edc848..be6febb3a8 100644 --- a/docs/contracts/v4/_category_.json +++ b/docs/contracts/v4/_category_.json @@ -1,5 +1,5 @@ { - "label": "V4 Protocol", + "label": "v4 Protocol", "position": 1, "collapsed": false } diff --git a/docs/contracts/v4/concepts/01-v4-vs-v3.mdx b/docs/contracts/v4/concepts/01-v4-vs-v3.mdx index 7171589090..f7d5ac5557 100644 --- a/docs/contracts/v4/concepts/01-v4-vs-v3.mdx +++ b/docs/contracts/v4/concepts/01-v4-vs-v3.mdx @@ -1,5 +1,5 @@ --- -title: V4 vs V3 +title: v4 vs v3 --- While Uniswap v4's underlying concentrated liquidity is the same as Uniswap v3, @@ -9,26 +9,26 @@ there are some key differences in the architecture and accounting. ### Pool Creation -**V4**: The singleton contract facilitates the creation of a pool and +**v4**: The singleton contract facilitates the creation of a pool and also stores its state. This pattern reduces costs when creating a pool and doing multi-hop swaps. Because pools are _contract state_ and not entirely new _contracts_ themselves, pool creation is significantly cheaper. -**V3**: A factory contract is responsible for pool creation. The pool is +**v3**: A factory contract is responsible for pool creation. The pool is a separate contract instance that manages its own state. Pool initialization is costly because contract creation is gas-intensive ### Flash Accounting -**V4**: The singleton uses _flash accounting_, meaning a caller that unlocks the PoolManager +**v4**: The singleton uses _flash accounting_, meaning a caller that unlocks the PoolManager is allowed to cause balance-changing operations (multiple swaps, multiple liquidity modifications, etc) and only needs to perform token transfers at the very end of the sequence. -**V3**: Because flash accounting is missing from V3, it is the responsibility +**v3**: Because flash accounting is missing from v3, it is the responsibility of the integrating contract to perform token transfers, after each individual call, to each individual pool contract # Liquidity Fee Accounting -**V4**: Accrued fees act like a credit when modifying liquidity. +**v4**: Accrued fees act like a credit when modifying liquidity. Increasing liquidity will convert the fee revenue to liquidity inside the position while decreasing liquidity will automatically require the withdrawal of unclaimed fee revenue. @@ -39,25 +39,25 @@ This separation may be preferred to simplify fee accounting. If two users share range and state in `PoolManager`, integrating contracts must be careful in managing fees -**V3**: Liquidity positions of the same range and pool will share the same state. While believed to +**v3**: Liquidity positions of the same range and pool will share the same state. While believed to be more gas efficient at the time, integrating contracts will need to handle fee management since the state is shared on the core pool contract # Native ETH -**V4**: Pool pairs support native tokens, in doing so ETH swappers and +**v4**: Pool pairs support native tokens, in doing so ETH swappers and liquidity providers benefit from gas cost reductions from cheaper transfers and removal of additional wrapping costs. -**V3**: ETH needs to be wrapped first before being paired with other tokens. +**v3**: ETH needs to be wrapped first before being paired with other tokens. This results in higher gas costs because of wrapping and transferring a wrapped native token. # Subscribers -Only V4: Owners can now set a subscriber for their positions. +Only v4: Owners can now set a subscriber for their positions. A subscriber contract will get notified every time the position's liquidity or owner changes. Subscribers enable staking / liquidity-mining, but users do not need to transfer their ERC-721 token. -**V3**: Staking in v3 requires users to transfer their ERC-721 token to a contract, putting the underlying assets at risk for malicious behavior. \ No newline at end of file +**v3**: Staking in v3 requires users to transfer their ERC-721 token to a contract, putting the underlying assets at risk for malicious behavior. \ No newline at end of file diff --git a/docs/contracts/v4/concepts/04-hooks.mdx b/docs/contracts/v4/concepts/04-hooks.mdx index 23d392c3ad..2aa8fef80e 100644 --- a/docs/contracts/v4/concepts/04-hooks.mdx +++ b/docs/contracts/v4/concepts/04-hooks.mdx @@ -2,7 +2,7 @@ title: Hooks --- -Uniswap V4 introduces Hooks, a system that allows developers to customize and extend the behavior of liquidity pools. +Uniswap v4 introduces Hooks, a system that allows developers to customize and extend the behavior of liquidity pools. Hooks are external smart contracts that can be attached to individual pools. Every pool can have one hook but a hook can serve an infinite amount of pools to intercept and modify the execution flow at specific points during pool-related actions. @@ -10,13 +10,13 @@ Hooks are external smart contracts that can be attached to individual pools. Eve ### Pool-Specific Hooks -- Each liquidity pool in Uniswap V4 can have its own hook contract attached to it. Hooks are optional for Uniswap V4 pools. +- Each liquidity pool in Uniswap v4 can have its own hook contract attached to it. Hooks are optional for Uniswap v4 pools. - The hook contract is specified when creating a new pool in the `PoolManager.initialize` function. - Having pool-specific hooks allows for fine-grained control and customization of individual pools. ## Core Hook Functions -Uniswap V4 provides a set of core hook functions that can be implemented by developers. Developers do not have to implement every hook, you can mix&match them to whatever your liking is. You can use one or all of them! +Uniswap v4 provides a set of core hook functions that can be implemented by developers. Developers do not have to implement every hook, you can mix&match them to whatever your liking is. You can use one or all of them! - Hook contracts specify the permissions that determine which hook functions they implement, which is encoded in the address of the contract. - The `PoolManager` uses these permissions to determine which hook functions to call for a given pool based on its Key. @@ -49,11 +49,11 @@ The liquidity modification hooks are extremely granular for security purposes. ## Innovation and Potential -The introduction of hooks in Uniswap V4 opens up a world of possibilities for developers to innovate and build new DeFi protocols. Some potential use cases include: +The introduction of hooks in Uniswap v4 opens up a world of possibilities for developers to innovate and build new DeFi protocols. Some potential use cases include: - Customized AMMs with different pricing curves than xy = k. - Yield farming and liquidity mining protocols that incentivize liquidity provision. -- Derivative and synthetic asset platforms built on top of Uniswap V4 liquidity. -- Lending hooks integrated with Uniswap V4 pools. +- Derivative and synthetic asset platforms built on top of Uniswap v4 liquidity. +- Lending hooks integrated with Uniswap v4 pools. As a hook developer you can easily bootstrap the codebase of an entirely new DeFi protocol through hook designs, which subsequently drives down your audit costs and allows you to develop faster. However, it's important to note that just because you made a hook, that does not mean you will get liquidity routed to your hook from the Uniswap frontend. diff --git a/docs/contracts/v4/concepts/06-PoolManager.mdx b/docs/contracts/v4/concepts/06-PoolManager.mdx index 660ed8ae3f..eeec8cd7e6 100644 --- a/docs/contracts/v4/concepts/06-PoolManager.mdx +++ b/docs/contracts/v4/concepts/06-PoolManager.mdx @@ -2,9 +2,9 @@ title: PoolManager --- -In Uniswap V3, each liquidity pool was represented by a separate smart contract deployed through the UniswapV3Factory contract. While this approach provided flexibility, it also led to increased gas costs for pool creation and multi-hop swaps. +In Uniswap v3, each liquidity pool was represented by a separate smart contract deployed through the Uniswapv3Factory contract. While this approach provided flexibility, it also led to increased gas costs for pool creation and multi-hop swaps. -Uniswap V4 addresses this issue by introducing the Singleton design pattern. The PoolManager contract now serves as a single entry point for all liquidity pools. Instead of deploying separate contracts for each pool, the pool state and logic are encapsulated within the PoolManager itself. +Uniswap v4 addresses this issue by introducing the Singleton design pattern. The PoolManager contract now serves as a single entry point for all liquidity pools. Instead of deploying separate contracts for each pool, the pool state and logic are encapsulated within the PoolManager itself. # Purpose @@ -12,14 +12,14 @@ The primary purpose of the `PoolManager` is to: - Efficiently manage liquidity pools - Facilitate token swaps -- Reduce gas costs compared to the factory-based approach in Uniswap V3 +- Reduce gas costs compared to the factory-based approach in Uniswap v3 - Enable extensibility through hooks # Architecture ## Singleton Design -- Uniswap V4 uses a Singleton design pattern for the `PoolManager` +- Uniswap v4 uses a Singleton design pattern for the `PoolManager` - All pool state and logic are encapsulated within the `PoolManager` contract ## Locking Mechanism diff --git a/docs/sdk/v1/_category_.json b/docs/sdk/v1/_category_.json index 754ace793b..6b448c16a1 100644 --- a/docs/sdk/v1/_category_.json +++ b/docs/sdk/v1/_category_.json @@ -1,5 +1,5 @@ { - "label": "V1 SDK", + "label": "v1 SDK", "position": 6, "collapsed": true } diff --git a/docs/sdk/v1/overview.md b/docs/sdk/v1/overview.md index 945c3e4240..b0939af94e 100644 --- a/docs/sdk/v1/overview.md +++ b/docs/sdk/v1/overview.md @@ -4,7 +4,7 @@ sidebar_position: 1 title: Overview --- -# The Uniswap V1 SDK +# The Uniswap v1 SDK -This is the original documentation for the Uniswap V1 SDK, released in 2019. -The Uniswap V1 SDK is no longer under development, for the most recent implementation of the SDK, see the [V3 SDK](../v3/overview.md). \ No newline at end of file +This is the original documentation for the Uniswap v1 SDK, released in 2019. +The Uniswap v1 SDK is no longer under development, for the most recent implementation of the SDK, see the [v3 SDK](../v3/overview.md). \ No newline at end of file diff --git a/docs/sdk/v2/_category_.json b/docs/sdk/v2/_category_.json index 3d94bdc773..ddfdb8479e 100644 --- a/docs/sdk/v2/_category_.json +++ b/docs/sdk/v2/_category_.json @@ -1,5 +1,5 @@ { - "label": "V2 SDK", + "label": "v2 SDK", "position": 5, "collapsed": true } diff --git a/docs/sdk/v3/_category_.json b/docs/sdk/v3/_category_.json index cf72316e0b..dd7a9fcea3 100644 --- a/docs/sdk/v3/_category_.json +++ b/docs/sdk/v3/_category_.json @@ -1,5 +1,5 @@ { - "label": "V3 SDK", + "label": "v3 SDK", "position": 1, "collapsed": false } diff --git a/docs/sdk/v3/overview.md b/docs/sdk/v3/overview.md index 6759fc15c6..7e9148ba3c 100644 --- a/docs/sdk/v3/overview.md +++ b/docs/sdk/v3/overview.md @@ -3,11 +3,11 @@ id: overview sidebar_position: 1 title: Overview --- -# The Uniswap V3 SDK +# The Uniswap v3 SDK -> **Welcome to the V3 Uniswap SDK!** +> **Welcome to the v3 Uniswap SDK!** -The Uniswap V3 SDK provides abstractions to assist you with interacting with the Uniswap V3 smart contracts in a Typescript/Javascript environment (e.g. websites, node scripts). It makes uses of the [**Core SDK**](../core/overview.md) to gain access to abstractions that are common amongst the Uniswap SDKs. With the SDK, you can manipulate data that has been queried from the [EVM](https://ethereum.org/en/developers/docs/evm/) using libraries that assist with needs such as data modeling, protection from rounding errors, and compile time enforced typing. +The Uniswap v3 SDK provides abstractions to assist you with interacting with the Uniswap v3 smart contracts in a Typescript/Javascript environment (e.g. websites, node scripts). It makes uses of the [**Core SDK**](../core/overview.md) to gain access to abstractions that are common amongst the Uniswap SDKs. With the SDK, you can manipulate data that has been queried from the [EVM](https://ethereum.org/en/developers/docs/evm/) using libraries that assist with needs such as data modeling, protection from rounding errors, and compile time enforced typing. To begin, we recommend looking at our [**Guides**](./guides/01-background.md) which include [runnable examples](https://github.com/Uniswap/examples/tree/main/v3-sdk) and walkthroughs of core usages. These guides will help you better understand how to use the SDK and integrate it into your application. @@ -15,7 +15,7 @@ For complete documentation of the SDK's offerings, see the [**Technical Referenc ## Installation -To interact with the V3 SDK we recommend installing though npm: +To interact with the v3 SDK we recommend installing though npm: ```bash npm i --save @uniswap/v3-sdk @@ -24,9 +24,9 @@ npm i --save @uniswap/sdk-core ## Developer Links -- [**V3 SDK Github Repo**](https://github.com/Uniswap/v3-sdk) +- [**v3 SDK Github Repo**](https://github.com/Uniswap/v3-sdk) - [**Core SDK Github Repo**](https://github.com/Uniswap/sdk-core) -- [**V3 SDK NPM Package**](https://www.npmjs.com/package/@uniswap/v3-sdk) +- [**v3 SDK NPM Package**](https://www.npmjs.com/package/@uniswap/v3-sdk) [![Unit Tests](https://github.com/Uniswap/uniswap-v3-sdk/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-v3-sdk/actions?query=workflow%3A%22Unit+Tests%22) [![Lint](https://github.com/Uniswap/uniswap-v3-sdk/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-v3-sdk/actions?query=workflow%3ALint) diff --git a/docusaurus.config.js b/docusaurus.config.js index bc0a5ae705..6ebf81af2a 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -68,20 +68,21 @@ module.exports = { className: 'persistent', }, { - label: 'Whitepaper', - to: 'https://uniswap.org/whitepaper-v3.pdf', + label: 'Uniswap Foundation', + to: 'https://www.uniswapfoundation.org/', position: 'right', className: 'persistent', }, + { - href: 'https://github.com/uniswap/uniswap-docs', - label: 'GitHub', + to: 'https://app.uniswap.org/whitepaper-v4.pdf', + label: 'Whitepaper', position: 'right', className: 'persistent', }, { - href: 'https://unigrants.org/', - label: 'Grants', + label: 'GitHub', + to: 'https://github.com/Uniswap/docs/', position: 'right', className: 'persistent', }, @@ -93,21 +94,21 @@ module.exports = { { title: 'Developers', items: [ + { + label: 'Dev Chat', + href: 'https://discord.com/invite/uniswap', + }, { label: 'Feedback', href: 'https://forms.gle/13XtjmkwdXQ2jMn26', }, { label: 'Bug Bounty', - href: 'https://github.com/Uniswap/uniswap-v3-periphery/blob/main/bug-bounty.md', - }, - { - label: '#dev-chat', - href: 'https://discord.com/invite/uniswap', + href: 'https://blog.uniswap.org/v4-bug-bounty', }, { label: 'Whitepaper', - href: 'https://uniswap.org/whitepaper-v3.pdf', + href: 'https://app.uniswap.org/whitepaper-v4.pdf', }, ], }, @@ -115,30 +116,26 @@ module.exports = { title: 'Github', items: [ { - label: 'uniswap-v3-core', - href: 'https://github.com/Uniswap/uniswap-v3-core', + label: 'uniswap-v4-core', + href: 'https://github.com/Uniswap/v4-core', }, { - label: 'uniswap-v3-sdk', - href: 'https://github.com/Uniswap/uniswap-v3-sdk', + label: 'uniswap-v4-sdk', + href: 'https://github.com/Uniswap/sdks/tree/main/sdks/v4-sdk', }, { - label: 'uniswap-v3-periphery', - href: 'https://github.com/Uniswap/uniswap-v3-periphery', + label: 'uniswap-v4-periphery', + href: 'https://github.com/Uniswap/v4-periphery', }, { label: 'Deployment addresses', - href: 'https://github.com/Uniswap/uniswap-v3-periphery/blob/main/deploys.md', + href: 'https://docs.uniswap.org/contracts/v4/deployments', }, ], }, { title: 'Ecosystem', items: [ - { - label: 'Home', - href: 'https://uniswap.org/', - }, { label: 'App', href: 'https://app.uniswap.org/', @@ -153,7 +150,7 @@ module.exports = { }, { label: 'Brand Assets', - href: 'https://uniswap.org/Uniswap_brand_assets.zip', + href: 'https://github.com/Uniswap/brand-assets/raw/main/Uniswap%20Brand%20Assets.zip', }, ], }, @@ -161,20 +158,20 @@ module.exports = { title: 'Community', items: [ { - label: 'Governance', - href: 'https://gov.uniswap.org/', + label: 'Blog', + href: 'https://blog.uniswap.org/', }, { - label: 'Discord', - href: 'https://discord.com/invite/uniswap', + label: 'Governance', + href: 'https://gov.uniswap.org/', }, { - label: 'Twitter', + label: 'Uniswap Labs Twitter', href: 'https://twitter.com/Uniswap', }, { - label: 'Blog', - href: 'https://uniswap.org/blog/', + label: 'Uniswap Foundation Twitter', + href: 'https://x.com/UniswapFND', }, ], }, diff --git a/src/components/SentimentTracking/index.tsx b/src/components/SentimentTracking/index.tsx index d1973d7ec3..62d42eccd4 100644 --- a/src/components/SentimentTracking/index.tsx +++ b/src/components/SentimentTracking/index.tsx @@ -60,7 +60,7 @@ export default function SentimentTracking({ analyticsSection }: { analyticsSecti (sentiment: Sentiment) => selectedSentiment && selectedSentiment === sentiment, [selectedSentiment] ) - + return ( Helpful? diff --git a/src/css/custom.css b/src/css/custom.css index 573f9115d6..32bcdea498 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -515,6 +515,18 @@ html[data-theme='dark'] .DocSearch-Hit a { text-align: right; } +.footnote-backref { + text-decoration: none; +} + +.footnote-backref:hover { + text-decoration: none; +} + +.footnote-backref { + font-family: system-ui; +} + /** * Copyright (c) Facebook, Inc. and its affiliates. * diff --git a/src/pages/index.tsx b/src/pages/index.tsx index f64570715c..5aed39af0d 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -7,6 +7,7 @@ import Discord from '@site/static/img/discord.svg' import GitHub from '@site/static/img/github.svg' import Npm from '@site/static/img/npm.svg' import UGP from '@site/static/img/UGP.png' + import Layout from '@theme/Layout' import ThemedImage from '@theme/ThemedImage' import { TraceEvent } from '@uniswap/analytics' @@ -44,30 +45,25 @@ export const actions = [ export const developerLinks = [ { - title: 'uniswap-v3-core', - href: 'https://github.com/Uniswap/uniswap-v3-core', + title: 'uniswap-v4-core', + href: 'https://github.com/Uniswap/v4-core/', icon: GitHub, }, { - title: 'uniswap-v3-sdk', - href: 'https://github.com/Uniswap/uniswap-v3-sdk', + title: 'uniswap-v4-periphery', + href: 'https://github.com/Uniswap/v4-periphery', icon: GitHub, }, { - title: 'uniswap-v3-periphery', - href: 'https://github.com/Uniswap/uniswap-v3-periphery', + title: 'uniswap-v4-sdk', + href: 'https://github.com/Uniswap/sdks/tree/main/sdks/v4-sdk', icon: GitHub, }, { title: 'Deployment addresses', - href: 'https://github.com/Uniswap/uniswap-v3-periphery/blob/main/deploys.md', + href: '/contracts/v4/deployments', icon: GitHub, }, - { - title: 'widgets', - href: 'https://www.npmjs.com/package/@uniswap/widgets', - icon: Npm, - }, ] export const dAppGuides = [ @@ -468,7 +464,9 @@ export default function Home() { > - + + +

Discord

Join our Developer Community.

@@ -518,7 +516,7 @@ export default function Home() { margin: '0 auto 4rem auto', width: '100%', }} - href={'https://unigrants.org/'} + href={'https://uniswapfoundation.org/'} >
-

Uniswap Grants Program

+

Uniswap Foundation Grants

- Uniswap Governance offers grant funding for people who are building apps, tools, and activities for - Uniswap Protocol users, builders, and community members.{' '} + In pursuit of a more open and fair financial system, the Uniswap Foundation supports the growth, decentralization, and sustainability of the Uniswap community.{' '}

diff --git a/src/theme/DocBreadcrumbs.tsx b/src/theme/DocBreadcrumbs.tsx index 12f900d6f1..e455e09a96 100644 --- a/src/theme/DocBreadcrumbs.tsx +++ b/src/theme/DocBreadcrumbs.tsx @@ -25,4 +25,4 @@ export default function DocBreadcrumbs(props) { ) -} +} \ No newline at end of file diff --git a/src/theme/DocBreadcrumbs/index.tsx b/src/theme/DocBreadcrumbs/index.tsx new file mode 100644 index 0000000000..5eed0ff767 --- /dev/null +++ b/src/theme/DocBreadcrumbs/index.tsx @@ -0,0 +1,82 @@ +import React, {type ReactNode} from 'react'; +import { + ThemeClassNames, + useSidebarBreadcrumbs, + useHomePageRoute, +} from '@docusaurus/theme-common'; +import Link from '@docusaurus/Link'; +import useBaseUrl from '@docusaurus/useBaseUrl'; +import clsx from 'clsx'; +import styles from './styles.module.css'; + +function BreadcrumbsItemLink({ + children, + href, +}: { + children: ReactNode; + href?: string; +}): JSX.Element { + const className = clsx('breadcrumbs__link', styles.breadcrumbsItemLink); + return href ? ( + + {children} + + ) : ( + {children} + ); +} + +function BreadcrumbsItem({ + children, + active, +}: { + children: ReactNode; + active?: boolean; +}): JSX.Element { + return ( +
  • + {children} +
  • + ); +} + +function HomeBreadcrumbItem() { + const homeHref = useBaseUrl('/'); + return ( + + Home + + ); +} + +export default function DocBreadcrumbs(): JSX.Element | null { + const breadcrumbs = useSidebarBreadcrumbs(); + const homePageRoute = useHomePageRoute(); + + if (!breadcrumbs) { + return null; + } + + return ( + + ); +} \ No newline at end of file diff --git a/src/theme/DocBreadcrumbs/styles.module.css b/src/theme/DocBreadcrumbs/styles.module.css new file mode 100644 index 0000000000..5a6ae7127f --- /dev/null +++ b/src/theme/DocBreadcrumbs/styles.module.css @@ -0,0 +1,15 @@ +.breadcrumbsContainer { + margin-bottom: 0.8rem; + } + + .breadcrumbsItemLink { + text-decoration: none; + font-size: 0.9rem; /* Texto más pequeño */ + color: var(--ifm-color-primary); /* Color del tema */ + opacity: 0.8; /* Un poco más sutil */ + } + + .breadcrumbsItemLink:hover { + opacity: 1; + text-decoration: none; + } \ No newline at end of file diff --git a/src/theme/DocPaginator.tsx b/src/theme/DocPaginator.tsx index 306752f928..63edfed0a7 100644 --- a/src/theme/DocPaginator.tsx +++ b/src/theme/DocPaginator.tsx @@ -12,9 +12,9 @@ const SentimentTrackingContainer = styled.div` export default function DocPaginator(props) { return ( <> - + {/* - + */} ) diff --git a/static/img/UGP.png b/static/img/UGP.png index dcca90f39b..1c79dafd5f 100644 Binary files a/static/img/UGP.png and b/static/img/UGP.png differ diff --git a/static/img/discord.svg b/static/img/discord.svg index 520b0053c8..f9fd918b3f 100644 --- a/static/img/discord.svg +++ b/static/img/discord.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file