# Common Operations

These operations work across all LP tokens (ZLP, SLP, USDZ).

### Data / read operations

Use the API or DataAPI; the methods are the same.

```typescript
const zlpMarket = await zlpAPI.valuateMarket()
const slpMarket = await slpAPI.getMarketInfo()
const vaultInfo = await usdzAPI.getVaultInfo('usdc')
const positionCaps = await zlpAPI.getPositionCapInfoList(ownerAddress)
const positions = await zlpAPI.getPositionInfoList(positionCaps, ownerAddress)
```

### Deposit

```typescript
const depositTx = await zlpAPI.deposit(
  'usdc',             // coin type
  ['coinObjectId'],   // coin object IDs
  1000000,            // amount
  0,                  // minimum amount out (optional)
  'referralAddress',  // optional referral
  'senderAddress'     // optional sender
)
const slpDepositTx = await slpAPI.deposit('usdc', ['coinObjectId'], 1000000)
const usdzDepositTx = await usdzAPI.deposit('usdc', ['coinObjectId'], 1000000)
```

### Withdraw

```typescript
const withdrawTx = await zlpAPI.withdraw(
  'usdc',
  ['lpCoinObjectId'],
  1000000,
  0
)
```

### Swap

```typescript
const swapTx = await zlpAPI.swap(
  'usdc',             // from token
  'sui',              // to token
  BigInt(1000000),    // amount
  ['coinObjectId']    // coin objects
)
```
