Summary
Adds Drift and Solend support for P0, enabling Drift and Solend (aka "Save") positions to be used as collateral for borrowing on P0!
Removes deprecated Arena features.
Reduce-only banks no longer count towards borrowing power. Existing account health is not affected, only new borrows.
Adds compliance functionality for AML or similar requests, enabling the administrator to freeze accounts if e.g. served with a court order demanding it. Our foundation is committed not to freeze any account unless legally ordered to do.
Terminology Notes
Drift calls their Bank-equivalent "Markets" and Solend calls them "Reserves". A "Bank" on P0 tracks a single Drift Market or Solend Reserve, much like Kamino banks track a single Kamino Reserve.
Changes since rc1
Changed the way integration accounts are stored on the Bank (see changes to Bank below)
Changes since rc2
- Fixed a bug where the price cache wasn't being updated for Drift/Solend banks
- Minor doc updates, updated terms of security policy
- Minor logging improvements
Breaking Changes
Liquidators and other parties that index all banks must now accommodate for Drift and Solend banks. To detect if a Bank uses a Kamino, Drift, or Solend integration, check the config.asset_tag, and then read integration_acc_1/2/3 to get the associated Reserve, Obligation, etc as needed.
If you were using the kamino_reserve or kamino_obligation fields, note that the names have changed (see Updated Fields, but they are in the same location in the buffer.
Instructions
New Instructions (users)
- drift_deposit - deposit collateral to a drift bank to be used as collateral on P0.
- drift_withdraw - withdraw collateral from a drift position
- solend_deposit - - deposit collateral to a solend bank to be used as collateral on P0.
- solend_withdraw - withdraw collateral from a solend position
- (permissionless) lending_pool_pulse_bank_price_cache - refresh a bank's price cache, enabling read-only viewing of the price currently observed by the bank from its oracle (note: all instructions that consume prices now also update the same cached value).
New Instructions (admin only)
- (admin) lending_pool_add_bank_drift - create a new drift bank
- (permissionless) drift_init_user - called after
lending_pool_add_bank_driftto complete Drift bank configuration. - (permissionless) drift_harvest_reward - shifts earned Drift rewards into the admin's global fee wallet to be distributed to depositors OTC
- (admin) lending_pool_add_bank_solend - create a new solend bank
- solend_init_obligation - called after
lending_pool_add_bank_solendto complete Solend bank configuration. - (admin) set_account_freeze - toggle freeze on/off. Frozen accounts are unable to perform any action that modifies their balances. The admin will use this to comply with court-ordered legal obligations e.g. AML.
Changes to Existing Instructions (users)
None
Changes to Existing Instructions (admin only)
- initialize_group - removed
is_arena_grouparg - configure - removed
is_arena_grouparg, addedemode_max_init_leverageandemode_max_maint_leverage.
Updated Fields
MarginfiGroup
- emode_max_init_leverage/emode_max_maint_leverage - controls the maximum allowed leverage used in emode for all banks in this group. Used to ensure even the emode admin is unable to accidentally set "infinite" or "under-collateralized" leverage.
Bank
- integration_acc_1 (formerly kamino_reserve) - For Drift banks, the associated Market. For Solend banks, the associated Reserve. For Kamino banks, also the associated Reserve. For all other bank types, does nothing.
- integration_acc_2 (formerly kamino_obligation) - For Drift banks, the associated user account, which all depositors into this bank share. For Solend banks, the associated Obligation, which all depositors into this bank share. For Kamino banks, also the associated Obligation. For all other bank types, does nothing.
- integration_acc_3 - for Drift banks, the associated user stats, which all depositors into this bank share. For all other bank types, does nothing.
Bank.cache
For any instruction which consumes a price, the bank caches now stores that last-used price for better read-only insight into the price used by a Bank. If a Bank's timestamp is sufficiently recent, lazy consumers can use these values of lieu of fetching an actual price, but should not treat it as authoritative once the Bank's last updated timestamp is sufficiently old.
- last_oracle_price
- last_oracle_price_timestamp
- last_oracle_price_confidence
MarginfiAccount
- account_flags - added
ACCOUNT_FROZENoption (1 << 6)
Notes on Drift Rewards
Drift rewards paid in the same token (e.g. USDS rewards for the USDS Market) are automatically credited to depositors at the program level, no special claim instruction is required. Drift rewards paid in a different token (E.g. JTO incentives for the SOL Market), as well as special rewards which Drift itself might "admin deposit" directly to accounts as part of various campaigns, are sent to the administrator's fee wallet, and will be distributed to users like other incentives (typically via weekly airdrop). We will announce how FUEL incentives will be handled at a later date.
Consolidates
Audits
See attached
Release Times
Staging - ~Jan 20
Mainnet - Jan 27 @ 11AM ET