From 49025cbe0d9f40a5eaf867a329dc5ab14ca01118 Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Sun, 10 Dec 2023 21:08:53 +0200 Subject: [PATCH 1/6] fix typos __init__.md --- .../observability/etl/dataflow-etls/dataflow_etls/__init__.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.autodoc/docs/markdown/observability/etl/dataflow-etls/dataflow_etls/__init__.md b/.autodoc/docs/markdown/observability/etl/dataflow-etls/dataflow_etls/__init__.md index ffdf36835..bf78cfa58 100644 --- a/.autodoc/docs/markdown/observability/etl/dataflow-etls/dataflow_etls/__init__.md +++ b/.autodoc/docs/markdown/observability/etl/dataflow-etls/dataflow_etls/__init__.md @@ -6,7 +6,7 @@ The `MarginAccount` class has several attributes, including `account_id`, `balan The `MarginAccount` class also has several methods, including `deposit`, `withdraw`, `open_position`, and `close_position`. The `deposit` method is used to add funds to the account, while `withdraw` is used to remove funds. The `open_position` method is used to open a new position in the account, while `close_position` is used to close an existing position. -Overall, the `MarginAccount` class is an important component of the marginfi-v2 project, as it provides a way to manage margin accounts for financial trading. Here is an example of how the `MarginAccount` class might be used in the larger project: +Overall, the `MarginAccount` class is an important component of the marginfi-v2 project, as it provides a way to manage margin accounts for financial trading. Here is an example of how the `MarginAccount` class might be used in a larger project: ``` # Create a new margin account @@ -31,4 +31,4 @@ account.withdraw(2000) 2. What is the expected input format for the `cost` and `price` parameters? - It is not specified in the code what the expected input format is for `cost` and `price`. It is recommended to add comments or documentation to clarify this. 3. Are there any potential edge cases or error scenarios that the function does not handle? - - It is not clear from the code if the function handles scenarios where `cost` or `price` are negative or zero. It is recommended to add error handling or documentation to address these scenarios. \ No newline at end of file + - It is not clear from the code if the function handles scenarios where `cost` or `price` are negative or zero. It is recommended to add error handling or documentation to address these scenarios. From 282e379ae6fca54b8e127e86149004d1f3a65524 Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Sun, 10 Dec 2023 21:11:40 +0200 Subject: [PATCH 2/6] fix typos create_events.md --- .../observability/etl/dataflow-etls/scripts/create_events.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.autodoc/docs/markdown/observability/etl/dataflow-etls/scripts/create_events.md b/.autodoc/docs/markdown/observability/etl/dataflow-etls/scripts/create_events.md index cd194f08a..b0e473ca3 100644 --- a/.autodoc/docs/markdown/observability/etl/dataflow-etls/scripts/create_events.md +++ b/.autodoc/docs/markdown/observability/etl/dataflow-etls/scripts/create_events.md @@ -8,7 +8,7 @@ The script then adds a USDC bank to the group using the `mfi group add-bank` com After adding the USDC bank, the script configures the SOL bank using the `mfi bank update` command. This command sets the asset and liability weights for the bank to 1, which means that the bank will always be fully utilized. -The script then performs a series of actions to simulate a liquidation event. It creates a new MarginFi account for a liquidatee, deposits SOL and USDC into the appropriate banks, borrows USDC, and then triggers a bad health event by setting the SOL asset weights to 0. This causes the liquidatee's account to become undercollateralized, and the script simulates a liquidation by having a liquidator create a new MarginFi account, deposit USDC to pay off the liquidatee's debt, and then liquidate the liquidatee's account for half its assets. Finally, the script handles the remainder of the bad debt through the `mfi group handle-bankruptcy` command. +The script then performs a series of actions to simulate a liquidation event. It creates a new MarginFi account for a liquidated, deposits SOL and USDC into the appropriate banks, borrows USDC, and then triggers a bad health event by setting the SOL asset weights to 0. This causes the liquidatee's account to become undercollateralized, and the script simulates a liquidation by having a liquidator create a new MarginFi account, deposit USDC to pay off the liquidatee's debt, and then liquidate the liquidatee's account for half its assets. Finally, the script handles the remainder of the bad debt through the `mfi group handle-bankruptcy` command. Overall, this script is a useful tool for testing the MarginFi-v2 project and simulating various scenarios, such as liquidations and bankruptcies. It could be customized to test different configurations and scenarios, and could be integrated into a larger testing framework for the project. ## Questions: @@ -22,4 +22,4 @@ Overall, this script is a useful tool for testing the MarginFi-v2 project and si 3. What actions are being simulated in this script? - This script simulates a user lending USDC, creating a new MarginFi account, depositing SOL, borrowing USDC, triggering bad health by setting SOL asset weights to 0, liquidating a MarginFi account, and handling bad debt through bankruptcy. \ No newline at end of file + This script simulates a user lending USDC, creating a new MarginFi account, depositing SOL, borrowing USDC, triggering bad health by setting SOL asset weights to 0, liquidating a MarginFi account, and handling bad debt through bankruptcy. From 883e71a01a5bd025ca3db63a190871ff180e4c20 Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Sun, 10 Dec 2023 21:15:45 +0200 Subject: [PATCH 3/6] fix typos errors.md --- .../programs/liquidity-incentive-program/src/errors.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.autodoc/docs/markdown/programs/liquidity-incentive-program/src/errors.md b/.autodoc/docs/markdown/programs/liquidity-incentive-program/src/errors.md index 1af1a8172..29da66094 100644 --- a/.autodoc/docs/markdown/programs/liquidity-incentive-program/src/errors.md +++ b/.autodoc/docs/markdown/programs/liquidity-incentive-program/src/errors.md @@ -20,11 +20,11 @@ fn deposit_funds(amount: u64) -> ProgramResult { } ``` -In this example, the deposit_funds function checks if the deposit amount is greater than a maximum allowed amount. If it is, the function returns an error using the DepositAmountTooLarge variant of the LIPError enum. This error can then be handled by the calling code in a consistent way, regardless of where the error occurred in the project. +In this example, the deposit_funds function checks if the deposit amount is greater than the maximum allowed amount. If it is, the function returns an error using the DepositAmountTooLarge variant of the LIPError enum. This error can then be handled by the calling code in a consistent way, regardless of where the error occurred in the project. ## Questions: 1. What is the purpose of the `LIPError` enum? - The `LIPError` enum is used to define custom error codes for the `marginfi-v2` project. 2. What are the possible error messages that can be returned by this code? - The possible error messages are "Campaign is not active", "Deposit amount is too large", and "Deposit hasn't matured yet". 3. What is the significance of the `#[error_code]` attribute? - - The `#[error_code]` attribute is used to mark the `LIPError` enum as an error code enum, which allows it to be used with the `anchor_lang` crate's error handling system. \ No newline at end of file + - The `#[error_code]` attribute is used to mark the `LIPError` enum as an error code enum, which allows it to be used with the `anchor_lang` crate's error handling system. From 9fc2503111522bbe420650954d2d4a5dbd8e140a Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Sun, 10 Dec 2023 21:22:35 +0200 Subject: [PATCH 4/6] fix typos README.md --- programs/liquidity-incentive-program/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/liquidity-incentive-program/README.md b/programs/liquidity-incentive-program/README.md index 6ebc5869d..cf90835c7 100644 --- a/programs/liquidity-incentive-program/README.md +++ b/programs/liquidity-incentive-program/README.md @@ -44,7 +44,7 @@ Think of a `Campaign` as a marketing campaign: * the maximum amount of user deposits allowed * The maximum rewards to be paid out to users (together with the maximum amount of deposits allowed, this calculates the guaranteed fixed yield). -> NOTE: LIP works off of the concept of a _minimum_ guaranteed yield, but depositors may earn higher yield if marginfi's native lender yield for the related asset exceeds the yield guaranteed by the `Campaign`. This is a win-win for depositors. +> NOTE: LIP works off of the concept of a _minimum_ guaranteed yield, but depositors may earn a higher yield if marginfi's native lender yield for the related asset exceeds the yield guaranteed by the `Campaign`. This is a win-win for depositors. 3. As a proof of reward reserves, campaign creators **lock up maximum rewards to be paid out upon campaign creation**, making it easy for campaign depositors to know the source of yield. From 5c593ab5fc8b0a152138731f5be2a0f4ab49cff2 Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Sun, 10 Dec 2023 21:23:42 +0200 Subject: [PATCH 5/6] fix typos README.md --- programs/marginfi/fuzz/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/marginfi/fuzz/README.md b/programs/marginfi/fuzz/README.md index 9b7ccc9d0..8b4c19efb 100644 --- a/programs/marginfi/fuzz/README.md +++ b/programs/marginfi/fuzz/README.md @@ -22,7 +22,7 @@ The framework directly invokes the functions that are normally invoked by the on The framework uses a bump allocator for account storage. All `AccountInfo` objects are referencing data in the bump allocator. -When an instruction is invoked we direct pass in the `AccountInfo` objects referencing allocated state. +When an instruction is invoked we directly pass in the `AccountInfo` objects referencing allocated state. Before the invoke we also copy to a local cache and revert the state if the instructions fail. ### Actions From b37048be5f049ac921a3a9885ca9f3a3ae9cdb78 Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Fri, 15 Dec 2023 18:02:23 +0200 Subject: [PATCH 6/6] Update create_events.md --- .../observability/etl/dataflow-etls/scripts/create_events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.autodoc/docs/markdown/observability/etl/dataflow-etls/scripts/create_events.md b/.autodoc/docs/markdown/observability/etl/dataflow-etls/scripts/create_events.md index b0e473ca3..f3c0a10a6 100644 --- a/.autodoc/docs/markdown/observability/etl/dataflow-etls/scripts/create_events.md +++ b/.autodoc/docs/markdown/observability/etl/dataflow-etls/scripts/create_events.md @@ -8,7 +8,7 @@ The script then adds a USDC bank to the group using the `mfi group add-bank` com After adding the USDC bank, the script configures the SOL bank using the `mfi bank update` command. This command sets the asset and liability weights for the bank to 1, which means that the bank will always be fully utilized. -The script then performs a series of actions to simulate a liquidation event. It creates a new MarginFi account for a liquidated, deposits SOL and USDC into the appropriate banks, borrows USDC, and then triggers a bad health event by setting the SOL asset weights to 0. This causes the liquidatee's account to become undercollateralized, and the script simulates a liquidation by having a liquidator create a new MarginFi account, deposit USDC to pay off the liquidatee's debt, and then liquidate the liquidatee's account for half its assets. Finally, the script handles the remainder of the bad debt through the `mfi group handle-bankruptcy` command. +The script then performs a series of actions to simulate a liquidation event. It creates a new MarginFi account for a liquidatee, deposits SOL and USDC into the appropriate banks, borrows USDC, and then triggers a bad health event by setting the SOL asset weights to 0. This causes the liquidatee's account to become undercollateralized, and the script simulates a liquidation by having a liquidator create a new MarginFi account, deposit USDC to pay off the liquidatee's debt, and then liquidate the liquidatee's account for half its assets. Finally, the script handles the remainder of the bad debt through the `mfi group handle-bankruptcy` command. Overall, this script is a useful tool for testing the MarginFi-v2 project and simulating various scenarios, such as liquidations and bankruptcies. It could be customized to test different configurations and scenarios, and could be integrated into a larger testing framework for the project. ## Questions: