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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.troves.fi/p/developers/integrations/sensei-strategies.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
