For the complete documentation index, see llms.txt. This page is also available as Markdown.

Sensei strategies

Our sensei strategies are based on NFT holdings. Each user can only get one NFT and it is used to describe their position. The NFT ID of a user is simply their address in felt/number format.

starknetjs.num.getDecimalString(hexAddress)

Functions

  1. Deposit:

deposit(amount: u256, receiver: ContractAddress);
  1. Withdraw:

withdraw(amount: u256, receiver: ContractAddress, max_slippage_bps: u32);
  1. Get stratregy config

config() -> StrategyConfig

interface StrategyConfig {
    // this is the token used by user to make the deposit (e.g. ETH)
    main_token: ContractAddress,
    main_offset: u128, // decimal offset used to handle shares
    // internal token used by strategy to do looping (e.g. USDC)
    secondary_token: ContractAddress,
    secondary_offset: u128
}
  1. Get holdings by user address:

Last updated