### Open Borrow Position Example with WETH Source: https://docs.dolomite.io/developer-documentation/managing-borrow-positions.md This example demonstrates opening a borrow position by transferring WETH as collateral and then borrowing USDC. It shows how to get market IDs and use `openBorrowPosition` and `transferBetweenAccounts`. ```solidity uint256 usdcMarketId = DOLOMITE_MARGIN.getMarketIdByTokenAddress(address(usdc)); uint256 wethMarketId = DOLOMITE_MARGIN.getMarketIdByTokenAddress(address(weth)); // This call to openBorrowPosition will transfer 1 WETH from account number 0 // to account number 123. BorrowPositionRouter.openBorrowPosition( /* _fromAccountNumber = */ 0, /* _toAccountNumber = */ 123, /* _marketId = */ wethMarketId, /* _amount = */ 1 ether, /* _balanceCheckFlag = */ BalanceCheckFlag.From ); // This call to transferBetweenAccounts will transfer 100 USDC from account number // 123 to account number 0. Account number 123 will now have 1 WETH and -100 USDC BorrowPositionRouter.transferBetweenAccounts( /* _isolationModeMarketId = */ 0, /* _fromAccountNumber = */ 123, /* _toAccountNumber = */ 0, /* _marketId = */ usdcMarketId, /* _amount = */ 100e6, /* _balanceCheckFlag = */ BalanceCheckFlag.To ); ``` -------------------------------- ### Query Campaign Guide Documentation Source: https://docs.dolomite.io/campaign-guides/zap-your-eth-campaign.md Use this GET request to ask questions about the campaign guide. Include a specific question in the 'ask' parameter and an optional broader objective in the 'goal' parameter. ```http GET https://docs.dolomite.io/campaign-guides/zap-your-eth-campaign.md?ask=&goal= ``` -------------------------------- ### Open Borrow Position Example with GLP Source: https://docs.dolomite.io/developer-documentation/managing-borrow-positions.md This example shows how to open a borrow position using GLP as collateral and borrowing USDC. It highlights obtaining the market ID for a specific token address and managing transfers between accounts. ```solidity uint256 usdcMarketId = DOLOMITE_MARGIN.getMarketIdByTokenAddress(address(usdc)); address dfsGlp = 0x34DF4E8062A8C8Ae97E3382B452bd7BF60542698; uint256 glpMarketId = DOLOMITE_MARGIN.getMarketIdByTokenAddress(dfsGlp); // This call to openBorrowPosition will transfer 1 GLP from account number 0 // to account number 123. BorrowPositionRouter.openBorrowPosition( /* _fromAccountNumber = */ 0, /* _toAccountNumber = */ 123, /* _marketId = */ glpMarketId, /* _amount = */ 1 ether, /* _balanceCheckFlag = */ BalanceCheckFlag.From ); // This call to transferBetweenAccounts will transfer 100 USDC from account number // 123 of the isolation mode vault to account number 0 for the user. // Account number 123 of the isolation mode vault will have 1 GLP and -100 USDC // Account number 0 for the user will have +100 USDC BorrowPositionRouter.transferBetweenAccounts( /* _isolationModeMarketId = */ glpMarketId, /* _fromAccountNumber = */ 123, /* _toAccountNumber = */ 0, /* _marketId = */ usdcMarketId, /* _amount = */ 100e6, /* _balanceCheckFlag = */ BalanceCheckFlag.To ); ``` -------------------------------- ### Query Documentation with GET Request Source: https://docs.dolomite.io/campaign-guides.md Use this GET request to query the documentation dynamically. Include your specific question in the 'ask' parameter and an optional 'goal' parameter to tailor the response. ```http GET https://docs.dolomite.io/campaign-guides.md?ask=&goal= ``` -------------------------------- ### Discord Proposal Template Example Source: https://docs.dolomite.io/dolomite-governance.md An example of a full proposal formatted for Discord, covering emissions distribution adjustments. ```markdown # Title [DIP-02] Adjust oDOLO Emissions Distribution Across Chains & Assets # Author(s) Dolomite Team # Date 2025-08-13 # Related Discussions None # Simple Summary This proposal updates the chain-level and asset-level distribution of oDOLO emissions. It reallocates emissions to account for the launch of Botanix and adjusts existing weights to balance incentives across chains and assets. # Abstract Currently, oDOLO emissions are allocated across Arbitrum, Berachain, and Ethereum. This proposal modifies the chain distribution to add Botanix and adjust weights on the existing chains. It also updates the internal asset distribution on Berachain to include BYUSD and rebalance existing asset weights. # Motivation & Background * Support the launch and growth of Botanix by allocating a portion of emissions to its assets. * Give greater support to the growth of liquidity on Abitrum. * Introduce BYUSD to the Berachain rewards mix to deepen stablecoin liquidity. * Maintain a diversified allocation to reduce reliance on any single asset or chain. # Specification **Chain-Level Distribution** **Old:** * Arbitrum - 20% * Berachain - 45% * Ethereum - 35% **New:** * Arbitrum - 30% * Berachain - 35% * Ethereum - 30% * Botanix - 5% **Botanix Sub-Allocation** * BTC - 66.66% of Botanix emissions * USDC.e - 33.33% of Botanix emissions **Berachain Sub-Allocation** **Old:** * HONEY - 22.22% * USDC - 22.22% * BERA - 22.22% * WBTC - 16.66% * ETH - 16.66% **New:** * HONEY - 20% * USDC - 20% * BERA - 20% * WBTC - 15% * ETH - 15% * BYUSD - 10% # Economic & Market Impact * **Botanix Growth:** Allocation will bootstrap liquidity and trading activity on Botanix. * **Stablecoin Depth:** BYUSD inclusion strengthens Berachain’s stablecoin market. * **Liquidity Shifts:** Arbitrum had been receiving a lower share of oDOLO incentives, but with continued strong activity around GM assets, this update seeks to deepen borrowing liquidity and protocol growth on Arbitrum. # Risks & Considerations * Reduced emissions to Berachain and Ethereum may affect growth and liquidity. * Botanix is a newer and less proven chain, so utilizing incentives there has the risk of less return in TVL. * BYUSD market depth and stability should be monitored to avoid concentration risk. # Implementation Plan * Update emissions distribution in rewards smart contracts. * Update the UI to reflect the incentives available on Botanix. * Announce the changes to the community with effective date. # Success Criteria & Metrics * Change in TVL of affected assets and chains # Additional Information & References * [Dolomite DOLO Mechanics Documentation](https://docs.dolomite.io/dolo/token-mechanics) ``` -------------------------------- ### Query Documentation with GET Request Source: https://docs.dolomite.io/guide/strategies.md Use this GET request to ask specific questions about the documentation. Include a 'goal' parameter to tailor the response to a broader objective. The response includes direct answers and supporting documentation excerpts. ```http GET https://docs.dolomite.io/guide/strategies.md?ask=&goal= ``` -------------------------------- ### Install Dolomite TypeScript Client Source: https://docs.dolomite.io/developer-documentation/typescript-client.md Install the Dolomite TypeScript client using npm or yarn. ```shell npm i -s @dolomite-exchange/dolomite ``` ```shell yarn add @dolomite-exchange/dolomite ``` -------------------------------- ### Example: Withdraw 1 WETH as ETH from default account Source: https://docs.dolomite.io/developer-documentation/depositing-or-withdrawing.md This example shows how to withdraw 1 WETH and have it automatically unwrapped to native ETH from account number 0. ```solidity DepositWithdrawalRouter.withdrawPayable( /* isolationModeMarketId = */ 0, /* fromAccountNumber = */ 0, /* amountWei = */ 1 ether, EventFlag.None ); ``` -------------------------------- ### Query Documentation Index via HTTP GET Source: https://docs.dolomite.io/oarb-incentives-program Use this GET request to ask specific questions about the documentation. The 'ask' parameter is required for your query, and the 'goal' parameter is optional for tailoring the response. ```http GET https://docs.dolomite.io/deprecated/oarb-incentives-program.md?ask=&goal= ``` -------------------------------- ### Example: Withdraw 1 WETH from default account Source: https://docs.dolomite.io/developer-documentation/depositing-or-withdrawing.md This example demonstrates withdrawing 1 WETH from account number 0. It first retrieves the `marketId` for WETH. ```solidity uint256 marketId = DOLOMITE_MARGIN.getMarketIdByTokenAddress(address(WETH)); DepositWithdrawalRouter.withdrawWei( /* isolationModeMarketId = */ 0, /* fromAccountNumber = */ 0, /* marketId = */ marketId, /* amountWei = */ 1 ether, EventFlag.None ); ``` -------------------------------- ### Dolomite Liquidity and Borrowing Example Source: https://docs.dolomite.io/dolomite.md This example illustrates how user actions affect Dolomite's overall balances, including supplied and borrowed amounts, and the resulting utilization rate. It highlights how internal trading can mitigate the impact of borrowing on utilization rates. ```text User A balances: +1 ETH in sub account 0 User B balances: +0.1 ETH in sub account 0 +1,000 USDT in sub account 0 Dolomite overall balances: +1.1 ETH supplied +1,000 USDT supplied 0 USDT borrowed Utilization rate of USDT: 0% Actions: 1. User A transfers 1 ETH as collateral to sub account 1 from sub account 0 2. User A transfers 100 USDT from sub account 1 to sub account 0. Since User A had a balance of 0 in sub account 1, their balance moves into a borrowed state. Sub account 0 receives the funds. User A balances: 0 ETH in sub account 0 +100 USDT in sub account 0 +1 ETH in sub account 1 -100 USDT in sub account 1 Dolomite overall balances: +1.1 ETH supplied +1,100 USDT supplied -100 USDT borrowed Utilization rate of USDT: 9.09% Post Actions: If User A decides to withdraw the +100 USDT from sub account 0, that would push the utilization toward 10% (supplied amount would be +1,000 USDT and borrowed amount would still be -100 USDT). However, if Dolomite had competitive internal liquidity for trading the USDT, it would keep the ERC20 tokens internalized to the system and would keep utilization lower! Why is that? If User A trades the +100 USDT with User B's 0.1 ETH, the net balance of ETH and USDT remain the same from the overall perspective of Dolomite. (+1.1 ETH, +1,100 USDT, -100 USDT). ``` -------------------------------- ### Example: Withdraw 1 GLP from default account (Isolation Mode) Source: https://docs.dolomite.io/developer-documentation/depositing-or-withdrawing.md This example demonstrates withdrawing 1 GLP, an isolation mode asset, from the default account. Note that the token address used is the Dolomite DFSGLP factory address. ```solidity // The token address will be the Dolomite DFSGLP factory address, NOT the glp address address dfsGlp = 0x34DF4E8062A8C8Ae97E3382B452bd7BF60542698; uint256 marketId = DOLOMITE_MARGIN.getMarketIdByTokenAddress(dfsGlp); DepositWithdrawalRouter.withdrawWei( /* fromAccountNumber = */ 0, /* marketId = */ marketId, /* amountWei = */ 1 ether, EventFlag.None ); ``` -------------------------------- ### Discord Proposal Template for Treasury Operations Source: https://docs.dolomite.io/dolomite-governance.md An example proposal formatted for Discord, detailing a treasury operation involving borrowing and supplying assets across chains for arbitrage. ```markdown # Title [DIP-03] Use Treasury as Collateral to Borrow $500k of WBTC on Berachain, Then Supply on Arbitrum # Author(s) Dolomite Team # Date 2025-08-29 # Related Discussions N/A # Simple Summary This proposal would use treasury USDC.e on Berachain as collateral to borrow WBTC, then bridge that WBTC to Arbitrum to supply on Dolomite. The goals are to arbitrage the rates (low to borrow on Berachain, high to supply on Arbitrum) and increase available borrow liquidity on Arbitrum to support further gmBTC and gmBTC-USD looping. # Abstract Dolomite’s treasury currently holds several million dollars of stablecoins on Berachain, accumulated from the options airdrop and oDOLO execution. This proposal would utilize those stablecoins from the treasury that are already on Dolomite on Berachain as collateral to borrow $500k of WBTC, which would then be bridged to Arbitrum to be supplied on Dolomite there. This will arbitrage the rates across chains, borrowing where rates are cheap on Berachain (0.27% APR at time of writing) and supplying where rates are high on Arbitrum (3.13% APR at time of writing), earning yield for the protocol. Additionally, this will increase lending yield for WBTC suppliers on Berachain, and by boosting the supply of WBTC on Arbitrum, borrow rates will decrease, allowing for more borrowing to perform gmBTC and gmBTC-USD looping strategies. This increases protocol activity, grows TVL, and strengthens Dolomite’s positioning as the premier protocol on Arbitrum for those interested in BTC. # Motivation & Background ``` -------------------------------- ### Query Documentation with Agent Source: https://docs.dolomite.io/dolomite-governance.md Use this GET request to query the documentation dynamically. Include your specific question in the `ask` parameter and an optional broader goal in the `goal` parameter. ```http GET https://docs.dolomite.io/dolomite-governance.md?ask=&goal= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.dolomite.io/bug-bounty.md Use this GET request to ask questions about the documentation. Include your specific question in the 'ask' parameter and an optional broader goal in the 'goal' parameter. ```http GET https://docs.dolomite.io/bug-bounty.md?ask=&goal= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.dolomite.io/integrations/berachain-proof-of-liquidity.md Use this endpoint to ask questions about the documentation. Include your specific question in the `ask` parameter and an optional broader goal in the `goal` parameter for tailored responses. ```bash GET https://docs.dolomite.io/integrations/berachain-proof-of-liquidity.md?ask=&goal= ``` -------------------------------- ### Query Documentation Index Source: https://docs.dolomite.io/llms.txt Use this GET request to ask a specific question about the documentation. The `ask` parameter is required for the immediate question, and the optional `goal` parameter helps tailor the answer to a broader objective. ```http GET https://docs.dolomite.io/community-xp.md?ask=&goal= ``` -------------------------------- ### Get Liquidation Spread for Pair (Arbiscan) Source: https://docs.dolomite.io/risk-management.md Use the `getLiquidationSpreadForPair` function on Arbiscan to check the liquidation penalty for a specific pair of assets. Input `heldMarketId` and `owedMarketId` and divide the result by `1e18` to get the penalty percentage. ```solidity function getLiquidationSpreadForPair(uint heldMarketId, uint owedMarketId) external view returns (uint) ``` -------------------------------- ### Query Documentation Index with Ask and Goal Parameters Source: https://docs.dolomite.io/integrations/gmx-glp Use this GET request to ask specific questions about documentation content. The 'ask' parameter is required for the immediate question, and the 'goal' parameter is optional for tailoring the answer to a broader objective. ```http GET https://docs.dolomite.io/integrations/gmx/glp.md?ask=&goal= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.dolomite.io/dolo/borrow-fee-rebates.md Use this GET request to ask questions about the documentation when the answer is not explicitly present. Include your specific question in the 'ask' parameter and optionally describe your broader goal in the 'goal' parameter. ```http GET https://docs.dolomite.io/dolo/borrow-fee-rebates.md?ask=&goal= ``` -------------------------------- ### Example: Withdraw 1 WETH from account 123 (Isolation Mode GLP Vault) Source: https://docs.dolomite.io/developer-documentation/depositing-or-withdrawing.md This example shows withdrawing 1 WETH from account number 123 within a GLP isolation mode token vault. It requires specifying both the GLP market ID and the WETH market ID. ```solidity // The token address will be the Dolomite DFSGLP factory address, NOT the glp address address dfsGlp = 0x34DF4E8062A8C8Ae97E3382B452bd7BF60542698; uint256 glpMarketId = DOLOMITE_MARGIN.getMarketIdByTokenAddress(dfsGlp); uint256 wethMarketId = DOLOMITE_MARGIN.getMarketIdByTokenAddress(address(WETH)); DepositWithdrawalRouter.withdrawWei( /* isolationModeMarketId = */ glpMarketId /* fromAccountNumber = */ 123, /* marketId = */ wethMarketId, /* amountWei = */ 1 ether, EventFlag.From ); ``` -------------------------------- ### Query Documentation with AI Agent Source: https://docs.dolomite.io/dolo/airdrop.md Perform an HTTP GET request to query the documentation dynamically. Use the `ask` parameter for your specific question and the optional `goal` parameter to specify your broader objective. ```http GET https://docs.dolomite.io/dolo/airdrop.md?ask=&goal= ``` -------------------------------- ### LogOperation Event Source: https://docs.dolomite.io/developer-documentation/dolomite-margin-events.md This event is emitted at the start of an operation, logging the address of the caller. ```APIDOC ## LogOperation Event ### Description This event is emitted at the start of an operation. ### Event Signature ```solidity event LogOperation( address sender ); ``` ### Parameters * `sender` (`address`): The address of the caller of DolomiteMargin who performed the operation. ``` -------------------------------- ### LogOperation Event Signature Source: https://docs.dolomite.io/developer-documentation/dolomite-margin-events.md Emitted at the start of an operation, logging the address of the caller. ```solidity event LogOperation( address sender ); ``` -------------------------------- ### Get Number of Markets with Debt Source: https://docs.dolomite.io/developer-documentation/dolomite-margin-getters.md Retrieves the count of markets where an account has a negative balance. Requires an Account.Info struct as input. ```solidity library Account { struct Info { address owner; uint256 number; } } function getAccountNumberOfMarketsWithDebt(Account.Info calldata account) external view returns (uint256); ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.dolomite.io/developer-documentation/dolomite-margin-dtokens.md Perform an HTTP GET request to query the documentation dynamically. Use the 'ask' parameter for your question and optionally the 'goal' parameter for your broader objective. ```bash GET https://docs.dolomite.io/developer-documentation/dolomite-margin-dtokens.md?ask=&goal= ``` -------------------------------- ### Get DolomiteMargin Owner Address Source: https://docs.dolomite.io/developer-documentation/dolomite-margin-getters.md Retrieves the address of the current owner of the DolomiteMargin contract. This function is useful for administrative or ownership-related checks. ```solidity function owner() external view returns (address); ``` -------------------------------- ### Get Market Total Par Source: https://docs.dolomite.io/developer-documentation/dolomite-margin-getters.md Retrieves the total principal amounts (borrowed and supplied) for a specified market. Returns a Types.TotalPar struct. ```solidity library Types { struct TotalPar { uint128 borrow; uint128 supply; } } function getMarketTotalPar(uint256 marketId) external view returns (Types.TotalPar memory); ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.dolomite.io/markets.md Use this endpoint to ask questions about the documentation. The 'ask' parameter is mandatory for specifying your question, and 'goal' is optional for providing broader context. ```http GET https://docs.dolomite.io/markets.md?ask=&goal= ``` -------------------------------- ### Get Number of Markets Source: https://docs.dolomite.io/developer-documentation/dolomite-margin-getters.md Retrieves the total count of markets available in the system. This function returns a uint256 representing the number of markets. ```solidity function getNumMarkets() external; ``` -------------------------------- ### Query GitBook Documentation Source: https://docs.dolomite.io/guide/pool.md Use this endpoint to ask questions about the documentation. Provide a specific question in the 'ask' parameter and an optional broader goal in the 'goal' parameter to tailor the response. ```http GET https://docs.dolomite.io/guide/pool.md?ask=&goal= ``` -------------------------------- ### Get Market Price Source: https://docs.dolomite.io/developer-documentation/dolomite-margin-getters.md Retrieves the price of a token for a given market. The price is returned as a Monetary.Price struct, standardized to 36 decimals. ```solidity library Monetary { /* * The price of a base-unit of an asset. Has `36 - token.decimals` decimals */ struct Price { uint256 value; } } function getMarketPrice(uint256 marketId) external view returns (Monetary.Price memory); ``` -------------------------------- ### Get Account Status (Solidity) Source: https://docs.dolomite.io/developer-documentation/dolomite-margin-getters.md Retrieves the current status (Normal, Liquidating, or Vaporizing) of an account. Requires the account's info. ```solidity library Account { struct Info { address owner; uint256 number; } enum Status { Normal, Liquid, Vapor } } function getAccountStatus(Account.Info calldata account) external view returns (Account.Status); ``` -------------------------------- ### Querying Documentation via HTTP GET Source: https://docs.dolomite.io/smart-contract-addresses/module-dolo.md Use this endpoint to ask questions about the documentation when the answer is not explicitly present. The `ask` parameter is mandatory for specifying the question, and the `goal` parameter is optional for providing broader context. ```http GET https://docs.dolomite.io/smart-contract-addresses/module-dolo.md?ask=&goal= ``` -------------------------------- ### Get Market Price Oracle Address Source: https://docs.dolomite.io/developer-documentation/dolomite-margin-getters.md Retrieves the address of the price oracle associated with a specific market. Returns an IPriceOracle interface type. ```solidity function getMarketPriceOracle(uint256 marketId) external view returns (IPriceOracle); ``` -------------------------------- ### Ask a Question via Documentation API Source: https://docs.dolomite.io/different-networks Use this GET request to query the documentation index with a specific question and an optional broader goal. The response includes a direct answer and relevant sources. ```http GET https://docs.dolomite.io/guide/switching-networks.md?ask=&goal= ``` -------------------------------- ### Get Number of Markets with Balances (Solidity) Source: https://docs.dolomite.io/developer-documentation/dolomite-margin-getters.md Retrieves the count of markets that have a non-zero balance for a given account. Requires the account's info. ```solidity library Account { struct Info { address owner; uint256 number; } } function getAccountNumberOfMarketsWithBalances(Account.Info calldata account) external view returns (uint256); ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.dolomite.io/guide/stats.md Use this method to ask questions about the documentation when the answer is not explicitly present on the current page. The 'ask' parameter is mandatory for specifying your question, and 'goal' is optional for providing broader context. ```http GET https://docs.dolomite.io/guide/stats.md?ask=&goal= ```