> ## Documentation Index
> Fetch the complete documentation index at: https://shield.fi/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Entry-point signatures

> Current core and router functions grouped by role.

This page summarizes the ABI at contract source commit `b66d4f2`. The Leo source remains authoritative for tuple order and visibility.

## Core administration

| Function                    | Public inputs                                          | Output  |
| --------------------------- | ------------------------------------------------------ | ------- |
| `transfer_admin`            | `new_admin: address`                                   | `Final` |
| `accept_admin`              | none                                                   | `Final` |
| `add_tick_spacing`          | `tick_spacing: u32`                                    | `Final` |
| `add_fee_tier`              | `fee: u16`                                             | `Final` |
| `bind_fee_to_tick_spacing`  | `fee: u16`, `tick_spacing: u32`                        | `Final` |
| `set_pool_enabled`          | `pool_key: field`, `enabled: bool`                     | `Final` |
| `set_pool_creation_is_open` | `is_open: bool`                                        | `Final` |
| `set_global_paused`         | `paused: bool`                                         | `Final` |
| `allow_token`               | `token_id: field`, `underlying_token_id: field`        | `Final` |
| `set_token_paused`          | `token_id: field`, `paused: bool`                      | `Final` |
| `set_pair_paused`           | `token0_id: field`, `token1_id: field`, `paused: bool` | `Final` |
| `freeze_position`           | `token_id: field`                                      | `Final` |
| `unfreeze_position`         | `token_id: field`                                      | `Final` |
| `set_fee_protocol`          | `pool_key: field`, `fee_protocol: u8`                  | `Final` |
| `collect_protocol`          | pool, requested amounts, token IDs, recipient          | `Final` |

`allow_token` is a one-time operation. Pass the same ID twice for a plain ARC-20. Pass distinct wrapper and underlying IDs for a wrapped asset.

## Core pool and position lifecycle

```text theme={"languages":{"custom":["/languages/leo.tmLanguage.json"]}}
create_pool(
  public token0_program_id: field,
  public token1_program_id: field,
  public fee: u16,
  public initial_sqrt_price: u256::U256,
  public tick_spacing: u32,
  public initial_tick: i32
) -> (public field, public address, Final)
```

```text theme={"languages":{"custom":["/languages/leo.tmLanguage.json"]}}
mint(
  private nonce: field,
  token0_record: dyn record,
  token1_record: dyn record,
  private recipient: address,
  private withdrawal: address,
  public request: MintPositionRequest,
  public token0_id: field,
  public token1_id: field,
  signer_merkle_proofs: [MerkleProof; 2],
  recipient_merkle_proofs: [MerkleProof; 2],
  withdrawal_merkle_proofs: [MerkleProof; 2]
) -> (public field, PositionNFT, dyn record, dyn record, MintComplianceRecord, Final)
```

`decrease_liquidity(PositionNFT, public liquidity_to_remove, public amount0_min, public amount1_min)` returns a public token ID, a replacement `PositionNFT`, and `Final`.

`increase_liquidity(PositionNFT, two token records, public desired and minimum amounts, public token IDs, public tick hints)` returns a public token ID, a replacement `PositionNFT`, two change records, and `Final`.

`collect(PositionNFT, public requested amounts, public token IDs, owner proofs, withdrawal proofs)` returns a replacement `PositionNFT`, two token records, and `Final`. It always pays the immutable `withdrawal` address in the NFT.

`burn(PositionNFT)` returns the public token ID and `Final`.

## Core trading

`swap(token record, private factor, public confidential address, pool, direction, amount, minimum output, Q128.128 price limit, nonce, block-height deadline, token IDs)` returns a public swap ID, a change record, a `SwapComplianceRecord`, and `Final`.

`swap_multi_hop(private factor, public confidential address, token record, endpoint tokens, amount, minimum output, three hop slots, hop count, nonce, block-height deadline)` returns a public swap ID, a change record, a `MultiHopSwapComplianceRecord`, and `Final`. The finalizer accepts hop counts of two or three.

`claim_swap_output(private factor, public confidential address, swap ID, input token, output token, output amount, remaining input amount, freezelist proofs)` returns output and refund records plus `Final`. The same claim function settles single-hop and multi-hop swaps.

## Core views

| Function                       | Purpose                                                        |
| ------------------------------ | -------------------------------------------------------------- |
| `view_sqrt_price_at_tick_x128` | Convert a tick to Q128.128 square-root price                   |
| `view_swap_iteration`          | Run one initialized-tick walk step                             |
| `view_mul_div`                 | Run full-width multiply-divide with selected rounding          |
| `resolve_stored_tick`          | Resolve the half-open stored tick after a bounded fill         |
| `view_bounded_partial`         | Fill up to the next tick or price limit and return a remainder |

## Swap router

`shield_swap_router.aleo` exposes:

* `swap_from_wrapped`
* `swap_mh_from_wrapped`
* `claim_to_wrapped_refund_arc20`
* `claim_to_arc20_refund_wrapped`
* `claim_to_wrapped_refund_wrapped`

## LP router

`shield_swap_lp_router.aleo` exposes:

* `mint_from_wrapped_arc20`, `mint_from_arc20_wrapped`, `mint_from_wrapped_wrapped`
* `increase_from_wrapped_arc20`, `increase_from_arc20_wrapped`, `increase_from_wrapped_wrapped`
* `collect_to_wrapped_arc20`, `collect_to_arc20_wrapped`, `collect_to_wrapped_wrapped`
* `collect_protocol_wrapped`, `collect_protocol_both_wrapped`

Router functions unwrap or wrap the asset side that requires an adapter. They call the same core state machine and are not separate liquidity venues.
