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

# Use a Strategy

> Select an existing strategy or mandate a bespoke one for your Conduit

This guide walks you through deploying a strategy for your Conduit. By the end, you will have a fully deployed strategy ecosystem that you own and control, with authorized yield sources ready for an asset manager to operate.

<Note>
  If you are an asset manager deploying your own Strategy, see [Create an Allocation Strategy](/strategies/allocation/create) instead.
</Note>

## Prerequisites

* A wallet with funds — the deposit asset (e.g. USDC) for the initial deposit and ETH for gas
* The `FACTORY_SPAWN` role on the Multi-Vehicle factory (or access to a public factory)
* The factory must not be deprecated

<Steps>
  <Step title="Deploy External Access Control (EAC)">
    The EAC is the central permission contract for your entire strategy. As the Conduit owner, you are the initial admin — you control who can do what across all contracts.

    Set `initialDelay` to a non-zero value (e.g. 48 hours) for production deployments. This protects admin transfers with a time delay.

    <CodeGroup>
      ```solidity Solidity theme={null}
      ExternalAccessControlFactory.SpawnParams memory params = ExternalAccessControlFactory.SpawnParams({
          initialDelay: 48 hours,              // Time-delayed admin transfer for security
          initialDefaultAdmin: platformAdmin,   // Your platform's admin address (use multisig)
          initialRoles: new ExternalAccessControlFactory.RoleAttribution[](0),
          deploymentSalt: keccak256("platform-eac-v1")
      });

      ExternalAccessControl eac = eacFactory.spawn(params);
      ```

      ```typescript TypeScript theme={null}
      // Coming soon
      ```
    </CodeGroup>

    <Tip>
      Use a multisig wallet (e.g. Safe) as the `initialDefaultAdmin`. This is the most privileged role in the system — it can grant and revoke any role.
    </Tip>
  </Step>

  <Step title="Deploy Fee Manager">
    Configure the fee structure for your strategy. You control fee rates, max caps, and recipient splits through the Fee Manager.

    <CodeGroup>
      ```solidity Solidity theme={null}
      FeeManagerFactory.SpawnParams memory params = FeeManagerFactory.SpawnParams({
          accessControl: externalAccessControl,
          initialFees: FeeManager.Fees({
              performanceFeeBps: 1000,  // 10% performance fee
              managementFeeBps: 200,    // 2% annual management fee
              depositFeeBps: 0,
              redeemFeeBps: 0
          }),
          initialMaxFees: FeeManager.Fees({
              performanceFeeBps: 2000,  // 20% max
              managementFeeBps: 500,    // 5% max
              depositFeeBps: 100,       // 1% max
              redeemFeeBps: 100         // 1% max
          }),
          initialRecipients: recipients,  // See "Configure fees" for recipient setup
          deploymentSalt: keccak256("platform-fee-manager-v1")
      });

      FeeManager feeManager = feeManagerFactory.spawn(params);
      ```

      ```typescript TypeScript theme={null}
      // Coming soon
      ```
    </CodeGroup>

    <Warning>
      `initialMaxFees` are immutable — they can never be increased. Set them high enough to allow future adjustments, but low enough to provide guarantees to users.
    </Warning>

    See [Fee Manager reference](/developers/contracts/fee-manager) for detailed guidance on fee calculation formulas and recipient setup.
  </Step>

  <Step title="Approve the initial deposit">
    Every strategy deployment requires an initial deposit as a security measure to prevent inflation attacks. The amount is configured per asset in the [AssetRegistry](/developers/contracts/asset-registry), and the shares minted from this deposit are sent to the burn address.

    <CodeGroup>
      ```solidity Solidity theme={null}
      uint256 initialDepositAmount = assetRegistry.getInitialDepositAmount(usdc);
      IERC20(usdc).approve(address(multiVehicleFactory), initialDepositAmount);
      ```

      ```typescript TypeScript theme={null}
      // Coming soon
      ```
    </CodeGroup>
  </Step>

  <Step title="Deploy the Strategy">
    Deploy the full strategy ecosystem in a single transaction. The factory creates five interconnected contracts — all correctly linked and initialized.

    <CodeGroup>
      ```solidity Solidity theme={null}
      MultiVehicleFactory.SpawnParams memory params = MultiVehicleFactory.SpawnParams({
          asset: IERC20(usdc),
          name: "Platform Yield Strategy",
          symbol: "pYLD",
          initialInterceptions: new Interceptor.Interception[](0),
          accessControl: externalAccessControl,
          feeManager: feeManager,
          modulesManager: modulesManager,
          salts: MultiVehicleFactory.Salts({
              multiVehicle: keccak256("mv"),
              queryRedeemQueue: keccak256("qrq"),
              queueStrategyEngine: keccak256("qse"),
              sectorAccountingEngine: keccak256("sae"),
              subQueryEngine: keccak256("sqe"),
              vehicleRegistry: keccak256("vr"),
              initialDepositQuery: keccak256("idq")
          }),
          initialExpectedSupply: 1e18
      });

      MultiVehicleFactory.Contracts memory contracts = factory.spawn(params);
      ```

      ```typescript TypeScript theme={null}
      // Coming soon
      ```
    </CodeGroup>
  </Step>

  <Step title="Authorize yield sources">
    Decide which yield sources your strategy can use. Only authorized yield sources can receive assets from the strategy. This is one of the key guardrails you control as the Conduit owner.

    **Requires:** `MULTI_VEHICLE_SET_VEHICLE_AUTHORIZATION` role scoped to the Sector Accounting Engine.

    <CodeGroup>
      ```solidity Solidity theme={null}
      ISectorAccountingEngine accounting = contracts.multiVehicle.accountingEngine();

      // Grant yourself the authorization role
      eac.grantScopedRole(
          keccak256("MULTI_VEHICLE_SET_VEHICLE_AUTHORIZATION"),
          address(accounting),
          platformAdmin
      );

      // Authorize yield sources for your strategy
      accounting.syncVehicleActivationStatus(aaveVehicle, true);
      accounting.syncVehicleActivationStatus(compoundVehicle, true);
      ```

      ```typescript TypeScript theme={null}
      // Coming soon
      ```
    </CodeGroup>

    <Info>
      The Vehicle Registry validates that yield sources use the same base asset as the strategy and implement the STEAM standard as `SingleAsset` vehicles.
    </Info>
  </Step>

  <Step title="Verify the deployment">
    Confirm your strategy is correctly deployed and configured.

    <CodeGroup>
      ```solidity Solidity theme={null}
      address multiVehicle = address(contracts.multiVehicle);

      // Verify the asset
      address asset = MultiVehicle(multiVehicle).asset();

      // Verify the total supply (should reflect initial deposit)
      uint256 totalSupply = MultiVehicle(multiVehicle).totalSupply();

      // Verify the accounting engine link
      ISectorAccountingEngine accounting = MultiVehicle(multiVehicle).accountingEngine();
      ```

      ```typescript TypeScript theme={null}
      // Coming soon
      ```
    </CodeGroup>

    You can also verify via the Railnet subgraph:

    ```graphql theme={null}
    query VerifyDeployment($address: String!) {
      Vehicle(where: { address: { _ilike: $address } }) {
        address
        id
        name
        vehicleType
        symbol
        supply
      }
    }
    ```
  </Step>
</Steps>

## What you deployed

| Contract                     | Purpose                                                          |
| ---------------------------- | ---------------------------------------------------------------- |
| **External Access Control**  | Central permission system — you are the admin                    |
| **Fee Manager**              | Fee collection and distribution — you set the structure          |
| **Multi-Vehicle**            | Main Strategy contract — users deposit and receive ERC-20 shares |
| **Sector Accounting Engine** | Tracks all asset allocations across yield sources                |
| **Queue Strategy Engine**    | Deposit and redeem priority manager                              |
| **Sub Query Engine**         | Yield source query executor                                      |
| **Query Redeem Queue**       | Asynchronous redemption handler                                  |

## The platform journey

<Steps>
  <Step title="Deploy your strategy">
    You just completed this step — your strategy is deployed with access control and fee infrastructure.
  </Step>

  <Step title="Configure fees and revenue distribution">
    Set up fee rates, max caps, and recipient splits for your strategy. You can also add Conduit-level distribution fees when you deploy your Conduit.

    [Configure Conduit fees](/conduits/configure-fees) · [Fee Manager reference](/developers/contracts/fee-manager)
  </Step>

  <Step title="Delegate to an asset manager">
    Define the mandate terms, grant operational roles, and set guardrails — while retaining control over yield source authorization, fees, and admin access.

    [Mandate a strategy](/conduits/mandate-a-strategy)
  </Step>

  <Step title="Distribute via your Conduit">
    Once your strategy is running, deploy a Conduit to let your users access it through your platform's interface.

    [Quick start](/conduits/quick-start)
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Configure fees" icon="percent" href="/conduits/configure-fees">
    Set up fee structures and revenue distribution for your Conduit.
  </Card>

  <Card title="Mandate a strategy" icon="handshake" href="/conduits/mandate-a-strategy">
    Define guardrails and delegate operations to an asset manager.
  </Card>
</CardGroup>
