> For the complete documentation index, see [llms.txt](https://docs.troves.fi/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.troves.fi/p/developers/integrations/sensei-strategies.md).

# 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.&#x20;

```javascript
starknetjs.num.getDecimalString(hexAddress)
```

### Functions

1. **Deposit:**

```
deposit(amount: u256, receiver: ContractAddress);
```

2. **Withdraw:**

```
withdraw(amount: u256, receiver: ContractAddress, max_slippage_bps: u32);
```

3. **Get stratregy config**

```javascript
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
}
```

4. **Get holdings by user address:**

```javascript
let token_id = starknetjs.num.getDecimalString(userAddr);
let position = strategyContract.describe_position(token_id);

// Expected output:
// @returns (Position, PositionDescription)

// Position shows the shares of user relative to other user positions
// Each share corresponds to one step of the looping action (i.e. supply/borrow)
interface Position {
  acc1_supply_shares: u256,
  acc1_borrow_shares: u256,
  acc2_supply_shares: u256,
  acc2_borrow_shares: u256
}

interface PositionDescription {
  // shows the expected value of user position in main token terms
  // This is probably the most important value a user cares
  estimated_size: u256,
  // below show the split of holdings in respective token terms
  deposit1: u256, // in main token
  borrow1: u256, // in secondary token (used to loop)
  deposit2: u256, // in secondary token
  borrow2: u256, // in main token
}
```
