{
  "x402Version": 2,
  "id": 72558,
  "slug": "saylorinnovations-api-crypto-rebalance",
  "resource": "https://saylorinnovations.com/api/crypto/rebalance",
  "description": "Buy and sell amounts that bring a crypto portfolio to target weights, with optional new cash, drift band and fees, plus turnover and the biggest drift.",
  "type": "http",
  "serviceName": "Saylor Innovations Data Desk",
  "mimeType": "application/json",
  "resourceType": "API",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0xA2A8dF0f7CaaBEa4e120a2568118f141569fc8aa",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "eip155:137",
      "payTo": "0xA2A8dF0f7CaaBEa4e120a2568118f141569fc8aa",
      "asset": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "eip155:42161",
      "payTo": "0xA2A8dF0f7CaaBEa4e120a2568118f141569fc8aa",
      "asset": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "7LSjfrJf8fNsB8VA9u7N3WEn25smQLpob3SvyUvXacy7",
      "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "7LSjfrJf8fNsB8VA9u7N3WEn25smQLpob3SvyUvXacy7",
      "asset": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "7LSjfrJf8fNsB8VA9u7N3WEn25smQLpob3SvyUvXacy7",
      "asset": "So11111111111111111111111111111111111111112",
      "amount": "95830",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    }
  ],
  "outputSchema": {
    "type": "object",
    "properties": {
      "total_value_usd": {
        "type": "number",
        "description": "Portfolio value including new cash"
      },
      "new_cash_usd": {
        "type": "number",
        "description": "Cash added or withdrawn"
      },
      "drift_band_percent": {
        "type": "number",
        "description": "Drift tolerance used"
      },
      "assets": {
        "type": "array",
        "description": "Per-asset current state and trade",
        "items": {
          "type": "object",
          "properties": {
            "symbol": {
              "description": "Asset symbol",
              "type": [
                "string",
                "null"
              ]
            },
            "current_usd": {
              "description": "Current value",
              "type": [
                "number",
                "null"
              ]
            },
            "current_weight_percent": {
              "description": "Current share of the portfolio",
              "type": [
                "number",
                "null"
              ]
            },
            "target_weight_percent": {
              "description": "Target share",
              "type": [
                "number",
                "null"
              ]
            },
            "target_usd": {
              "description": "Target value",
              "type": [
                "number",
                "null"
              ]
            },
            "drift_percent_points": {
              "description": "Target weight minus current weight",
              "type": [
                "number",
                "null"
              ]
            },
            "action": {
              "description": "buy, sell or hold",
              "type": [
                "string",
                "null"
              ]
            },
            "trade_usd": {
              "description": "Amount to trade (negative means sell)",
              "type": [
                "number",
                "null"
              ]
            }
          }
        }
      },
      "total_to_buy_usd": {
        "type": "number",
        "description": "Sum of buys"
      },
      "total_to_sell_usd": {
        "type": "number",
        "description": "Sum of sells"
      },
      "turnover_percent": {
        "type": "number",
        "description": "Share of the portfolio traded"
      },
      "estimated_fees_usd": {
        "type": "number",
        "description": "Fees on all trades at the given rate"
      },
      "largest_drift_asset": {
        "type": "string",
        "description": "Symbol furthest from its target"
      },
      "note": {
        "type": "string",
        "description": "Plain-language caveat about how to read and use the result"
      },
      "source": {
        "type": "string",
        "description": "Where the data or formula comes from"
      }
    },
    "required": [
      "assets",
      "total_to_buy_usd"
    ]
  },
  "extensions": {
    "bazaar": {
      "info": {
        "input": {
          "type": "http",
          "method": "GET",
          "queryParams": {
            "holdings": "BTC:6000,ETH:3000,SOL:1000",
            "new_cash_usd": "500",
            "target_weights": "BTC:50,ETH:30,SOL:20"
          }
        },
        "output": {
          "type": "json",
          "example": {
            "total_value_usd": 10500,
            "new_cash_usd": 500,
            "drift_band_percent": 0,
            "assets": [
              {
                "symbol": "BTC",
                "current_usd": 6000,
                "current_weight_percent": 57.143,
                "target_weight_percent": 50,
                "target_usd": 5250,
                "drift_percent_points": -7.143,
                "action": "sell",
                "trade_usd": -750
              },
              {
                "symbol": "ETH",
                "current_usd": 3000,
                "current_weight_percent": 28.571,
                "target_weight_percent": 30,
                "target_usd": 3150,
                "drift_percent_points": 1.429,
                "action": "buy",
                "trade_usd": 150
              },
              {
                "symbol": "SOL",
                "current_usd": 1000,
                "current_weight_percent": 9.524,
                "target_weight_percent": 20,
                "target_usd": 2100,
                "drift_percent_points": 10.476,
                "action": "buy",
                "trade_usd": 1100
              }
            ],
            "total_to_buy_usd": 1250,
            "total_to_sell_usd": 750,
            "turnover_percent": 9.524,
            "estimated_fees_usd": 0,
            "largest_drift_asset": "SOL",
            "note": "Trades move each asset to its target weight (assets within the drift band are left alone, which can leave small cash differences). Taxes and slippage are not included.",
            "source": "Portfolio rebalancing arithmetic"
          }
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "input": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "http"
              },
              "method": {
                "type": "string",
                "enum": [
                  "GET"
                ]
              },
              "queryParams": {
                "type": "object",
                "properties": {
                  "holdings": {
                    "type": "string",
                    "description": "current values as SYMBOL:usd pairs, e.g. BTC:6000,ETH:3000"
                  },
                  "new_cash_usd": {
                    "type": "string",
                    "description": "optional cash to add (negative to withdraw)"
                  },
                  "target_weights": {
                    "type": "string",
                    "description": "target percentages that add up to 100, e.g. BTC:50,ETH:30,SOL:20"
                  }
                },
                "required": [
                  "holdings",
                  "target_weights"
                ]
              }
            },
            "required": [
              "type",
              "method"
            ],
            "additionalProperties": false
          },
          "output": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "json"
              },
              "example": {
                "type": "object",
                "properties": {
                  "total_value_usd": {
                    "type": "number",
                    "description": "Portfolio value including new cash"
                  },
                  "new_cash_usd": {
                    "type": "number",
                    "description": "Cash added or withdrawn"
                  },
                  "drift_band_percent": {
                    "type": "number",
                    "description": "Drift tolerance used"
                  },
                  "assets": {
                    "type": "array",
                    "description": "Per-asset current state and trade",
                    "items": {
                      "type": "object",
                      "properties": {
                        "symbol": {
                          "description": "Asset symbol",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "current_usd": {
                          "description": "Current value",
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "current_weight_percent": {
                          "description": "Current share of the portfolio",
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "target_weight_percent": {
                          "description": "Target share",
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "target_usd": {
                          "description": "Target value",
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "drift_percent_points": {
                          "description": "Target weight minus current weight",
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "action": {
                          "description": "buy, sell or hold",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "trade_usd": {
                          "description": "Amount to trade (negative means sell)",
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      }
                    }
                  },
                  "total_to_buy_usd": {
                    "type": "number",
                    "description": "Sum of buys"
                  },
                  "total_to_sell_usd": {
                    "type": "number",
                    "description": "Sum of sells"
                  },
                  "turnover_percent": {
                    "type": "number",
                    "description": "Share of the portfolio traded"
                  },
                  "estimated_fees_usd": {
                    "type": "number",
                    "description": "Fees on all trades at the given rate"
                  },
                  "largest_drift_asset": {
                    "type": "string",
                    "description": "Symbol furthest from its target"
                  },
                  "note": {
                    "type": "string",
                    "description": "Plain-language caveat about how to read and use the result"
                  },
                  "source": {
                    "type": "string",
                    "description": "Where the data or formula comes from"
                  }
                },
                "required": [
                  "assets",
                  "total_to_buy_usd"
                ]
              }
            },
            "required": [
              "type"
            ]
          }
        },
        "required": [
          "input"
        ]
      }
    }
  },
  "tags": [
    "portfolio rebalancing calculator",
    "trades to hit target allocation",
    "portfolio drift from targets",
    "rebalance with new cash",
    "allocation 50 30 20 trades"
  ],
  "sourceHost": "saylorinnovations.com",
  "lastUpdated": "2026-10-26T22:14:01.960Z",
  "quality": {},
  "metadata": {
    "serviceName": "Saylor Innovations Data Desk",
    "method": "GET",
    "mimeType": "application/json",
    "inputSchema": {
      "type": "object",
      "properties": {
        "holdings": {
          "type": "string",
          "description": "current values as SYMBOL:usd pairs, e.g. BTC:6000,ETH:3000"
        },
        "new_cash_usd": {
          "type": "string",
          "description": "optional cash to add (negative to withdraw)"
        },
        "target_weights": {
          "type": "string",
          "description": "target percentages that add up to 100, e.g. BTC:50,ETH:30,SOL:20"
        }
      },
      "required": [
        "holdings",
        "target_weights"
      ]
    },
    "exampleResponse": {
      "total_value_usd": 10500,
      "new_cash_usd": 500,
      "drift_band_percent": 0,
      "assets": [
        {
          "symbol": "BTC",
          "current_usd": 6000,
          "current_weight_percent": 57.143,
          "target_weight_percent": 50,
          "target_usd": 5250,
          "drift_percent_points": -7.143,
          "action": "sell",
          "trade_usd": -750
        },
        {
          "symbol": "ETH",
          "current_usd": 3000,
          "current_weight_percent": 28.571,
          "target_weight_percent": 30,
          "target_usd": 3150,
          "drift_percent_points": 1.429,
          "action": "buy",
          "trade_usd": 150
        },
        {
          "symbol": "SOL",
          "current_usd": 1000,
          "current_weight_percent": 9.524,
          "target_weight_percent": 20,
          "target_usd": 2100,
          "drift_percent_points": 10.476,
          "action": "buy",
          "trade_usd": 1100
        }
      ],
      "total_to_buy_usd": 1250,
      "total_to_sell_usd": 750,
      "turnover_percent": 9.524,
      "estimated_fees_usd": 0,
      "largest_drift_asset": "SOL",
      "note": "Trades move each asset to its target weight (assets within the drift band are left alone, which can leave small cash differences). Taxes and slippage are not included.",
      "source": "Portfolio rebalancing arithmetic"
    },
    "parameterLocation": "query",
    "extensions": {
      "bazaar": {
        "info": {
          "input": {
            "type": "http",
            "method": "GET",
            "queryParams": {
              "holdings": "BTC:6000,ETH:3000,SOL:1000",
              "new_cash_usd": "500",
              "target_weights": "BTC:50,ETH:30,SOL:20"
            }
          },
          "output": {
            "type": "json",
            "example": {
              "total_value_usd": 10500,
              "new_cash_usd": 500,
              "drift_band_percent": 0,
              "assets": [
                {
                  "symbol": "BTC",
                  "current_usd": 6000,
                  "current_weight_percent": 57.143,
                  "target_weight_percent": 50,
                  "target_usd": 5250,
                  "drift_percent_points": -7.143,
                  "action": "sell",
                  "trade_usd": -750
                },
                {
                  "symbol": "ETH",
                  "current_usd": 3000,
                  "current_weight_percent": 28.571,
                  "target_weight_percent": 30,
                  "target_usd": 3150,
                  "drift_percent_points": 1.429,
                  "action": "buy",
                  "trade_usd": 150
                },
                {
                  "symbol": "SOL",
                  "current_usd": 1000,
                  "current_weight_percent": 9.524,
                  "target_weight_percent": 20,
                  "target_usd": 2100,
                  "drift_percent_points": 10.476,
                  "action": "buy",
                  "trade_usd": 1100
                }
              ],
              "total_to_buy_usd": 1250,
              "total_to_sell_usd": 750,
              "turnover_percent": 9.524,
              "estimated_fees_usd": 0,
              "largest_drift_asset": "SOL",
              "note": "Trades move each asset to its target weight (assets within the drift band are left alone, which can leave small cash differences). Taxes and slippage are not included.",
              "source": "Portfolio rebalancing arithmetic"
            }
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "type": "object",
          "properties": {
            "input": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "http"
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET"
                  ]
                },
                "queryParams": {
                  "type": "object",
                  "properties": {
                    "holdings": {
                      "type": "string",
                      "description": "current values as SYMBOL:usd pairs, e.g. BTC:6000,ETH:3000"
                    },
                    "new_cash_usd": {
                      "type": "string",
                      "description": "optional cash to add (negative to withdraw)"
                    },
                    "target_weights": {
                      "type": "string",
                      "description": "target percentages that add up to 100, e.g. BTC:50,ETH:30,SOL:20"
                    }
                  },
                  "required": [
                    "holdings",
                    "target_weights"
                  ]
                }
              },
              "required": [
                "type",
                "method"
              ],
              "additionalProperties": false
            },
            "output": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "json"
                },
                "example": {
                  "type": "object",
                  "properties": {
                    "total_value_usd": {
                      "type": "number",
                      "description": "Portfolio value including new cash"
                    },
                    "new_cash_usd": {
                      "type": "number",
                      "description": "Cash added or withdrawn"
                    },
                    "drift_band_percent": {
                      "type": "number",
                      "description": "Drift tolerance used"
                    },
                    "assets": {
                      "type": "array",
                      "description": "Per-asset current state and trade",
                      "items": {
                        "type": "object",
                        "properties": {
                          "symbol": {
                            "description": "Asset symbol",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "current_usd": {
                            "description": "Current value",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "current_weight_percent": {
                            "description": "Current share of the portfolio",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "target_weight_percent": {
                            "description": "Target share",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "target_usd": {
                            "description": "Target value",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "drift_percent_points": {
                            "description": "Target weight minus current weight",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "action": {
                            "description": "buy, sell or hold",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "trade_usd": {
                            "description": "Amount to trade (negative means sell)",
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "total_to_buy_usd": {
                      "type": "number",
                      "description": "Sum of buys"
                    },
                    "total_to_sell_usd": {
                      "type": "number",
                      "description": "Sum of sells"
                    },
                    "turnover_percent": {
                      "type": "number",
                      "description": "Share of the portfolio traded"
                    },
                    "estimated_fees_usd": {
                      "type": "number",
                      "description": "Fees on all trades at the given rate"
                    },
                    "largest_drift_asset": {
                      "type": "string",
                      "description": "Symbol furthest from its target"
                    },
                    "note": {
                      "type": "string",
                      "description": "Plain-language caveat about how to read and use the result"
                    },
                    "source": {
                      "type": "string",
                      "description": "Where the data or formula comes from"
                    }
                  },
                  "required": [
                    "assets",
                    "total_to_buy_usd"
                  ]
                }
              },
              "required": [
                "type"
              ]
            }
          },
          "required": [
            "input"
          ]
        }
      }
    },
    "examples": [
      {
        "label": "Unpaid discovery call",
        "method": "GET",
        "url": "https://saylorinnovations.com/api/crypto/rebalance?holdings=BTC:6000,ETH:3000,SOL:1000&target_weights=BTC:50,ETH:30,SOL:20&new_cash_usd=500",
        "expectedStatus": 402
      }
    ],
    "cacheTtlSeconds": 0,
    "capabilities": [],
    "noAccountRequired": true,
    "noApiKeyRequired": true,
    "sideEffects": "Paid calls settle the advertised payment; see the provider contract for execution behavior.",
    "payment": {
      "protocol": "x402",
      "settlement": "direct-to-provider"
    },
    "provider": {
      "name": "Saylor Innovations",
      "host": "saylorinnovations.com",
      "manifestUrl": "https://saylorinnovations.com/.well-known/x402.json"
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": true,
  "featured": false,
  "provider": {
    "host": "saylorinnovations.com",
    "manifest_name": "Saylor Innovations Knowledge Base",
    "source": "submitted",
    "source_manifest_url": "https://saylorinnovations.com/.well-known/x402.json",
    "submitted_at": "2026-10-26T05:52:02.113Z"
  },
  "exampleResponse": {
    "total_value_usd": 0,
    "new_cash_usd": 0,
    "drift_band_percent": 0,
    "assets": [
      {
        "symbol": "string",
        "current_usd": 0,
        "current_weight_percent": 0,
        "target_weight_percent": 0,
        "target_usd": 0,
        "drift_percent_points": 0,
        "action": "string",
        "trade_usd": 0
      }
    ],
    "total_to_buy_usd": 0,
    "total_to_sell_usd": 0,
    "turnover_percent": 0,
    "estimated_fees_usd": 0,
    "largest_drift_asset": "string",
    "note": "string",
    "source": "string"
  }
}