Contract 6c591b8fe50ac60c2959f0ede4c3e430c74aa297abc69234d6383076712d4f7d

← Back to Index 📥 Download WASM

Meta

cliver 23.4.1#a152ec2488c25136808ad28277c24b3a0765ffd4
rssdkver 23.5.2#347f71141ddf69ef1873527c94ac98e79215f125
rsver 1.92.0

Instances

  • CDHHGWGBGT6APB3CDODQJPGUXLYPIU34VV6PBT7SRRHBY3KEWYJVOQHS

Interface

SELLER: Lists PT for sale on the market.

fn list_pt(env: soroban_sdk::Env, seller: soroban_sdk::Address, amount: i128)

SELLER: Lists YT for sale on the market.

fn list_yt(env: soroban_sdk::Env, seller: soroban_sdk::Address, amount: i128)

Initializes the marketplace with the necessary contract addresses. Call this immediately after deploying the contract.

fn initialize(
    env: soroban_sdk::Env,
    wrapper_address: soroban_sdk::Address,
    usdc_address: soroban_sdk::Address,
)

BUYER: Automatically buys amount_needed of PT from available sellers. Price: 0.97 USDC per PT.

fn buy_market_pt(
    env: soroban_sdk::Env,
    buyer: soroban_sdk::Address,
    amount_needed: i128,
)

BUYER: Automatically buys amount_needed of YT from available sellers. Price: 0.03 USDC per YT.

fn buy_market_yt(
    env: soroban_sdk::Env,
    buyer: soroban_sdk::Address,
    amount_needed: i128,
)

Returns the amount of PT a specific user currently has listed for sale.

fn get_pt_listing(env: soroban_sdk::Env, seller: soroban_sdk::Address) -> i128

Returns the amount of YT a specific user currently has listed for sale.

fn get_yt_listing(env: soroban_sdk::Env, seller: soroban_sdk::Address) -> i128

Imports

WebAssembly Text (WAT) ▶