Integration Guide
ProgramId: FL3X2pRsQ9zHENpZSKDRREtccwJuei8yg9fwDu9UN69Q
All information for a Lulo account is stored and routed through the UserAccount, which is a PDA that is derived from the owner's wallet address:
export function getFlexUserAccountAddress(owner: PublicKey, programId: PublicKey) {
return PublicKey.findProgramAddressSync(
[Buffer.from('flexlend'), owner.toBuffer()],
programId, // FL3X2pRsQ9zHENpZSKDRREtccwJuei8yg9fwDu9UN69Q
)[0]
}
The Lulo userAccount
has authority over the deposited funds in each integrated protocol. For Drift, and Kamino, the authority transfers over directly to the respective user accounts at those protocols.
For Solend and MarginFi, you can find the corresponding Lulo obligation accounts by parsing the userAccount
using the below IDL:
#[account]
pub struct UserAccount {
pub bump: u8,
pub _padding: [u8; 7],
// wallet address that owns this UserAccount
pub owner: Pubkey,
// the marginFi userAccount which this UserAccount has authority
pub mfi_account: Pubkey,
// the solend obligation which this UserAccount has authority
pub solend_obligation: Pubkey,
// 2x Points lift metadata
pub promotion_seeds: [PromotionSeed; 4],
pub _padding2: [u64; 12],
}