Skip to content

Releases: mrgnlabs/marginfi-v2

mrgn - 0.1.2

14 Mar 19:43
Compare
Choose a tag to compare

Summary of New Features

  • Implied anchor args everywhere - TS consumers rejoice, no more having to pass every account the instruction requires. Most instructions now require only a handful of accounts, and infer the rest.
  • Deposit up to limit - pass a flag to deposit up to the bank's deposit cap. No more guessing if a bank has capacity.
  • Permissionless incentives - program-level support to designate a wallet that can receive your earned incentives without any input from you. We'll crank users that opt-in on a regular basis, so no more missing out on rewards because you forgot to claim them (front end for this is coming soon at a date TBD)
  • Logging improvements everywhere
  • Health pulse instruction to view internal account health
  • Preparations for Arena permissionless pools launch

Breaking Changes

  • account.lending_account.balances[n] is now a u8 instead of bool (0 = false, 1 = true)
  • MarginfiAccount padding now split into padding0 and padding1
  • BankConfig padding now split into padding0 and padding1
  • Almost all instructions are now modified to use implied anchor args. Some argument names have changed (e.g. marginfi_group -> group), but order is maintained. This should be non-breaking to Rust clients passing simple account meta, but may be breaking to TS clients passing account manually, or to CPI consumers. All accounts that have undergone a name change will now be inferred and can be omitted. Use accountsPartial as a fallback if this fails.
  • deposit instruction now accepts one additional argument (an Option<bool>) to flag if the depositor wants to deposit up to the bank's available limit. Actual deposit will be min(amount specified in deposit arg, deposit limit remaining in bank)
  • Various Stale Oracle and Illegal Liquidation errors now emit a more specific custom error. Update is only required if you were checking for a specific error code.
  • marginfiGroupInitialize now takes an admin and a bool arg (true to set as an arena group)
  • marginfiGroupConfigure now takes an admin and a bool arg (true to set as an arena group)
  • MarginfiGroup now has a banks field which tracks the number of banks created under that group

New Instructions

  • marginfi_account_update_emissions_destination_account - allows a user to designate a wallet where their earned emissions can be permissionlessly withdrawn into. Users who do not opt into this feature can only withdraw manually
  • lending_account_withdraw_emissions_permissionless - a permissionless ix that withdraws emissions into an account users chose when they opted into permissionless emissions.
  • lending_account_health_pulse - a permissionless ix that caches the internal health information computed by the risk engine. Fetch the user account and read the health_cache to see information about prices used, net asset and liability prices, etc.

New Logging

  • On risk engine failure, now anchor logs various internal information.
  • Many new error messages, replacing existing generic errors like StaleOracle and IllegalLiquidation
  • On any add or config instruction (add bank, configure group, configure bank, etc) now echos the settings being changed in anchor logs

Known Bugs/limitations

  • group.banks only tracks the number of banks created after 0.1.2 goes live
  • Groups created prior to the 0.1.2 update can be incorrectly configured as arena groups since we do not count banks created prior to that update.
    • Since this basically only affects the mrgn-owned main group and mrgn-owned Arena group used for testing, this is a non-issue. We will, prior to Arena launch, double check that there are no other affected groups.

Deployment details

Deployed staging: March 14, 2025 ~3:00pm ET (hash 65bbbe)
Deployed mainnet: TBD

mrgn - 0.1.1

07 Feb 14:04
b702db2
Compare
Choose a tag to compare

Same as 0.1.0, but includes the bugfix from 0.1.0-alpha. Begins version numbering, hurray!

BREAKING

  • Some Liquidation instruction arguments renamed. Rust consumers that are simply passing meta should not have issues.
  • Liquidation of staked collateral positions requires passing remaining accounts differently than most banks, with two additional oracle accounts required. See the s07_liquidate test for an example.
  • Add bank, add bank with seed, and configure bank no longer configure oracle settings, fixing an issue with these instructions in Squads. Use configure_bank_oracle. If not using squads, you can pack this into the same tx. Note:
    • Bank Config no longer has oracle setup
    • OracleSetup::None is now a possible variant to encounter (previously was an impossible state). This state should be transient, but all consumers should handle it without error

Hash: 03455c

Deployed staging: Feb 7, 2025 ~8:15am ET
Deployed mainnet: Feb 17, 2025 ~3:00pm ET

0.1.0-alpha bugfix Feb 3 2025

03 Feb 19:48
Compare
Choose a tag to compare

Fixes a minor bug in pricing of staked collateral assets that was allowing the irrecoverable 1 SOL spent to open the pool to be counted as potential collateral.

hash: ea5d15

Staging deploy time: never
Mainnet deploy time: Feb 3, 2025 @ ~2:30 ET

0.1.0 Jan-Feb 2025

30 Jan 19:56
2c5a752
Compare
Choose a tag to compare

Fixes some minor bugs in staked collateral features and some issues when configuring oracle settings with squads.

Verifiable hash: a4dd3e7

BREAKING

  • Some Liquidation instruction arguments renamed. Rust consumers that are simply passing meta should not have issues.
  • Liquidation of staked collateral positions requires passing remaining accounts differently than most banks, with two additional oracle accounts required. See the s07_liquidate test for an example.
  • Add bank, add bank with seed, and configure bank no longer configure oracle settings, fixing an issue with these instructions in Squads. Use configure_bank_oracle. If not using squads, you can pack this into the same tx. Note:
    • Bank Config no longer has oracle setup
    • OracleSetup::None is now a possible variant to encounter (previously was an impossible state). This state should be transient, but all consumers should handle it without error

marginfi-program-v1.0.0

11 Sep 14:21
d33e649
Compare
Choose a tag to compare

Support for Switchboard Pull oracle feeds