Contract 01cb467660fc54377ff8fa887c41dae59652bc8b8d9b4d7afed3607981fce7ef

← Back to Index 📥 Download WASM

Meta

Description Price logic to create linear Long Short Pairs
rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.86.0

Instances

  • CAUCHFFMMBCUHCW5IJ7G7Z4WJGHSYT6LLISQBF7LWXLJHTDQWH6WNQXB

Interface

Returns a number between 0 and 1 to indicate how much collateral each long and short token is entitled to per collateral_per_pair. @param oracle_price price from the oracle for the target asset. @param lower_bound lower price boundary from the Long Short Pair. @param upper_bound upper price boundary from the Long Short Pair. @return expiryPercentLong to indicate how much collateral should be sent between long and short tokens.

fn percent_long_collateral(
    env: soroban_sdk::Env,
    oracle_price: u128,
    lower_bound: u128,
    upper_bound: u128,
) -> u128

Imports

WebAssembly Text (WAT) ▶